Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Superstitions are widely held beliefs with little or no rational reasoning behind them. They often result in little rituals we do to ward off the bad luck that we believe will result from them. Superstitions are frequently passed along from person to person and may have origins in magical thinking.

What are the superstitions that you (or your coworkers and friends) have when they are programming or working with computers?

Here are some I've thought of:

  • Relative paths in Unix must begin with . or ..
    I see this one a lot. Some programmers believe that there are only two kinds of paths: those that start with a slash (/etc/motd) and those that start with a dot (./myfile). All others are errors.

  • All classes must have getters and setters for their private fields
    This is, of course, not true. They were probably taught it in their first programming course and it has stuck ever since and passed along as gospel.

  • (Using a flip phone) The phone must be closed and opened between calls
    My parents do this. They will close the phone and open it again even though pressing the red END button would do the same. Not specifically programming related, but it's an example of a superstitious ritual and could influence the user interface design of future phones.

What superstitions do you or your family/friends/coworkers have about programming?

Note: I'm exploring this as a possible topic for a research dissertation in computer science.

share|improve this question
4  
I like the close votes with no explanation. How is this not a real question? –  TheLQ Oct 3 '10 at 13:08
2  
@TheLQ -- Because it doesn't end with a question mark, obviously. (oh wait, never mind...) –  Note to self - think of a name Oct 3 '10 at 16:21
1  
I think superstitions might be the wrong word, even though it is being used correctly. I must admit that when I first found the question I thought it was going to be some grand question asking whether programmers walk under ladders and such. –  EnderMB Oct 4 '10 at 13:10
1  
Quote: "They often result in little rituals we do to ward off the bad luck that we believe will result from them". But virtually every single example you pointed out is not done for "luck" but simply for lack of knowledge. –  Jas Oct 12 '10 at 20:38
show 8 more comments

closed as not constructive by Mark Trapp Sep 16 '11 at 2:56

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

48 Answers

first pressing "Apply" then pressing "OK" buttons

share|improve this answer
6  
OMG. I do this all the time. +1 –  Terence Ponce Oct 3 '10 at 12:33
9  
But... but... I thought it's the way of the Jedi! –  aredkid Oct 3 '10 at 16:27
26  
There have been several applications and components in Windows that required this, which probably started the practice. –  JBRWilkinson Oct 3 '10 at 20:16
14  
TRWTF is having these two different buttons in the first place, right?</macuser> ;) –  deceze Oct 4 '10 at 5:07
7  
@Peter That's another WTF if you ask me. If there are that many options stuffed into one dialog that you can't keep track of what you just changed and/or if a change is not easily reversible once it's done, except by canceling out of the whole operation, the UI is probably badly thought out. I stand by my assertion that separate Apply/OK buttons are a WTF. :) –  deceze Oct 5 '10 at 5:31
show 9 more comments

If I don't save the file after typing each line of code, the OS/IDE will crash on purpose.

share|improve this answer
76  
This is fact ;) –  back2dos Oct 8 '10 at 16:22
4  
Looked at my Eclipse usage statistics one day, it was about 10 saves to everything else, including autocompletes –  Slokun Oct 8 '10 at 16:49
15  
There's no fundamental difference in pressing ;<Enter> at the end of each statement, and pressing ;<Enter><Ctrl+S>. –  György Andrasek Oct 9 '10 at 16:48
10  
Then I started to use Outlook and some genius thought it was a good idea to map <ctrl>-S to SEND.... AAAARG MUUUST KILLL –  Newtopian Apr 8 '11 at 3:22
3  
That comic describes this behaviour: phdcomics.com/comics/archive.php?comicid=638 –  Mnementh Apr 8 '11 at 12:59
show 5 more comments

That if it compiles and runs the first time... it's worse than if there were errors.

I don't know if it's true, but experience has shown me that I'm never right the first time.

share|improve this answer
16  
I managed to write a "Hello world" program to run as intended for the first time. :) –  ShdNx Oct 3 '10 at 9:13
17  
I think I know what you mean. When there’s no compiler error the first time, it feels kind of bare and crude; but if there was an error and you fixed, it feels like it already has a fix in it, so it must be closer to being correct... –  Timwi Oct 3 '10 at 13:37
1  
Similar with Haskell - if you type (as give type not write) it correctly then illegal states should be unrepresentable. –  Maciej Piechotka Oct 4 '10 at 14:14
7  
Well, this has been formalized in the TDD philosophy of red-refactor-green (tests must fail first), so if it's a superstition, it's a documented one. –  Robert Harvey Oct 4 '10 at 18:55
5  
If I'm firmly in 'the zone' it's not all that uncommon to compile without warnings. Once I wrote a ~250 line bugfix that compiled and worked the first time. No irrational fear here, just some air-high-fives all around and maybe an 'I AM INVINCIBLEEEE!'. –  Evan Plaice Nov 19 '10 at 22:44
show 8 more comments

