|
Actually, I dislike the extra parentheses because in this case the condition without them is semantically unambiguous. The extra parentheses just add clutter and can actually decrease readability with more elaborate conditionals.
Kevin
|
|
|
|
|
That seems over-finicky to me. I only do it when the expressions are either long or complex. This is the kind of thing which I would have a s a guideline in a coding standard. "CONSIDER doing X" rather than "You MUST..."
Kevin
|
|
|
|
|
No real men use
test eax, eax
jz $loop
We don't need no stinking curly (girly) brackets!
|
|
|
|
|
|
Gaaaahhh! My eyes! The goggles! They do nothing!
|
|
|
|
|
Quiche Eater! Real programmers don't do structured programming!
|
|
|
|
|
Nope, I wrap them in BACON.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
hmmmmm
|
|
|
|
|
That would be code-in-a-blanket?
|
|
|
|
|
I prefer to think of it as a Perfect Code Sandwich.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Then I reakon I can get fries with that eh?
|
|
|
|
|
Youse just tryin' ta git ma t'say t'Magic Words, y-all!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
A BLC? Bacon, Lettuce and Code sandwich?
Why can't I be applicable like John? - Me, April 2011 ----- Beidh ceol, caint agus craic againn - Seán Bán Breathnach ----- Da mihi sis crustum Etruscum cum omnibus in eo! ----- Just because a thing is new don’t mean that it’s better - Will Rogers, September 4, 1932
|
|
|
|
|
Johnny J. wrote: Bacon, lettuce and Code sandwich
FTFY!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
5
Bacon replies are timely and awesome !
|
|
|
|
|
Thief[^]!
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
Have a bit more patience with newbies. Of course some of them act dumb -- they're often *students*, for heaven's sake. -- (Terry Pratchett, alt.fan.pratchett)
|
|
|
|
|
Since when usage of unnecessary symbols has started improving readability? And aren't we suppose to consistently try to minimize amount of code we write?
|
|
|
|
|
Exactly. Curly braces are noise. Languages with good syntax don't even have them.
|
|
|
|
|
Agreed. Superior languages such as VB.NET don't have stupid braces.
|
|
|
|
|
I really had in mind ML and Python
|
|
|
|
|
Languages like VB.NET - where they realize the user cannot comprehend the beginning and end of a statement lest it be spelled out for them.
You don't have to remain left-out, you know! Just start to program in a language the doesn't presume your IQ consist of one or two digits.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Readability is one reason. There is another one in my opinion, extensibility. We never know whether we'll need to insert a second statement, considering that programming (and thinking) is an iterative and adaptive process.
Best,
Jun
|
|
|
|
|
Jun Du wrote: extensibility
Hahha Yeah, the fact that we're writing our code in stone stops us from adding a pair of braces around new block of code.
And if someone has trouble remembering to add braces after inserting new lines should consider changing career.
|
|
|
|
|
It's not that someone has trouble adding braces concerns me. That is taken care of by the compiler. Some developers tend to closes up their code (and mind) at the first iteration of implementation. As a side note, in reality, I didn't find many cases where one statement is enough.
Best,
Jun
|
|
|
|
|
Jun Du wrote: Some developers tend to closes up their code (and mind) at the first iteration
of implementation.
What a crock of horsesh*t.
Jun Du wrote: As a side note, in reality, I didn't find many cases where one statement is
enough.
Apparently we're not living in the same realities then.
|
|
|
|