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.

From the Jargon File:

brain fart: n.
The actual result of a braino, as opposed to the mental glitch that is the braino itself. E.g., typing dir on a Unix box after a session with DOS.

I've been working with JavaScript and Python lately and have made errors like typing, in Python,

function foo(argument1, argument2):

This isn't pure JavaScript, but it also doesn't work in Python.

One of my recent posts, http://serverfault.com/questions/506403/why-is-my-root-url-serving-up-a-404-under-apache/506452?iemail=1&noredirect=1#506452, was about why a pure, simple, working, and rather small DocumentRoot contents were not showing. The answer was that I made a mistake that I do not remember making in years of dealing with Apache: I had included commas betweek ServerAlias entries, and that was why the (perfectly appropriate) DocumentRoot was giving a ServerError. (And did I mention that I've been spending a lot of time coding where separating by ", " was the appropriate way of separation?)

Is this sort of thing just non-negotiable? Or are there ways to mitigate and compensate for them?

share|improve this question
1  
I love the example. I've typed "ls" into a win command prompt window a lot of times. Good question too. –  LachlanB May 10 '13 at 12:42
    
I would recommend using some sort of modern IDE like Visual Studio + ReSharper - gives you immediate feedback, so those kind of errors are rarely an issue. –  Den May 10 '13 at 16:41
add comment

closed as not constructive by MichaelT, Joris Timmermans, Jim G., pdr, Blrfl May 10 '13 at 13:26

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.

5 Answers

up vote 2 down vote accepted

As you age, these may occur more frequently. Here is some (hard-earned) advice:

  1. Have a safety net - Backups are great, but if you didn't make the backup, you can't be sure it is right. Be sure! If you have too many backups, that is very easy to fix. If you don't have enough, backups, that can be bad.
  2. Have a back-out plan - Sometimes a backup might not be enough. If you have a plan, you are always less likely to panic. Panicking makes things worse.
  3. Test/verify your work - It is always better to catch your own mistakes and fix them before anyone else notices. It is similar to a tree falling in the woods and nobody is around to hear it.

You don't need to over-do it with everything. Just make sure your caution matches your risk.

share|improve this answer
add comment

Wait til you hit 50.

Don't sweat the small stuff. When you jump around on different platforms and different languages the syntax does tend to blur. I picked up Delphi (Pascal) after a 5 year absence and I kept adding semi-colons (;) to the end of all the other coding statements I used.

The important thing is that you conceptualize the big picture and that your logical thought progression is clear and well understood not just by you but everyone who follows your code.

share|improve this answer
add comment

My best recommendation is to accept that some will happen. As far as ways to decrease how often they happen, here's what helps me:

  • Don't let yourself get distracted by other tasks, just handle one at a time (as much as is reasonable).
  • Avoid stimulants (such as caffeine). They make you feel better and work faster, but I find my error rate goes up dramatically with them (while the whole time I actually think I'm doing better).
share|improve this answer
add comment

The answer, I believe, is to have constant feedback about the correctness of the entered commands or code. For commands, the feedback should come after entering them; for code or configuration files, it can come from some IDE's background-compilation or by constantly compiling (enough to catch syntactic issues) or running the code (in cases of interpreted code, or to catch semantic issues), for example with a suite of tests.

share|improve this answer
add comment

Take it slow. So many developers code at the speed of light and make lots of little mistakes along the way, and fix them as they go. Slow down and look at what you've written. But also, don't stress, these things happen. No one is perfect. Just admit it "my mistake, sorry" - the end.

share|improve this answer
add comment

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