PDA

View Full Version : Fixing the Indentation draft



Elysia
02-19-2008, 02:28 PM
OK, so let's try to fix this thing so we can actually merge the two articles.
First, I'll list Mario's suggestion's first, as best I can:

Suggestion #1

You can't advertise "choose one, be consistent" but then advocate just one style throughout your article. It's one thing to write code, it's another to write code to demonstrate how you should indent. In that context it is definitely best to take the opportunity to show the reader different formating styles. Not just one.

Suggestion #2

People don't really need to be taught how to indent. They know how to operate the tab key. They understand the visual significance of properly indenting code as soon as you explain it to them in one or two paragraphs and give some examples. It's a darn damn easy concept to grasp! More so because they experience indenting concepts it even before having any kind of programming education. They did it all the time at school ranging from math class to accounting and physics. They even do it all the time when adding bulleted lists to a word document. They need instead to be directed towards concepts such as "why is it important", "choose your own, be consistent", and "here's a few different indenting styles".

Suggestion #3

You can't force people to choices. You can't for instance tell them they should use tabs instead of spaces, or they should only do indent+1 at every new level. Those that don't agree with you, are coming from a programming background, and are just now learning C/C++, will strongly disregard and reject your whole article. They know better that indenting is mostly about taste and they will take you for a newbie because you don't advertise that.

Suggestion #4

Never ever treat your readers as being stupid! When I started in programming your were probably not even born, I'll take offense. Conversely, when you started programming your lack of knowledge didn't make you stupid. It made you smart.

Suggestion #5

Finally, an article is not going to save the world. No matter how well it is written, you will never achieve any visible results. Keep that in mind when writing them and especially when being so draconian about such simple issues as indentation.

As to these, my current draft at least addresses complaint number 3. I have tried to rewrite it be neutral in ways of coding styles, explaining that they are a good thing and that programmers should try to adopt to their own style. Then it goes on to recommend coding style practices which makes the code more readable.
I also revised the code a little to remove some examples that seemed to "silly," as in perhaps they were making the readers look dumb. I don't think the rest are so low, though. I always like examples because they make your point go across. It's much easier to see an example after reading to actually understand what the heck it's on about.

For complaint nr 1, I have rewritten the code not to promote one coding style, and although the article uses the allman coding style, it does show examples using the "4 big" styles as listed on the page linked to me some time ago. I don't know if I can be clearer than that? Might mixing coding styles actually be a good thing in here? I don't know if using one coding style in one example and another in another might be such a good idea...

As for complaint 2... well, some do not understand indentation properly, and even seeing and understanding what it is, they don't actually understand how to do it so that it looks good, which is why I've opted to put out some guidelines of general coding styles.

And as for complaint 5, I can only say that teaching people to indent properly helps them as they help us. Maybe it should be seen as "strict" as it should be, but merely more like a suggestion. I'm trying to change my posts so it looks a little more that way nowmore. But I still believe indentation and coding styles are important, and they make it so much easier for me, and probably others, too, who actually reads the code others post.
I've seen some big messy code and some very clean, nice code. And I do prefer the clean code. I wish everyone could write such clean code. And I will continue to suggest, and to try, to make people at least try to write such beautiful, clean code. Programming is an art, after all.

Any critiques, suggestions or complains are, of course, welcome. And examples of where there are problems helps big time. And if there would also be an example of what to change the text into, that would help even more.
Let's all make this work so we can close this issue, shall we?

Link to draft, for those who don't know:
http://cpwiki.sf.net/User:Elysia/Indentation

Dave_Sinkula
02-19-2008, 02:40 PM
How about adding a link, or separate entry + link, to code beautifiers (http://en.wikipedia.org/wiki/Prettyprint#Code_Beautifiers). Pick your style of choice and beautify regularly!

Elysia
02-19-2008, 02:43 PM
Might just do that. Thanks for the heads up!
Will add to a TODO.

whiteflags
02-19-2008, 04:40 PM
As for complaint 2... well, some do not understand indentation properly, and even seeing and understanding what it is, they don't actually understand how to do it so that it looks good, which is why I've opted to put out some guidelines of general coding styles.

As I've tried to explain to you though, and I'm not sure if you've listened to me when I've wrote this before, most of the code we see has other problems. I'm pretty sure that most of the issues are caused because people don't know how to program yet. Planning is a part of it, and it's often neglected, at least initially, in most students' assignments. I think this causes a majority of the problems that you see. Some posters here give me the impression that they're designing and writing their homework at the same time.

Not that that's the wrong way initially. Speaking from personal experience, most of the time I was simply put to the task of fixing something that almost worked. As a student, my time was spent working as a debugger. If I had indentation problems it was usually because I didn't understand language concepts and their syntax; I was more worried about fixing it and fixing it now. Most people level out after some experience That's why Dave's suggestion is a good one! People need to understand what their tools do for them, as well as the language before indentation sort of expertly flows out of them.

Consistency is the message that your article doesn't emphasize, and I think you ignore some of the other reasons that poor indentation can happen. Teaching people how to make broke stuff look nice is kind of a waste of time. We can't expect new programmers to know everything, true. But it would insult intelligence to say that programmers can't learn how to, or even prefer, to indent themselves. There should be a difference between "what the article should say" and "how to help posters," and what role the article plays on the forum. On a per-situation basis, it would be appropriate for the poster to say something more I think. Peplies like, "Learn some indentation: http:// ..." are often off-topic and incomplete, especially if the OP asked a decent question.

That is most of the problem I think. Writing a thorough tutorial is always something that I've been very vocal against. despite your claims that the only complaints you've ever recieved is how it's written.

Mario F.
02-19-2008, 06:18 PM
And I will continue to suggest, and to try, to make people at least try to write such beautiful, clean code. Programming is an art, after all.

It sure is an art if you look at it as a creative process. However, I find no romance in cleanly indented code. Instead, I find it in simple and elegant code.

I honestly don't care if code is presented to me - and it has many times throughout my professional life - poorly indented. Contrary to you I don't make a flag out of that. I may advise against it on occasion, but don't use it a measure in order to determine the quality of the code.

My C++ experience is limited to just a couple of years. But I have learned enough of it, and seen enough code, to know its no different from any other programming languages I worked on. Reading poorly indented code is an exercise you better get used to, because it will follow you in case you decide to make programming your career.

As people evolve in their knowledge of the programming language, they themselves start to see the benefits of that and many other so-called good practices. And its not your article, or anyone else's article that will soon bring them enlightenment. It will be their experience.

And that is why I say that being overly descriptive in such an issue as indentation only brings noise and adds nothing to the learning process of the reader other than a general feeling of you preaching him. You won't get any more results. A simple, to the point and generic article will bring just the same results and will be easier to read.

You want people to read your article, not give up half-way because it's boring them like daddy does sometimes.

whiteflags
02-19-2008, 09:43 PM
As people may see momentarilly:


Some languages, such has Python or Haskell, rely on whitespace expressly to delimit their statement blocks ("forced indentation"), but most languages do not use indentation this way. In C, C++, and C# the curly braces are used by the compiler to delimit the beginning and the end of functions and other statement blocks, such as if or while. Formatting your braces consistently is generally only an aid to human readers: most will agree good style is any format which allows a programmer with working knowledge "eyeball" statements associated with those constructs.

So, it's not perfect; mostly perpetually going to be in a bit of a technical nit. Hopefully now the article is intellectually honest than the initial version. Perhaps even Elysia finds this more helpful than before.

Thantos
02-19-2008, 10:46 PM
Forgive me if I missed it somewhere else but:
1) Why the heck is this topic here?
2) Why are you trying to do something so futile?

Elysia
02-20-2008, 12:55 AM
1) Why the heck is this topic here?
Because there are two indentation articles on the wiki and everyone agrees they must be merged. But they cannot be merged just yet, which is why we have the problem.


2) Why are you trying to do something so futile?

Futile indeed? Well, call it whatever, but I'm still going to go through the trouble of doing it so I don't have to explain it later.

Mario F.
02-20-2008, 04:27 AM
Futile indeed? Well, call it whatever, but I'm still going to go through the trouble of doing it so I don't have to explain it later.

Go ahead if it suits your fancy. As I said numerous times it's a subject not worth a tenth of the discussion it has gathered. So, really it's time I give up. Nevertheless I hope you realize that after you finish, your article may be edited by the community.

It's a wiki wicked world.

Thantos
02-20-2008, 08:40 AM
Because there are two indentation articles on the wiki and everyone agrees they must be merged. But they cannot be merged just yet, which is why we have the problem.

Doesn't explain why this topic is HERE and not at the wiki. The wiki's I've been to have discussion pages for the articles.

Mario F.
02-20-2008, 08:56 AM
Doesn't explain why this topic is HERE and not at the wiki. The wiki's I've been to have discussion pages for the articles.

The CPWiki (Cprogramming Wiki, if you will) is experiencing constant timeouts, connection resets, and being generally a hard place to work on. Myself, I gave up on publishing content for a while until sf.net does whatever it needs to do to improve performance on that server.

It was then agreed, any discussion could be done here on the general forum since it would be, at the very least, less annoying than having them over there.

Elysia
02-20-2008, 12:22 PM
Go ahead if it suits your fancy. As I said numerous times it's a subject not worth a tenth of the discussion it has gathered. So, really it's time I give up. Nevertheless I hope you realize that after you finish, your article may be edited by the community.

It's a wiki wicked world.
It is. But the main point was that if it explains something or helps in any way, then I'm for it.
Of course anyone may edit it, but I don't think it will be like last time. No major overhauls without a lot of discussion. If it was, then we'd have a communication problem. As you say, it's a community project.


The CPWiki (Cprogramming Wiki, if you will) is experiencing constant timeouts, connection resets, and being generally a hard place to work on. Myself, I gave up on publishing content for a while until sf.net does whatever it needs to do to improve performance on that server.

It was then agreed, any discussion could be done here on the general forum since it would be, at the very least, less annoying than having them over there.

Not to mention, many seem blissfully unaware that they exist and many do not participate in them and discussion on the forum is 3x better because you can quote, it separates replies, you can get email notifications, it looks better, etc.

whiteflags
02-21-2008, 02:45 PM
It's been a few days and you have yet to attempt to integrate your article with the community one.

]It is. But the main point was that if it explains something or helps in any way, then I'm for it.
Of course anyone may edit it, but I don't think it will be like last time. No major overhauls without a lot of discussion. If it was, then we'd have a communication problem. As you say, it's a community project.
It annoys me that you're using "community" as some sort of brand name for your ideas. Despite any agreement, you continue to link your own pages around as if the community article did not exist. If this becomes commonplace, then there really is no point in having a wikipedia for the site. The articles available become the loosely affiliated, decentralized opinion of a few key individuals (especially that of the so-called "goddess" who basks in her own hype) instead of a group concensus. At least I initially acknowledged your contribution, yet you refuse to extend the same courtesy to the community article.

I can only assume that you honestly think the community article does nothing of value and should be deleted. If that is the discussion at hand, than you as an individual shouldn't reserve the right to speak for everyone involved in the wiki project, either. If it has to become an all-or-nothing deal, then get on with it please, and let the owners trash the subject.

Elysia
02-21-2008, 02:52 PM
It's been a few days and you have yet to attempt to integrate your article with the community one.
Yes, and I've had like 3-4 hours at most at home and most if it I've spent looking around the forum.


It annoys me that you're using "community" as some sort of brand name for your ideas.
I don't, whatever you may think.


Despite any agreement, you continue to link your own pages around as if the community article did not exist.
And as I've already stated, the community article is not sufficient.


...(especially that of the so-called "goddess" who basks in her own hype)...
The user title mean nothing. It is not directed at who I am nor anything else of the type. It is simply a title; nothing more, nothing less.


At least I initially acknowledged your contribution, yet you refuse to extend the same courtesy to the community article.
And I believe I've already stated my opinions on that one. It's too much Wikipeda-esque. Too little tutorials or rich contents. It offers mostly explanations on what things are but never how to fix them.


