Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

These are unskilled programmers, so shouldn't it be ok to start out really simple?

Have bugs with index bugs like:

    for(var i = 1; i < len; i++)
    substr(name, indexof(name, ' ')) 
i.e. Find out why it's not showing all the items (i = 1 instead of 0), find out what's going on with the formatting of the lastname (there's an extra space at the beginning of the name).

For SQL use a JOIN where it needs a LEFT JOIN.

I can think of others off the top of my head. Leave out an optional parameter that's been populated from the front-end, but don't pass it to the method call. In OO languages, have a constructor accidentally call itself instead of the alternative with more parameters (infinite loop). Nest two for loops and accidentally use i instead of j inside the inner loop. Have an if statement that looks sorta right but is logically impossible to satisfy.

For the "only sometimes crashes" bugs, div by zero is an easy example.

All the sort of accidents you instinctively correct now are probably good beginner debugger exercises.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: