Bitcoin Forum

Other => Off-topic => Topic started by: Inaba on April 05, 2012, 02:50:10 PM



Title: Need to vent
Post by: Inaba on April 05, 2012, 02:50:10 PM
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?

Code:
        // 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:

Code:

        // 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.



Title: Re: Need to vent
Post by: Kluge on April 05, 2012, 03:01:46 PM
I like how the first set of code doesn't make me scroll down just to read it.


Title: Re: Need to vent
Post by: kokjo on April 05, 2012, 03:07:43 PM
U MAR SIR?

Code:
// 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;
}


Title: Re: Need to vent
Post by: Phinnaeus Gage on April 05, 2012, 03:09:48 PM
I like how the first set of code doesn't make me scroll down just to read it.

I like the first one, also, for the same exact reasons.

~Bruno~


Title: Re: Need to vent
Post by: terrytibbs on April 05, 2012, 03:10:39 PM
I use 1TBS.

https://i.imgur.com/CoLhP.jpg


Title: Re: Need to vent
Post by: yogi on April 05, 2012, 03:16:17 PM
Yes, the first one. Nice and compact.


Title: Re: Need to vent
Post by: SkRRJyTC on April 05, 2012, 03:21:06 PM
Im guessing that the people responding saying they like the first example better have never had to maintain code?

I totally agree with you OP.


Title: Re: Need to vent
Post by: John (John K.) on April 05, 2012, 03:21:26 PM

Ditto.



*actually I use the 2nd one in my projects.*


Title: Re: Need to vent
Post by: rjk on April 05, 2012, 04:33:49 PM
I must agree that the second code block is much more readable, but it doesn't really matter if your IDE/notepad supports customizable syntax highlighting.


Title: Re: Need to vent
Post by: P_Shep on April 05, 2012, 05:30:52 PM
I concur.


Title: Re: Need to vent
Post by: teflone on April 05, 2012, 06:23:13 PM
I like how the first set of code doesn't make me scroll down just to read it.

This


Title: Re: Need to vent
Post by: koin on April 05, 2012, 06:32:34 PM
i like when it doesn't matter what indentation and formatting style i use because it gets reformatted to the project's settings when i check it in.


Title: Re: Need to vent
Post by: Phinnaeus Gage on April 06, 2012, 02:31:14 AM
Im guessing that the people responding saying they like the first example better have never had to maintain code?

I totally agree with you OP.

On second thought, the second one is the bee's knees when it comes to code.

~Bruno~


Title: Re: Need to vent
Post by: Nesetalis on April 06, 2012, 05:08:50 AM
I'm with the guys who get auto-formatting :p

but as for readability, both. Depending on what i'm coding on. If i'm on my EeePC, 1TBS all the way.. if I'm on my desktop, then it depends on what I'm doing.


Title: Re: Need to vent
Post by: NothinG on April 06, 2012, 05:29:14 AM
http://dot.net/files/89_i55jl/TrollFaceDancing.gif

Code:
if(in_array($bits['scheme'].'://',$wgUrlProtocols))$bits['delimiter']='://';elseif(in_array($bits['scheme'].':',$wgUrlProtocols)){$bits['delimiter']=':';if(isset($bits['path'])){$bits['host']=$bits['path'];$bits['path']='';}}else return false;


Title: Re: Need to vent
Post by: Xmufa23X on April 06, 2012, 07:21:37 AM
I do like the second a bit better. Never noticed that there was Indent Styles in code. But I never do anything much more then some simple Java, .json, .yml, things of that sort.



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.
Hahaha


Title: Re: Need to vent
Post by: naypalm on April 06, 2012, 12:03:49 PM
IDE's are for chumps, VI or notepad ftw  ;D


Title: Re: Need to vent
Post by: Kettenmonster on April 06, 2012, 12:53:26 PM
Don't use C coding standards even if slightly modified for C++. (http://www2.research.att.com/~bs/bs_faq2.html#coding-standard)


Title: Re: Need to vent
Post by: dayfall on April 06, 2012, 03:29:43 PM
I use Allman.  But I absolutely hate using spaces for indention. 


Title: Re: Need to vent
Post by: Raoul Duke on April 06, 2012, 04:09:59 PM
http://www.prettyprinter.de/module.php?name=PrettyPrinter

Now, STFU and use all that anger for something useful, like coding, for instance... ;)

BTW, I have no f*cking idea if the shit I linked to really works. Don't punch me, please! :D