Stack Overflow – like most online communities I've studied – naturally trends toward increased strictness over time. It's primarily a defense mechanism, an immune system of the sort a child develops after first entering school or daycare and being exposed to the wide, wide world of everyday sneezes and coughs with the occasional meningitis outbreak. It isn't always a pleasant process, but it is, unfortunately, a necessary one if you want to survive.
Jargon file still missing “Highlander” for when “there can be only one”. Meaning you have a section of code for which only one process or thread can be alive at a time.
Dude, what’s wrong with “egyptian brackets”? That’s the only way I’ve ever written code. For two decades. Putting a bracket on the same line as a conditional or loop makes everything in between a lot easier to read and indent. Putting the closing bracket on its own line at the bottom (sometimes followed by a comment on what it’s closing, if it’s a nested block) makes it clearer what the closing bracket relates to. Saves a line at the top, and the syntax reads cleaner at the bottom. I’ve always hated the style of putting opening brackets on the next line down…or closing brackets at the end of a code line. I fix other people’s code into “egyptian” before handing it back to them because the other variants piss me off. In what way is this some new Stack Overflow craze? Do you think I read stack overflow and came to a sudden realization that this was a way to write code? No. This is the way clean code looks. And has always looked, whether it’s in C, Perl, Actionscript, PHP or anything else that takes a lot of brackets. Some Perl and C++ coders’ tendency to put the opening bracket on next line is, honestly, stupid-looking and hard to read. Python and Ruby coders might get a pass for just having a completely shitty-to-look-at language, but using Pythonic formatting in languages that take bracketed conditionals is just a magnitude of stupidity higher.
Being the person who coined “yoda conditionals”, I obviously felt let down when it was deleted. But now that I’m featured in a blog post of Coding Horror, I must say I’m proud of my call.
To everyone criticizing it: it’s time to update your compilers. Neither Java nor C# will let you assign something in an if statement, and most C and C++ compilers will emit a warning if you do. At least, gcc and clang do; I wouldn’t be surprised if VC++ did as well.
The opposite of “Egyptian Brackets” would be “Hadouken Brackets”, then? (BTW, I completely agree with Félix regarding to “Yoda Conditionals” - and c’mon, hire good professionals, don’t screw your code just because you want to protect your software from them)
This language says a lot about programmer culture. We have “Jimmy”, the clueless new programmer, who is male because programmers are male by default. We have the “mad girlfriend bug”, which programmers can empathize with because they are straight males who know what it is like to have a mad girlfriend. And we have “hooker code”, which relies on the idea of prostitutes as unclean and unsafe.
Here are some of mine
Christian Magic-
A piece of code someone else wrote or you wrote at 4 am that you have no idea how it works, but it does you just have to believe
360 no scope-
Don’t know how this came around but its when you get a service leak on andriod (or something equal) cause it just snuck right up on you.
@js, “I fix other people’s code into “egyptian” before handing it back to them because the other variants piss me off.” - You must be a great guy to work with, with you knowing what clean code looks like and what looks stupid and everything.
I skimmed the Hindenbug entry and thought I saw a ‘Cronenbug’ – this would be named after David Cronenberg the horror movie director and would describe a bug which makes your head explode.