I've seen several good programmers hit Ctrl+C twice (or more) to 'make sure' something was copied to the clipboard, and they are unaware that they do it. I'm sure I have even done it myself.

It might be that we, as programmers, know that even the most basic features can be subject to race conditions, bugs, weird scenarios, etc. Even Ctrl+C and it is better to be sure.

To me, it's just paranoia.

share|improve this answer
24  
Similarly, multiple Ctrl+S (or C-x C-s, or :w, or whatever). –  Jon Purdy Oct 3 '10 at 7:44
7  
Pushing the elevator button twice really does make it come faster, I promise! =) –  JohnFx Oct 3 '10 at 16:17
6  
I know people that, instead of using cut-and-paste (Ctrl-X, then Ctrl-V) will instead copy-and-paste-and-delete. That is, highlight the text, copy it, navigate to the new place, paste it, navigate back to the original text, re-highlight, and finally delete. It's as if they don't trust or know about Undo. –  Barry Brown Oct 4 '10 at 6:17
18  
Sometimes this is actually justified. Under certain conditions, if you're trying to copy a file or data out of a VM onto the host machine, it won't "take" unless you hit CTRL-C more than once. Happens to me all the time. –  Mason Wheeler Oct 7 '10 at 0:28
13  
This is entirely because there is no feedback to let you know it worked. Ctrl-x, the text disapears. Ctrl-v, the text appears, ctrl-c, who knows? And I've had ctrl-c fail all over the place, depending on what legacy garbage I'm using. –  Incognito Apr 6 '11 at 16:10
show 18 more comments

I always Ctrl-A (select all) Ctrl-C (copy) my edits before posting to wiki, SO or any web-based editor. Usually I'll also open a Notepad and paste my text there. This comes from my workplace where the wiki system used to be very crappy and time-outs were very frequent. If I didn't Ctrl-C then I lose all of my typings.

share|improve this answer
5  
For anything beyond short comments, I'll write it in a text editor in the first place, since they have more space and superior text editing controls anyway. Plus I do have to put up with crap connections/networks - so having an ad-hoc backup is a sensible precaution, not a superstition/compulsion. –  Peter Boughton Oct 4 '10 at 17:26
5  
+1, I do this all the freaking time, but it has saved me enough times to make it worthwhile.. We're still weirdos though :) –  dr Hannibal Lecter Oct 7 '10 at 11:38
3  
Google Chrome saves your fields! –  Callum Rogers Oct 8 '10 at 12:41
2  
I use Gmail for this. Just Compose a new e-mail, start typing, and it gets saved to Drafts once per minute. And it'll stay there forever until I decide to post it. –  Kyralessa Oct 8 '10 at 22:01
show 7 more comments

If I don't put curly-braces around my if-statement consequent statement, another programmer will add a second statement assuming the braces are there but invisible, and bears will eat him.

This is a member of the "maintenance programmers will neither know the language nor read the code" family of superstitions, born during a period in the late-80s when Microsoft experimented with using idiots to write software for Windows.

Related superstitions:

  • Every line should have a comment explaining what it does in plain English, or the CTO won't be able to read the code.

  • Exceptions must be caught as soon as possible, even if the catching code has no possible way to understand or recover from them.

  • Writing macros makes hair grow on your palms.

share|improve this answer
27  
Well they once did a study and apparently not putting curly-braces around single-line statements is the #1 cause of bugs –  Jaco Pretorius Oct 3 '10 at 5:30
6  
@Jaco: Interesting, where did you read this? –  Vetle Oct 3 '10 at 9:42
4  
Well, I've seen this particular error in production code, and the guy who made it was as close to a CTO as this particular outfit has, so maybe there's some truth to it being dangerous. The designers of Ada went to some trouble to bracket all control structures, to make that particular error impossible, and they specifically said that experience with that particular error was the reason. –  John R. Strohm Oct 3 '10 at 13:44
19  
@Jaco: [citation-needed] –  Robert Harvey Oct 4 '10 at 18:52
5  
Wearing a helmet is less dangerous than not wearing a helmet. So just wear a helmet. Even in bed. –  Shog9 Dec 10 '10 at 16:40
show 12 more comments