I can only assume that you honestly think the community article does nothing of value and should be deleted. If that is the discussion at hand, than you as an individual shouldn't reserve the right to speak for everyone involved in the wiki project, either. If it has to become an all-or-nothing deal, then get on with it please, and let the owners trash the subject.
That is my belief since I do not consider it adequate enough. However, I will not do something dastardly and delete the whole thing. It has a right to exist on its own. I do not find it of much use, however.


Having looked over all replies, I have yet to see any concrete help on how to make the article better, save for the ones I already have. Yet, no examples, or sections of text that can be changed from X to Y to demonstrate your point. It helps, you know.
The debate seems to be over whether it's worth it. OK listen, I'm going to reveal my reasons here.
Someone comes with poor indentation in code. Maybe void main. Maybe implicit main. Maybe reading strings with scanf. They are such small, yet subtle problems. And we try to teach them to not do it. Which is to say, why is indentation different? Why not try to teach newbies as much as we can, to share our experience? Linking to the main indentation article does not help, because I'm pretty sure they'll still have problems indenting. That's where my draft comes in. It's rich in description of good coding style rules (though it explicitly also mentions that they aren't rules; they are more like guidelines). So they can actually read that and understand. So we don't have to teach everything every time. That is why we have a wiki!
So whether or not it's worth the time, whether or it's important, it's just an article to link to to make sure newbies get the grasp of indentation a little better. Without us having to explain every single thing. That's what we wanted in the first place.

whiteflags
02-21-2008, 03:28 PM
Please do not play cookie cutter with my replies.


Despite any agreement, you continue to link your own pages around as if the community article did not exist. If this becomes commonplace, then there really is no point in having a wikipedia for the site. The articles available become the loosely affiliated, decentralized opinion of a few key individuals (especially that of the so-called "goddess" who basks in her own hype) instead of a group concensus.

There is no sense in having a wikipedia if there can not be any group concensus over such a stupid issue. That confirms your belief it is perfectly okay to just ignore the community regarding any issue at all, and use it as a platform for your own ideas when people disagree with you. Until we have a public article based upon mutual agreement the subject at hand deserves not to be covered.

Publish your thoughts somewhere else if you are too lazy to take matters into your own hands and fix what's already been written in the community article. I'm urging you to take laserlight's advice. How about you merge it somehow, and then let the interested parties react. I'm sure that we are all smart enough to write something to everyone's satisfaction. It won't kill you to critically review your article, anyway; through revision, you may find a clearer, concise way to help individuals through the main article.

I agree that the main article has shortcomings. For example, the examples section is particularly thin, but I didn't want to judge it myself, because it really hung on how effective the text communicated the idea. After all, as long as the text was understood, the difference between poorly indented and well-indented is obvious; the benefits, obvious.

If you want to teach people the point-of-view of an experienced person, than take a sample program such as this:


#include <string.h>
#include <stdio.h>
#include <stdlib.h>

void process_file ( char * longOrderID, size_t bufsiz, FILE * file );

int
main ( int argc, char * argv[] )
{
if ( argc == 2 ) {
char longOrderID[BUFSIZ];
FILE * fin;

fin = fopen( argv[1], "r" );
if ( fin != NULL ) {
process_file( longOrderID, sizeof longOrderID, fin );
puts( longOrderID );
fclose( fin );
} else {
perror( argv[1] );
}
} else {
puts( "incorrect number of arguments--provide a file to read" );
}
return 0;
}

void
process_file ( char * longOrderID, size_t bufsiz, FILE * file )
{
char * p = longOrderID; /** position in longOrderID **/
char * nl = NULL; /** find newlines **/

size_t read;

strcpy( p, "Value=" );
read = strlen( p );
p += read;
bufsiz -= read;

/** read in chunks: **/
while ( bufsiz > 0 && fgets( p, ( int )bufsiz, file ) != NULL ) {
if ( ( nl = strchr( p, '\n' ) ) != NULL )
*nl = '\0';

strcat( p, "," );
read = strlen( p );
p += read;
bufsiz -= read;
}
}


And use it as the visual aid to explain as you see fit: refer to line numbers like they do in books if you must. I'd use the principles set forth in the community article.

You probably have structural changes you'd like to see; you're free to make them. I just don't want the neutrality of the article completely destroyed. The code above is as well indented if it were written like Whitesmith's, where your paltry "+1 indentation level" rule doesn't exist. The brace placement you suggest is not applicable, because the brace is in the same character row as any statement in the block. You have to be sure that the principles you espouse are in the right place, and expand beyond what is "simple," because oversimplifying is intellectually dishonest.

Mario F.
02-21-2008, 03:37 PM
SCREW indentation!

For crying out loud! Elysia, you are the most /* deleted */ person I have had the displeasure of meeting in my entire so far blissful life.

How about you writing about n++ being better than ++n, or arrays being pointers, or references being useless? These are all things you also say, among other pearls of monkey-genome wisdom you carry on that strange brain of yours. You are a master programmer. You know it all. Write about those too. Forget indentation. You are so much better than that. Teach the stupid people we are.

robwhit
02-21-2008, 03:42 PM
Calm down, people.

abachler
02-21-2008, 03:44 PM
It seems that you assume that there even is such a thing as the 'best' coding style. Personally I write my code for teh people that will be reading it 99&#37; of the time, me myself and I. Most people get used to the sytle that they first learn and stick with it unless there is some significant and real reason to change. Ive been around long enough to see a lot of different coding styles. There is only thing that I can say with certainty, it is generalyl best for a coder to remain consistent int ehir coding style. When I read someone elses code I don't expect them to use the same style that i do, but I do appreciate if they keep teh same style at least within the same project.

Oh and n++ is not the same as ++n



X = 5;
Y = 5;

printf("%d\n", X++);
printf("%d\n", ++Y);

printf("%d %d\n", X , Y);


output -
5
6
6 6


++n increments the variable prior to evaluation, where n++ increments it after

Mario F.
02-21-2008, 03:46 PM
Calm down, people.

I am now. I'm feeling much better.

whiteflags
02-21-2008, 03:55 PM
>> Oh and n++ is not the same as ++n

We know. But the behavior difference is basically the only reason to prefer one or the other, especially considering looping. Nevertheless, people will look at n++ in a for loop and be like "damn you're not optimizing and writing code at the same time! Shock and horror!"

abachler
02-21-2008, 04:00 PM
I am now. I'm feeling much better.

Yeah I take a half hour of scream therapy every day when i get home, helps get things off my chest. I always feel much better too :) I don't know what the neighbors think though lol.

Mario F.
02-21-2008, 04:20 PM
If they think bad, you can always execute another scream therapy session at them, for good measure :devil:

Daved
02-21-2008, 04:36 PM
>> Nevertheless, people will look at n++ in a for loop and be like "damn you're not optimizing and writing code at the same time! Shock and horror!"
That was not the argument being presented. There's no need to derail this thread with that discussion, but if you'd like further explanation I'd be happy to provide it elsewhere.

Elysia
02-21-2008, 04:46 PM
Please do not play cookie cutter with my replies.
It makes it much easier to make sure I address every point. It's either that or try to remember everything and address all which usually just falls apart since I miss something. I prefer the former, to address everything.
It's difficult to merge everything into one quote, as well. Sorry if it's an eyesore.


There is no sense in having a wikipedia if there can not be any group concensus over such a stupid issue.
Which is exactly we we're having this discussion!


That confirms your belief it is perfectly okay to just ignore the community regarding any issue at all, and use it as a platform for your own ideas when people disagree with you.
Clearly, this is not so since I would have ignored any advice I'd been given. I've reformed the draft several times to include suggestions from others, including you.
I've stated my opinions on the main article several times now, and it seems that everything that I'd like it to be, it isn't. It's lacking. And yet there doesn't seem to have been made any big changes to that.


Publish your thoughts somewhere else if you are too lazy to take matters into your own hands and fix what's already been written in the community article.
Mind you, my draft is the main article plus what I believe is important. And if I'd edit the main article, then we'd just get the same problem again because you and at least one other do not agree with how I write things.


