I need to vent for a minute, because I'm so fucking sick and tired of this when I have to modify someone elses code, or even look upon it.
If you code in 1TBS style, I fucking hate you. I hate you with every fiber of my being. I want to know what is wrong in your brain that makes you think that 1TBS is the "proper" or more "acceptable" way to style your code. Why are you so fucking dense and incapable of simple human comprehension of visual coding styles that you want to subject others to your shitbag, fucked up, illegible coding style? I fucking hate you. I FUCKING HATE YOU AND I AM NOT THE ONLY ONE. If I could reach through the internet and punch you in the face, I would. I would spend my days punching every single asshole who writes code in 1TBS style in the face... that would be my purpose in life and I would attack that purpose like a manic-depressive fat girl on a giant ham after her internet boyfriend left her for another lithe woodelf in a different guild.
I would sit, at my chair and spend 23 hours a day, taking only a single hour to sleep and eat and shit throughout a 24 hour day, punching you in the face. On Christmas and other holidays, I would treat myself and fly around around the world, with a satellite phone hooked up to my laptop on a chartered jet, punching each of you in the face over the internet, just so I could spend more than 24 hours in a single day punching you. I would have this jet fly with the setting sun, so I am always punching you just when you're sitting down to dinner, I would do this for nearly 48 hours straight, hopped up on Mt. Dew and Red Bull. This is how much I hate you.
On New Years, I would fly to Australia and spend the entire day punching the most egregious offenders of this fucked up indent style, then I would fly to back to the US and DO IT ALL OVER AGAIN ON THE SAME DAY.
Tell me, you 1TBS motherfuckers, tell me why you think your indent style is something even marginally approaching reasonable? It's fucked up. It is idiotic. IT IS COMPLETELY UNREADABLE. Why do you do it? Do you hate other people? Are you so antisocial that you can't get it through your head that it makes your code look like complete shit? Do you not understand that it makes debugging or following your code all but impossible? Do you think you are in 1970 where every single byte counts? What is it? What makes you think it's ok to indent like this?
// most of the protocols are followed by ://, but mailto: and sometimes news: not, check for it
if ( in_array( $bits['scheme'] . '://', $wgUrlProtocols ) ) {
$bits['delimiter'] = '://';
} elseif ( in_array( $bits['scheme'] . ':', $wgUrlProtocols ) ) {
$bits['delimiter'] = ':';
// parse_url detects for news: and mailto: the host part of an url as path
// We have to correct this wrong detection
if ( isset( $bits['path'] ) ) {
$bits['host'] = $bits['path'];
$bits['path'] = '';
}
} else {
return false;
}
That is fucking goddamned unreadable.
Pick a readable indent style. Allman makes the most sense:
// most of the protocols are followed by ://, but mailto: and sometimes news: not, check for it
if ( in_array( $bits['scheme'] . '://', $wgUrlProtocols ) )
{
$bits['delimiter'] = '://';
}
elseif ( in_array( $bits['scheme'] . ':', $wgUrlProtocols ) )
{
$bits['delimiter'] = ':';
// parse_url detects for news: and mailto: the host part of an url as path
// We have to correct this wrong detection
if ( isset( $bits['path'] ) )
{
$bits['host'] = $bits['path'];
$bits['path'] = '';
}
}
else
{
return false;
}
Look. Gaze upon it. It's easy to follow. It's easy on the eyes. You can quickly see what bits of code belong to what controlling statment. You can see what opening brace matches with what closing brace. You can see what else matches with what if. You can see how many else statements there are. Seriously. Look at it. Now look back at your shitbag 1TBS code and tell me the same thing is true. You can't, because if you do you are a fucking liar. You're already an idiot for using 1TBS, don't make yourself a liar, too.
Now, go cry me a fucking river about how Allman takes up more room or some other line of complete bullshit. It's not about visually compacting your code, it's about MAKING IT FUCKING READABLE. Your shitbag style may be more compact, but guess what? WHO THE FUCK CARES? Nobody. Not a single fucking person on the planet will ever care how compact your code is. They care about whether it works. Then there's the poor fucking bastards that have to maintain it after you've gone off to spread your disease to other projects, and let me tell you, they do NOT FUCKING GIVE A SHIT how compact your code is. They care about it being readable and sensible. Your shitty style is neither. STOP. JUST STOP. Take your 1TBS style and stick it so far up your ass that it pops out the top of your head, hopefully taking the part of your brain with it that makes you think 1TBS is an acceptable indentation style.
Fuck you.