|
As mentioned before, any of the control keywords are just as good for me to recognize the start of a code block as a brace, so that is not a good reason in my book. A control keyword lining up with a closing brace is all I need.
This is all the more true when you have a lot of nested structures: it's hard to recognize the actual functionality of a code if half of the editor window shows only control statements and braces.
As for refactoring, why would you move the control statement without the succeeding block?
But as you said, none of this is a huge deal. For the code I currently deal with it probably would be a bad idea. It's old and riddled with control statements - it's hard to figure out what it does no matter the formatting, but not being able to see much of the relvant statements in the editor window because of added lines for braces would even be worse. For newly written code it probably would be much less of an issue either way.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
IMHO - the goal of formatting is to make the structure of the code visible, explicit, so the reader does not have to dig into the code and try to decipher its structure. Some people have the naive view that formatting as merely "pretty printing" or making the code neat and tidy. This leads to inconsistent formatting conventions and the mistaken idea that formatting is a matter of individual style rather than an engineering topic.
Making the code pretty with an individual style only accomplishes half of the goal of making the structure explicit. It does not provide a basis for a consistent set of guidelines for the formatting.
|
|
|
|
|
Member 10475170 wrote: This leads to inconsistent formatting conventions and the mistaken idea that formatting is a matter of individual style rather than an engineering topic.
It is a matter of individual style.
Conversely if you think it is not then presumably you have some objective data to back up the assertion that it provides measured benefit.
|
|
|
|
|
Maintenance programmers everywhere would like a word with you outside.
|
|
|
|
|
jschell wrote: Conversely if you think it is not then presumably you have some objective data to back up the assertion that it provides measured benefit. hear hear
(Or should that be here here?? )
|
|
|
|
|
The problem is that everyone experiences program structures in a subtly different way, and thus, if asked to format the code accordingly, will use different styles. It's not so much that the programmers format the code with the goal in mind to make it "look pretty" - they format it in the way that makes the most sense to their personal perception.
The funny (or sad, depending on how you look at it) thing is, that the only objective argumments that you can get people to agree on are those related to "pretty printing", e. g. line length or width of indentation. It's pretty much impossible to agree on how to "correctly" express program structure in formating...
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
Espen Harlinn wrote: is to avoid wasting time discussing coding styles.
Yes, wasting time is much better spent on what the sport team did last weekend and what it will do next weekend.
|
|
|
|
|
jschell wrote: Yes, wasting time is much better spent on what the sport team did last weekend and what it will do next weekend.
True, and everybody knows that we're wasting time, and not pretending to work
|
|
|
|
|
OriginalGriff wrote: Reformat the whole lot to Whitesmiths style!
Then you can breathe easy... +1
Isn't that the real 1TBS?
Ralf
|
|
|
|
|
Code VB instead! *Hides*
It's an OO world.
public class Sander : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
}
|
|
|
|
|
Well VB at least has the advantage of not being able to run on a crackdingle berry.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Giving up coding seems a bit of an overreaction...
|
|
|
|
|
...I don't see a problem here! Does that make me a bad person?
Well fads they come and fads they go.
And God I love that rock and roll!
Well the point was fast but it was too blunt to miss.
Life handed us a paycheck, we said, "We worked harder than this!"
|
|
|
|
|
That's an implicit endorsement of a brace style I dislike, so yes it does.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Well which one don't you like?
Well fads they come and fads they go.
And God I love that rock and roll!
Well the point was fast but it was too blunt to miss.
Life handed us a paycheck, we said, "We worked harder than this!"
|
|
|
|
|
The wrong one, of course.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Exactly.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
You were already bad, don't try to fool us...
|
|
|
|
|
Invest in a code reformatting tool & rest easy.
Of course, if there's multiple devs involved, then you also need to invest the time in applying a standard formatting prior to check in (to avoid the 'every line has been changed' problems of source code comparison.
MVVM # - I did it My Way
___________________________________________
Man, you're a god. - walterhevedeich 26/05/2011
.\\axxx
(That's an 'M')
|
|
|
|
|
ctrl+e+d reformats according to your VS settings.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
0) Unfortunately VS doesn't support targeting CackBerry
1) I have to use a rimmed version of Eclipse
FILE_NOT_FOUND: No posting constructive replies to an obvious venting session
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Dan Neely wrote: FILE_NOT_FOUND: No posting constructive replies to an obvious venting session
Yeah, sorry, nasty habit pissing on a good rant
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Dan Neely wrote: Some opening braces on their own line; others on the preceding line.
The real question is does the code function properly?
|
|
|
|
|
JimmyRopes wrote: The real question is does the code function properly?
Which part of...
Quote: For my sins I'm investigating the possibility of porting one of my employer's apps to the BB10 platform
... id you not understand?
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Dan Neely wrote: Which part of...For my sins I'm investigating the possibility of porting one of my employer's apps to the BB10 platform...id you not understand?
I id understand you were porting it to a BB10 platform which makes it important that the code functions properly or you will be porting code that does not meet the functionality of the application.
Which part of...
JimmyRopes wrote: The real question is does the code function properly?
... id you not understand?
|
|
|
|