I'm urging you to take laserlight's advice. How about you merge it somehow, and then let the interested parties react. I'm sure that we are all smart enough to write something to everyone's satisfaction. It won't kill you to critically review your article, anyway; through revision, you may find a clearer, concise way to help individuals through the main article.
I can do that. But if people do not agree with how I've written stuff and do not give a go ahead, I'll just be blamed for replacing it with my own and the article will revert back.
So I would ask then, should I do this, even though you and especially Mario, do not agree with how it's written?


And use it as the visual aid to explain as you see fit: refer to line numbers like they do in books if you must. I'd use the principles set forth in the community article.
You want me to have one big fat example and keep referring to it through out the article? Horror, I say. Small, precise examples locally are better in my opinion.


The code above is as well indented if it were written like Whitesmith's, where your paltry "+1 indentation level" rule doesn't exist. The brace placement you suggest is not applicable, because the brace is in the same character row as any statement in the block. You have to be sure that the principles you espouse are in the right place, and expand beyond what is "simple," because oversimplifying is intellectually dishonest.
First, it's not "rule" anymore; it's "recommendation" or in other words, what might be suggested but is optional and not demanded.
Second, contrary to your claims, since the code is properly indented, it does follow the guidelines as I've outlined.


SCREW indentation!
Yes, and screw void main too :rolleyes:


How about you writing about n++ being better than ++n, or arrays being pointers, or references being useless?
All the thing I've expressed are my opinions, my view. Even if they seem like something else, like a fact, they aren't. Even if it looks like I'm mentioning it's a fact, it isn't. It's my opinion and my view. It does not mean it is correct, and it is not meant to change your view or opinions or that of the language itself. I've never mentioned that n++ being better than ++n is a fact. It isn't. I have expressed that I prefer n++ over ++n. It's a taste matter.


It seems that you assume that there even is such a thing as the 'best' coding style.
Where did you get this from?
The article itself is written in such a way (or is supposed to be) that it does not promote one style over the other. Which isn't always a very easy thing.


Oh and n++ is not the same as ++n
I know, I know... subtle difference, but it is there.

Mario F.
02-21-2008, 05:07 PM
Elysia, one last time:

Edit the current article - if you feel like doing it - and accept your edit may be edited too. If you don't do that you don't understand what a wiki is and you are not needed in one.

In that case, create your own webpage and spill there all your thoughts.

Elysia
02-21-2008, 05:08 PM
I have already stated that I'm fine with people editing the draft I have. What I don't like is major overhauls, which is why I ask before I replace.

whiteflags
02-21-2008, 05:08 PM
Second, contrary to your claims, since the code is properly indented, it does follow the guidelines as I've outlined.
Whitesmith does not follow your guideline that braces are correctly placed flush on a new line. I believe you misunderstood my claim. There are perfectly acceptable styles that leave the brace on the previous line (as in 1TBS and I think GNU-style), or indent the brace half a tabstop on the next line (as in Whitesmith). The "+1 indentation level" rule/recommendation/lie is therefore overgeneralized (which is a logical fallacy) and written incorrectly.

It is not because "it is pretty, so it is well indented, according to what I said." That's a non-sequitor ill suited to justify your statement.

At least we're getting somewhere.


I can do that. But if people do not agree with how I've written stuff and do not give a go ahead, I'll just be blamed for replacing it with my own and the article will revert back.
So I would ask then, should I do this, even though you and especially Mario, do not agree with how it's written?



And use it as the visual aid to explain as you see fit: refer to line numbers like they do in books if you must. I'd use the principles set forth in the community article.
You want me to have one big fat example and keep referring to it through out the article? Horror, I say. Small, precise examples locally are better in my opinion.


I'm willing to stop this discussion in the next five minutes, just so you do *something* and this can be over.

But then I have some questions for you: Do you agree that the principles in the main article are correct? Iff so, I don't see why you have the justification to replace them with "recommendations," because it is clear that. as written, the work is sufficient. Would you be willing, or are you able to explain to the unwary according to those? That would be substantial progress that furthers everyone's own ends. You cannot take away my right to edit just because you are unhappy with the fact you did not write the result.

And secondly, in response to the accusation that big examples are not precise. If you write the main article as you would your posts, it's clear I will view your article as disjointed. I may make edits so that the article will flow better, or omit examples that do not need to be there. Sometimes, moderate figures can denonstrate copius points and I hope that you realize this.

