Lies Programmers Tell Themselves
itwbennett writes "Everybody lies to themselves now and again in both their personal lives ('my bathroom scale probably needs to be recalibrated') and professional lives ('this code doesn't need commenting'). ITworld has compiled some of the common lies programmers tell themselves. Here are a few examples: 'This bug won't take long to fix.' 'No one could possibly fail to understand my simple user interface.' 'Code is self documenting.' 'My homebrew framework will be nimble, lightweight, debugged, and easy to use.' 'I know this is dirty code, I will rewrite it later.' 'It's just one line... it won't break anything.' '"It works on my machine.' 'I don't need version control.' 'It's written in ____, so it'll be easy to ____.' What would you add to this list?"
"It always takes longer than you expect, even when you take into account Hofstadter's law."
"Sum Ergo Cogito"
Most of these are obvious and well understood.
Some (slightly less obvious) ones:
- Something must be wrong with this library (that is used successfully by everyone else)
- Theoretically two threads could try to change that variable at the same time, but it’ll never actually happen
- Just about anything starting with "no one will ever"
- Anyone who wants to use this class will look at the code / documentation and see that they can't actually use it in that (usually intuitive) manner.
Also can we please stop posting articles from itworld. They are all the same: tiny bits of content split over a ridiculous number of pages to maximize ad revenue.
Seriously, this is like 1990s levels of ad spamming. First you have the full window click through ad, then you have ads on every 10 word slide, a click through in the middle of the slides, and then just for good measure the last slide isn’t a content slide but yet another ad!
I feel like I need 10 levels of toolbars and bonzo-buddy running in the background to really appreciate the experience of this site.
My personal favorite! *sigh* Oh well.
"Quote me as saying I was mis-quoted." -Groucho Marx
"My facial hair makes me look interesting and makes up for my lack of social graces."
"I need to pick wacky, completely abstract name (that have nothing to do with function) for the new thing I made...that's a novel idea that will make it easy for people to remember!!"
ex: Yahoo, whatsapp, tumblr, Gentoo, etc etc
Thank you Dave Raggett
I'll document this code once I'm done.
n/a
Lie 10: itworld.com has interesting, informative, insightful, and meaningful content.
-73, de n1ywb
www.n1ywb.com
"Posting my article as a slideshow is a good idea"
We arn't beating a dead horse here. We are beating the pink stain on the floor where the horse used to be. While we are at it, lets talk about how shitty airline food is.
My contribution: this is just a prototype to show that this will work, the real version will be implemented properly.
with very few exceptions, any documentation that might come with code is completely
trivial and to the extent that it isn't, totally out of date
lets add annotations to the top of functions which merely repeat their signatures
and then run it through a formatter to rip out the bodies
then publish the context-less signatures as an html and pdf
and congratulate ourselves on having well documented code
oh uhh lies programmers tell themselves..
how about
this new website design is going to be great, our users will love it!
"I am a good programmer."
"Well if you let the programmers run the show, things would be so much better."
Obliteracy: Words with explosions
http://deslide.clusterfake.net... OR http://desli.de/11IH for one ugly web page to read all at once! ;)
Ant(Dude) @ Quality Foraged Links (AQFL.net) & The Ant Farm (antfarm.ma.cx / antfarm.home.dhs.org).
Good code rarely needs commenting though. Too many comments are often an indicator of poorly organized code.
Dear person who thinks that "good code rarely needs commenting": the entire world wants to beat you senseless with a nine iron.
You're welcome.
"I am logging what is needed to trouble shoot a problem."
There is no "-1 offended" or "-1 you don't agree with me" mod options for a reason.
1) People will enjoy this content more if it's in a slideshows.
2) It's OK if ad-blocking breaks my core javascript functionality.
3) Nobody is going to view this site in a modern browser.
* Changing X will have absolutely no effect on Y since I don't know any place where Y references X.
* I'll just take care of all the small bugs first before tackling this monster deliverable.
* Pulling this code out of the client and putting it into a store procedure won't break anything.
Occasionally living proof of the Ballmer peak.
I'm behind a firewall
As soon as I've finished the main part, I will go back and deal with any sections I've flagged with # TODO
#DeleteChrome
"Screw comments! It was hard to write, it should be hard to read!"
See also: this start-up is gonna rock! We'll all be zillionaires!
It should work in any browser.
"Users love slide shows!"
I browse on +1 so AC's need not respond, I won't see it.
I have lots of time to get this code done.....I'll catch up on Slashdot's articles......
that does not work _at_all_ if you have a halfway decent content- and tracking-blocker installed
What the ? I can't understand this code straight away without thinking about the problem or why they wrote it this way? It's shit!
Actually, a lot of problems are complex, and there isn't a single straightforward way to implement it. It could be that doing it the obvious way works - up to a certain point, and then the whole thing needs writing in a new totally non-obvious more complex way, in order to cope with x. (latency, bandwidth, text encoding, ACID compliance, European data protection law, occasonal data spikes which make the stack explode if you use a recursive function, certain servers only having python 2.6 on them still, etc. etc. etc.)
As theold adage says: "There's nothing more permanent that a temporary solution".
Good code rarely needs commenting though.
This is actually true, but it's not interesting, because the #1 lie programmers tell themselves is "I am writing good code".
And really, it's always worth documenting corner cases, and everything non-trivial has corner cases. Even the somewhat trivial stuff like what a function does on bad input needs documenting, though I'd prefer unit tests to English for that stuff.
The purpose of the function, and the way the parameters are used, is often clear from the names, but the returned value doesn't have a name and is unclear more often than you'd think. But really, is the "remarks section" of the comments that is usually lacking. The summary and parameter documentation is often content-free, but comments about the return value, and especially any other detailed notes are quite valuable.
Socialism: a lie told by totalitarians and believed by fools.
it's still just as confusing & alienating
Look at Bluetooth's name origin...***technically*** you can see what they were thinking but that doesn't make it any less confusing:
via wiki
It's just too much...
I know that every "wacky abstract name" probably has **some** kind of funny quirky story...that doesn't make it a useful name
Thank you Dave Raggett
"These specs are now exactly what the client wants, no need to think of eventualities"
"Nobody will ever need that feature"
"I don't need to comment that, it's obvious what it does"
"Once the prototype runs, it's going to be easy"
"I'll do it right, then I'll never ever have to touch it again"
"One last meeting to go to"
"There's no possible way this could become a security risk"
$change + "can't break anything"
"It COULD create a race condition in theory, but it can't happen in reality"
And finally, the ever popular
"I'll just slap something together now so we can ship it, I'll eventually get around to do it right"
We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
http://xkcd.com/927/
Let us not forget that almost every framework you "should use" started out as a framework that "shouldn't be written." Only after enough people changed their mind, did the original author(s) become visionaries instead of "people who reinvented the wheel." I find that the tendency to "don't write that, it's already been written!" has been greatly blown out of proportion and people are allergic to actual software engineering. In other words, if they do more than extend / implement a predefined interface or glorified configuration on a single class instance... like heaven forbid they define an interface, base class, or object model with multiple things that derive it, then by god, they've gone too far! There is a time and place for frameworks, and realizing that the time and place isn't "every freak'n time" is just as important as not constantly reinventing the wheel.
"If we rewrite this from scratch, it'll be WAY better!"
People that don't think that they need to fix compiler warnings produce programs that aren't always reliable.
And even if the code is free of warnings - there may still be a need to run 'lint', 'findbugs' or any similar tool that does a more thorough analysis of the code in order to detect problems that can grow over time.
If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
I have hammer, problem is nail
Good code needs commenting, but "too many comments" also happens. It tends to be common when people think that comments should tell what the code does, instead of why the code does what it does. If you can't explain why you have a method/function in the comment for that item, there's a problem.
Not a sentence!
If I keep working these extra hours, the company will reward me with big raises and job security.
Of course it is. However, it is like PHP in the sense that non-programmers can wield the magic wand and crank something out that LOOKS like it works, but at the very core is garbage. That has no baring on if the language is capable of being used well.
.NET languages and can do the exact same things. If you are talking VB classic, that is a whole other beast. While it is/was possible to write good code in it, it was meant to be a dirty ActiveX host with some glue code to make it all work. If you went outside of its intended use, you had some pretty scary abominations forming.
Now with that said, VB.NET can almost be line for line compatible with C#. They are both
"When life gives you lemons, don't make lemonade. Make life take the lemons back!" -- Cave Johnson
"I'll get back to work after reading the comments on this next /. article."
I think you have the wrong xkcd https://xkcd.com/974/ BTW, this one is on the door to my office.
As it was explained to me by a marketing guy, "Unfortunately, 'your machine' is not a sufficiently large market."
Our multiplayer servers can handle the load on release day
I'll be paid fairly for the work I am doing....
It never happens...
Do not look at laser with remaining good eye.
Here's a short list of interface lies....
1) My error message is meaningful and helpful.
Sure. Like, "Can't find file" with no explicit reference ON THE DIALOG as to the the file name you typed in or the path it was supposed to be in, because God knows, we wouldn't want the user to be able to tell IN A SECOND where the problem was. No, let's make the user *dig* for it.
2) It's OK to shove warning and alert dialogs into people's faces.
After all, when we're at a restaruant, don't we *all* want the waiter to interrupt every few seconds with the night's special, warnings about peanuts, and the effect of alcohol on pregnant women. It's just as wonderful and helpful in software.
3) It's OK to make users wait.
Because users care *so much* about your little issues with processes or your inability to put things into separate threads while you keep the interface alive. I mean, when you're in a restaurant, don't you *love* it when the waiter ignores you because they've got something better to do?
4) It's best to steal input focus from the user.
After all, who knows where they'll type? And so what if they're already doing something else, what could be more important than MY little dialog? Modal dialog, of course, because they shouldn't do anything else until they pay attention to ME!
5) We'll help the user by refreshing his whole screen!
I mean, there's just nothing better than the waiter who rearranges everything on the table after you've started eating, just to make sure you have everything and the food is truly fresh! Of course, this couldn't be a bad habit of lazy, uncaring programmers who couldn't be bothered to get the screen or list right the first time before presentation. No. Certainly not.
Please do not read this sig. Thank you.
I was asked to teach a series of classes at my workplace on web design. When it came time to recommend an image editor, I ended up making the students use a commercial program. I would have much preferred to recommend GIMP, had it not been for the name. Not only does it call to mind a certain scene from a movie that many people are familiar with, but it's also a VERY offensive term for the handicapped. No way was I going to use it in a class environment.
True story. No kidding.
If you want to give your nightvision gear software the acronym "NIGGER," that's your right. But don't act surprised when people don't take it seriously or want to use it.
Subset of Lie # 12: "It must be run as root/Administrator." Also known as: "I need the user program to access system calls and the *BEST* way to accomplish that is to run the program with admin privilages since admin can do that without annoying pop-ups.
It amazes me how many Win7 programs I run into that were originally programmed with XP or Win2000 in mind. The official Tech Support answer is: Oh, you have to be logged in as an administrator. If that doesn't work, right click on it and run it as an administrator."
Great civilizations have lived and died on false theories. Don't mess up mine with a few facts.
How many times have you seen
// Increment the counter
// Keep track of how many filberts we have processed
// Finished another one
counter++;
rather than
counter++;
or, even better,
filbert_counter++;
Another variation: If I don't comment this code, they can't fire me since nobody else can read it.
Occasionally living proof of the Ballmer peak.
"The first 90 percent of the code accounts for the first 90 percent of the development time. The remaining 10 percent of the code accounts for the other 90 percent of the development time." — Tom Cargill, Bell Labs
Get free satoshi (Bitcoin) and Dogecoins
Hazelnuts. They're called hazelnuts.
God damn Oregonians!
Chuuch. Preach. Tabernacle.
"I can write this in a slow, OO language using OPM (other people's modules) and it'll be quick to target, bug free, lightweight, and fast. Because, uh, faster hardware and, uh, derp" Also, "I don't need to learn C, I have (fill in the blank with the latest fad language that purports to save programmers from having to really learn to program)" and also "I can use the (fill in the blank with the latest agile / tricky / ultra-testable) technique to Make My Code Shine!"
Oh yeah, and this charmer: "I don't have to bugfix version-2 or older, it's perfectly reasonable to expect everyone to upgrade."
I've fallen off your lawn, and I can't get up.