Seen in a list of computer jokes at Quora. More of an observation than a joke.
There are two types of programmers.
Type 1:
if (x==1)
{
return TRUE;
}
Type 2:
if (x==1) {
return TRUE;}
I'm emphatically Type 1. It separates the condition from the consequence, making it easy to read and debug. You can also put a separate comment beside each line, which is sometimes needed. I can't stand Type 2, which seems to be the absolute standard now, especially in Javascript.
The commenters reflect the reasons for the two preferences.
First commenter agreed with me. Type 1 is READABLE, Type 2 isn't.
Second commenter lectured the first: Why in the world do you want to waste two linebreaks?
The second commenter DOESN'T UNDERSTAND HOW COMPILERS WORK. The extra linebreaks are a couple of added bytes in the source file, an utterly meaningless extra when the source may be one or two megabytes. Those two extra bytes can't possibly affect the resultant runtime code. The compiled code may even exclude this whole condition if the compiler knows that x is guaranteed to be 1. Compilers are SMART.