Mario F.
02-21-2008, 05:13 PM
I have already stated that I'm fine with people editing the draft I have. What I don't like is major overhauls, which is why I ask before I replace.

You don' have to be satisfied about it, you have to live with it.
It's not your article. It's everybody's article. Get over it!

Elysia
02-21-2008, 05:35 PM
Clearly people do no understand what I'm implying.
And clearly it's impossible to reason with you people.
All I want is suggestions to my draft to make it acceptable and approved by the community.
Is it so darn difficult?!

abachler
02-21-2008, 05:42 PM
Clearly people do no understand what I'm implying.


Thats because most of us aren't mind readers. Stop expecting people to know implicitly what your point is, and state it explicitly.

BTW , Mario's rant was so funny and righ ton the mark that its going into ym sig until you get rid of that rediculous piece of self agrandizing spew.

Elysia
02-21-2008, 05:43 PM
Thats because most of us aren't mind readers. Stop expecting people to know implicitly what your point is, and state it explicitly.

And clearly it's no use trying to state it explicitly anyway because it's either ignored or misinterpreted.

Mario F.
02-21-2008, 05:47 PM
All I want is suggestions to my draft to make it acceptable and approved by the community.
Is it so darn difficult?!

Everything that have to said about those suggestions was said already! This indentation article has been debated for what? 3 months now!?


If you still want suggestions then you want us to take you by the hand. In that case you shouldn't even be trying to write this article.
If you want approval then you have a problem of lack of confidence, in which case you shouldn't even be trying to write this article.Does this sound to you like a tip? Probably not. You aren't smart enough.

Elysia
02-21-2008, 05:51 PM
If you still want suggestions then you want us to take you by the hand. In that case you shouldn't even be trying to write this article.
NO! I want people who object to take a look, see what's missing and point out what can be changed, with examples if possible. That way you get your point across.


If you want approval then you have a problem of lack of confidence, in which case you shouldn't even be trying to write this article.[/LIST]Does this sound to you like a tip? Probably not. You aren't smart enough.
That's very nice of you.
You're all saying this is a community project and so if I can't get it accepted by the community, it shouldn't be there, should it? It's not lack of confidence and I shouldn't give up just because two stubborn people are blocking my way.
You aren't helping anyone and I'm trying to help others with a richer article to which you seem to object!

Are we going to turn this into a flamewar now? You seem to be a good at being rude.

Mario F.
02-21-2008, 06:00 PM
two stubborn people are blocking my way

I'm now completely convinced I'm talking to a child. So really... sorry, but I'm out of here.

whiteflags
02-21-2008, 06:24 PM
Sorry, I had to take a break for dinner.


NO! I want people who object to take a look, see what's missing and point out what can be changed, with examples if possible. That way you get your point across.

Ironically, I'm asking you to integrate your thoughts into the community article the exact same way. The only difference is that, much of the substance of the main article is expressed in its' first section. I'll reproduce it here for convenience:


As in writing, one style does not suit all the programmers in the world. Apart from expectations in the workspace, programmers will commonly differ on several points concerning indentation and programming style, mostly out of personal preference.

Most view indentation as a presentation model that simply needs consistency and consideration for the medium where the code will be printed or displayed. For instance, at cboard, we often see code indented with a mixture of tabs and spaces instead of picking one or the other and unintentionally causing it to be formatted improperly by browsers in a fixed-width font.

Achieving consistency is easy if you choose to adopt an already existing style such as K&R or Allman style, however, programmers sometimes develop their own tastes and opinions about what “looks good” through programming experience. Common considerations in the format of any style guideline are:


placement of braces and parentheses;
spacing between operators;
tab length (or the sum of the spaces from the beginning of a line);
the arrangement and format of comment lines;


Individuals may find it rewarding to rotate their indentation styles to keep their work from getting repetitive or simply getting used to a style they may be expected to use more commonly. It is equally important to avoid deviating from the style, and to never rotate styles in the middle of a source file or project, where the indentation may become a distraction.