Commentia

The fear of deleting code that might possibly be of use later, leaving lavaflows of commented lines of code

share|improve this answer
1  
I do the same.. haha, but I normally delete them during the clean up session. –  Phelios Apr 6 '11 at 9:42
25  
I stopped doing this when I started using source control. –  greyfade Apr 6 '11 at 16:15
1  
guilty.... and even when it's finally time to clean up caus'it all works now... I still feel bad deleting it. –  Newtopian Apr 8 '11 at 3:28
1  
@greyfade : so did I, started using SVN and I thought it cured me... that is until I had to work with TFS. Hell now I even started to make dated zip backups of my source code again... <grumbling> I hate TFS –  Newtopian Apr 8 '11 at 3:29
1  
I stopped doing this when I started using a source control system that I felt like I knew well, and really trusted. –  MatrixFrog Aug 4 '11 at 2:01
show 1 more comment

Lower level languages are more performant than higher level languages. So if I port my code to assembly it will automatically be faster.

share|improve this answer
4  
I usually compile the project, set a breakpoint, go into the debugger, and copy out the disassembled code. (Usually it is as good as porting to assembly.) Did I break any law doing this? –  rwong Oct 12 '10 at 3:33
show 2 more comments

"This error is so strange that noone can ever have experienced it before, so there is no use searching the web before asking in a forum."

share|improve this answer
show 1 more comment

95% of all programmers believe they are part of the best 5% of all programmers.

share|improve this answer
25  
Replace programmers with everyone and everything. This is the Dunning-Kruger effect. –  Kaz Dragon Oct 27 '10 at 9:18
7  
Apparently 95% of the people who show up for programming interviews can't answer the fizzbuzz problem so... I am part of the top 5% of programmers. ;) –  Evan Plaice Nov 19 '10 at 22:52
3  
@Evan Plaice: Your deduction is based on the premise, that all people showing up for programming interviews are programmers, which is very similar to calling all people, who audition at casting shows to become popstars, singers. ;) –  back2dos Nov 20 '10 at 13:36
11  
@back2dos Those commas are hurting me. –  TRiG Dec 1 '10 at 19:23
show 5 more comments

If you don't get enough caffeine, you'll fall asleep on your keyboard and never wake up again.

share|improve this answer
1  
Haha, you made my day! :D –  ShdNx Oct 3 '10 at 9:12
1  
And after falling asleep for an hour or two, you'll reach the nirvana point, where you suddenly become so enlightened that you finish the programming at light speed, catch all the bugs, (or answer all of the professor's questions), and didn't feel any tireness anymore (i.e. that feeling is "turned off"). And catch a very very bad cold/headache/ill the next day. –  rwong Oct 7 '10 at 13:21
1  
That's not a superstition, it's a fact .oO(zzzz) –  EricSchaefer Apr 6 '11 at 11:16
show 2 more comments

"There is an error in the compiler.". And adding parens, or 'volatile' or a newline, or some other magic syntax is a workaround.

No, there is an error in your understanding of the language, and your magic just matches your assumptions better then the original code did.

share|improve this answer
5  
Actually, in some cases those little things can be errors in the compiler. Take a loot at this SO question. A small modification of this malformed program will prevent compiler from crashing. –  AndrejaKo Oct 3 '10 at 8:18
7  
Of course there are the rare compiler errors, but not nearly as many as my coworkers claim to have discovered. –  AShelly Oct 4 '10 at 0:17
15  
Having found a few compiler errors in my time, my advice is that, when you find a problem, firmly assume that the compiler is working just fine. If the compiler is wrong, you'll be pushed into questioning that anyway, but if you start with the feeling that the compiler just might be wrong you'll have a much harder time finding the errors you made. –  David Thornley Oct 4 '10 at 18:21
show 5 more comments

I don't know if this adds -


Most of the people try to get rid of a fly from the screen by hovering cursor near it :D


share|improve this answer
7  
Well, sometimes it works, if the fly is distracted/scared/surprised by the change in lighting around it... :o) –  deceze Oct 4 '10 at 5:21
9  
@deceze unfortunately, this only work 2 or 3 time, depending of the learning algorithm the fly implements. –  DavRob60 Oct 4 '10 at 16:43
8  
It's even funnier if it's a cat instead of a fly. –  Kaz Dragon Oct 27 '10 at 9:19
2  
The thing you gotta be careful of is those tiny "thunder bugs" you get in the summer when it's muggy. I once had one on my monitor and went to brush it off, but it turned out to be inside the monitor and I squashed it! Now the monitor has the equivalent of 3 dead pixels :( –  DisgruntledGoat Nov 17 '10 at 20:15
show 2 more comments

