DEV Community

Discussion on: Those silly mistakes we all make

Collapse
 
davshoward profile image
Davs Howard

I spent literal HOURS about a decade back trying to debug a program only to realise I had written a 'j' instead of an 'i' on a for loop but I couldn't tell as the font for both was so similar.

I've not used 'j' as a variable since then ;-)

Collapse
 
phlash profile image
Phil Ashby

Good ol' K&R has a lot to answer for..

Collapse
 
ludamillion profile image
Luke Inglis

I always used to go in the opposite direction for this reason. Need something after i? Go for h.

Collapse
 
davshoward profile image
Davs Howard

I just avoid 'i' entirely now. Go for something like x, y, z if required ;-)

Thread Thread
 
philnash profile image
Phil Nash

No more single letter variable names! What is this, degree level mathematics?

Wait, are you all Haskell programmers?

Thread Thread
 
davshoward profile image
Davs Howard

If it's used as a counter in a for loop I don't see an issue with it.

Thread Thread
 
ludamillion profile image
Luke Inglis

Personally I learned to program with C (and LISP) and sometimes my Javascript still sinks back towards into the C.