That's all I felt particularly needed to be said. I'm not trying to be stubborn, but as per my original suggestion, I ask if you will or if you are capable of teaching them according to this. Specifically, I think you could easily "teach people how" with the four bullets I put into the article, with examples as necessary. You may have to rewrite a substantial bit of what your article says, and make structural changes to the community article, but I think you can express yourself in accordance with this part at least.

I urge you once again to merge your piece with the community article, unless you substantially disagree with its contents and where particularly it is wrong. Have I misrepresented the subject? That may justify a complete rewrite with your draft in its' place, and you will, at last, be represented in the wiki.

Elysia
02-21-2008, 11:57 PM
Thank you, at least, for making an effort with this.
I'll tell you what I'll do. I'll have a look over the main article again and compare it to the draft and try to re-evaluate the draft and see how well it adheres against your suggestion.
Then I may attempt to re-write and we'll how how it turns out.

MacGyver
02-23-2008, 08:08 AM
Wow..... what I have I missed? :confused:

BTW, that's a somewhat rhetorical question..... But I didn't know some people could get this worked up over this kind of thing.

Elysia
02-23-2008, 08:14 AM
I've gone over the main article and my draft.
I made a few minor changes to the main article. A small edit to be more gender neutral and I also commented out the part that actually encouraged the use of spaces. Since we're supposed to be neutral, I don't think it's appropriate. Perhaps it would be best to be rewritten in such way that the feature could be recommended if spaces are used.
Let the interested parties react...

Anyway, I also went over my own draft and made some subtle changes to put more emphasis on that coding styles are not limit by set rules and that each programmer should create or choose their own style. I also made a few changes to bracket placement as to not actually recommend much "good placement," but more "avoid bad placement."
I also added a section for code beautifiers and actually went as far as to encourage the use of them.

http://cpwiki.sourceforge.net/User:Elysia/Indentation

Mario F.
02-23-2008, 08:43 AM
Wow..... what I have I missed?

An opportunity to be quiet.

MacGyver
02-23-2008, 09:08 AM
An opportunity to be quiet.

Coming from you, that's rich. ;)

Mario F.
02-23-2008, 09:19 AM
Yeah. But I was here first .

BTW: I miss getting annoyed with you :p Start a thread on Kosovo.

whiteflags
02-23-2008, 09:38 AM
At least it appears to be over. I've never felt so dirty.

Elysia
02-23-2008, 10:05 AM
Anyway, what's the say on the draft? Can we put this issue to rest or is it too early?

twomers
02-23-2008, 10:08 AM
Wait a second.
This will require a lot more time than this. So far as I'm concerned we haven't even established the optimal form of indentation...

Elysia
02-23-2008, 10:10 AM
I can wait forever. It seems others are impatient.
I just want to know it the current draft will do. If the current draft is good enough to be considered as to be able to replace the current main page.
Then all the interested parties can go typing away to fix it up to what they think is necessary.

CrazyNorman
02-23-2008, 11:06 AM
>> Oh and n++ is not the same as ++n

We know. But the behavior difference is basically the only reason to prefer one or the other, especially considering looping. Nevertheless, people will look at n++ in a for loop and be like "damn you're not optimizing and writing code at the same time! Shock and horror!"

Just for the sake of keeping a flamewar going, it can be a good habit to use ++n within loops, not for performance reasons, but because of iterators. Although all of the standard iterators will be fine with n++, some custom written iterators do not implement the copy constructor, and thus ++n will work, while n++ will not compile. Thus, ++n everywhere enforces consistency.

Elysia
02-23-2008, 11:16 AM
I find the point moot. Since ++n and n++ does different things, there are times when you will avoid from using the same syntax. It's also a matter of opinion, because a few construction/destruction/copying of objects isn't going to hurt performance very much unless done very much.
So I usually say go with whatever you fancy and don't worry about it.
And btw, things lacking a copy constructors such as iterators are broken (things which should allow to be copied).

Now, back to the indentation or coding style draft.

laserlight
02-23-2008, 11:17 AM
Although all of the standard iterators will be fine with n++, some custom written iterators do not implement the copy constructor, and thus ++n will work, while n++ will not compile.
I think those custom iterators need to be fixed.