Move the mouse, or press some key, so the computer does not stay "idle" for too long and activates the screen saver and/or locks the computer. Even if you are not using the computer at that moment.

share|improve this answer
add comment

Java is slow

share|improve this answer
23  
Because Java GUI is slow. -- If you can provide a solution to remove the ~1.5s startup delay for Swing/AWT, please go ahead and answer this: stackoverflow.com/questions/508723/… –  Peter Boughton Oct 4 '10 at 11:42
11  
The dialog is an example of why it matters. Yes, 1500ms really is that much; even in bigger apps, it's an unacceptable overhead to already slow startup times. The reasons for the slowness don't matter - the fact that I can write an application in C# or Delphi or JavaScript or Python or Tcl or whatever and have it respond immediately after the icon was clicked means that you don't get people complaining that those languages are slow. –  Peter Boughton Oct 4 '10 at 23:19
13  
It might even be that Java is actually fastest in everything except starting up, but all the while Java apps take (at least) twice as long to load as non-Java apps, the reputation ain't going away –  Peter Boughton Oct 4 '10 at 23:19
1  
@TheLQ, yes it is a lot, if you have to wait for it. –  user1249 Oct 17 '10 at 20:38
show 3 more comments

Spaces at the end of a line of code must be deleted.
Maybe necessary for some languages, but not all.

share|improve this answer
18  
Call me superstitious, but I hate that. If you can't even get your whitespace right... –  ninjalj Oct 9 '10 at 13:44
1  
Definitely necessary for git if you're using the same source on both linux and windows. The word 'whitespace' makes me cringe. –  Evan Plaice Nov 19 '10 at 22:54
show 2 more comments

I engage in a number of minor compulsive behaviours that can look like superstitions, one being that if I cut or copy something to the clipboard, then it is somehow magically stored in my left hand, waiting for me to paste it; the longer it stays there, the more likely it is that I will inadvertently overwrite it with another cut or copy, so I become fearful and and try to paste as soon as possible. This becomes a problem only when I'm unable to convince myself that there's nothing important on the clipboard, so I have to open the appropriate application and try pasting into it to assure myself that it's unimportant or nonexistent.

Related: when talking on IM, if someone interrupts me, then I'll copy what I was saying, respond to the interruption, then paste and re-word to continue the flow of the conversation. My clipboard superstition has made this practice seamless!

share|improve this answer
5  
+1. I do that on IMs too. –  Mason Wheeler Oct 7 '10 at 22:06
4  
"...somehow magically stored in my left hand" - that would be frickin' awesome. Then I could walk over to another computer, press Ctrl+V and paste it there. –  DisgruntledGoat Oct 27 '10 at 14:58
2  
@DisgruntledGoat: Someone should make a bluetooth device for this express purpose. –  Jon Purdy Oct 27 '10 at 15:06
1  
Clipx. Or another tool that extends your clipboard to contain multiple items. –  Carra Apr 6 '11 at 13:26
1  
@Carra mentioned ClipX, Ditto is also pretty good. I had some issues with ClipX and Visual Studio 2010, so I switched to Ditto. –  John Bubriski Apr 6 '11 at 18:47
show 3 more comments

Don't touch the machine while the code is compiling or you'll screw it up.

share|improve this answer
add comment

For vi users, it's the OCD compulsion to hit the Esc key at near-random intervals.

share|improve this answer
show 2 more comments

Hitting the "Save" button twice, just to be sure...

(For users of vi family, pressing ":w" twice)

share|improve this answer
2  
To exit I always do :w<enter>:x<enter> –  Loki Astari Apr 6 '11 at 15:52
show 1 more comment

As a Vim novice, I tend to abuse the Esc key to make sure I am in normal mode.

I am also known for insisting on using ++i instead of i++ in C/C++ for loop counter increments, even though the compiler probably takes care of this optimization.

share|improve this answer
show 3 more comments

Considering "Superstitions arise because we don’t understand" (The Future of Programming: Ignorance and Superstition?), ... a lot ;)

Joel Spolsky mentions for instance pointers (in his "College Advice"):

I don't care how much you know about continuations and closures and exception handling: if you can't explain why while (*s++ = *t++); copies a string, or if that isn't the most natural thing in the world to you, well, you're programming based on superstition, as far as I'm concerned: a medical doctor who doesn't know basic anatomy, passing out prescriptions based on what the pharma sales babe said would work.

share|improve this answer
1  
See also it.toolbox.com/blogs/narikannan/… or weblogs.asp.net/jarnold/archive/2004/08/10/211969.aspx for many other examples –  VonC Oct 2 '10 at 21:19
show 1 more comment

When I put something large or important onto the clipboard using CTRL+C or (with a stronger effect) CTRL+X, I feel as though my left hand is magically charged with the thing I have just copied or cut.

Pasting it is like throwing this charge out into my keyboard like a hadouken or something.

This means that I can't use my right hand to paste something with SHIFT+INS, I have to use my left. Also, I can only type with my right hand between the cut and the paste.

Colleagues who know about this foible, have declared me a freak. I'm inclined to agree.

share|improve this answer
add comment

Never releasing on a Friday.

Because if you're not going to be around later to fix something, something's bound to need fixing later; and you don't want to leave it unattended for 2 days before you notice there's a problem.

Okay, maybe this is on the borderline between superstition and wisdom.

share|improve this answer
show 2 more comments

Reboot is the answer.

share|improve this answer
21  
Actually this works for me most of the time... –  Emiliano Oct 7 '10 at 9:58
2  
Just because something works doesn't mean it's the answer. It's useful to know when rebooting is the best option, and when it's just sweeping a problem under the carpet. –  Peter Boughton Oct 7 '10 at 11:46
1  
Have You Tried Turning It Off And On Again? youtube.com/watch?v=nn2FB1P_Mn8 –  blizpasta Apr 7 '11 at 14:40
1  
Ever considered that the airplane checklist being done before each flight essentially reboots the plane? –  user1249 Apr 7 '11 at 17:02
show 1 more comment

Coffee

It's really not necessary, and it can be counter productive if it makes you stay longer hours working, instead of getting a good nights sleep.

share|improve this answer
3  
I agree: Thinking that coffee isn't necessary is a superstition... (walks away to pour himself a new cup) –  Treb Sep 16 '11 at 5:44
add comment

For years, I would play a game - Freecell I think it was - in the morning, and I would not touch the code until I had won. I figured that the game was a test to see if my brain was working yet.

share|improve this answer
2  
Man, it's nice to know I'm not the only one who did that! –  JUST MY correct OPINION Apr 6 '11 at 14:53
show 1 more comment

<language> is faster/slower than <another language>

share|improve this answer
4  
And it depends on what you are doing with it, and whether you are waiting for user input or not. –  Mark C Oct 2 '10 at 23:08
3  
@Kendall Hopkins - "No. Which programming language implementations have the fastest benchmark programs?" –  igouy Oct 3 '10 at 4:50
4  
@igouy C will probably beat Ruby any day (doing anything) when it comes to raw speed. Ruby, on the other hand, would probably have a cleaner, shorter, easier-to-understand solution. It's just trade-offs. With our modern computers, program execution speed (most of the time) doesn't really matter any more. You can buy an army of top end computers for the price of 1 programmer. –  Kendall Hopkins Oct 3 '10 at 5:29
3  
@zildjohn01 That's sometimes true in the case of looping, but when you get into high level languages such as ruby/php it's becomes almost impossible to optimize the code in even simple thing. For example, a common optimization in C is to not run a function if it has no side-effects on the current program state. This is fairly easy to verify in C, where is it's MUCH harder to verify for weakly typed languages such as Ruby or PHP, because so much of the evaluation depends on runtime checks. –  Kendall Hopkins Oct 3 '10 at 17:53
4  
If your statement were actually true, then it means that all languages operate at exactly the same speed. If all languages are not exactly the same then some will be faster than others. –  Asa Ayers Oct 11 '10 at 18:01
show 6 more comments

Everything is an object.

share|improve this answer
4  
...with what context? In Java, this isn't true, but in other languages it might be. –  Matt Olenik Oct 7 '10 at 21:50
4  
In Ruby this is totally true! –  Adam Harte Oct 11 '10 at 21:05
1  
@JUST MY correct OPINION: You could argue, that comments are not things in Ruby, as they are completely ignored, leaving every*thing* (i.e. every value) an object ;) –  back2dos Apr 6 '11 at 16:30
1  
Public object Everything = new Object(); now it is. –  Timothy Groote May 5 '11 at 12:53
show 1 more comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.