Click here to Skip to main content
15,885,767 members

Survey Results

What are the worst programming habits

Survey period: 7 Jul 2014 to 14 Jul 2014

Inspired by a rant-fest

OptionVotes% 
No comments in code1,05740.95
Terrible variable names1,35752.58
Bad / dangerous code formatting69526.93
Mystery side-effects in code1,07641.69
Using magic numbers64424.95
Leaving commented-out code hanging around too long60923.60
Repeating code (Cut and Paste programming)1,28549.79
Poor program structure1,10742.89
Writing code that assumes a default behaviour67326.08
Swallowing errors95036.81
Not checking input parameters / return values / null testing1,05840.99
Respondents were allowed to choose more than one answer; totals may not add up to 100%



 
GeneralRe: None of the above? Pin
Ravi Bhavnani7-Jul-14 7:30
professionalRavi Bhavnani7-Jul-14 7:30 
GeneralRe: None of the above? Pin
SteveTheThread8-Jul-14 21:34
SteveTheThread8-Jul-14 21:34 
GeneralRe: None of the above? Pin
Mark_Wallace9-Jul-14 17:49
Mark_Wallace9-Jul-14 17:49 
GeneralLong Column Name Pin
Meysam Toluie6-Jul-14 21:50
Meysam Toluie6-Jul-14 21:50 
GeneralRe: Long Column Name Pin
Dan Neely7-Jul-14 2:30
Dan Neely7-Jul-14 2:30 
GeneralNot checking input parameters / return values / null testing Pin
Gandalf_TheWhite6-Jul-14 20:56
professionalGandalf_TheWhite6-Jul-14 20:56 
GeneralRe: Not checking input parameters / return values / null testing Pin
KarstenK6-Jul-14 23:59
mveKarstenK6-Jul-14 23:59 
GeneralRe: Not checking input parameters / return values / null testing Pin
Philippe Mori7-Jul-14 15:53
Philippe Mori7-Jul-14 15:53 
Although it is a good habit to do a lot of check, if you are using a managed languages like C#, a lot of those are often already done so it is much less critical...

In .NET exception are thrown for out-of-bound and using null pointers so « missing » checks are far less a problem that with native C++ for example where you can easily cause hard-to-find bug by writing something outside an array for example.

And even in language like C++, you can help yourself using debug libraries of STL, smart pointers, assertions, string class and thus avoid many bugs related to level coding.
Philippe Mori

GeneralAdd: leave code with this kind of problems to me PinPopular
Davide Zaccanti6-Jul-14 19:56
Davide Zaccanti6-Jul-14 19:56 
GeneralRe: Add: leave code with this kind of problems to me Pin
DaveAuld6-Jul-14 20:24
professionalDaveAuld6-Jul-14 20:24 
GeneralRe: Add: leave code with this kind of problems to me Pin
Mark_Wallace9-Jul-14 17:50
Mark_Wallace9-Jul-14 17:50 
GeneralAll of the above Pin
Abhinav S6-Jul-14 19:31
Abhinav S6-Jul-14 19:31 
GeneralRe: All of the above Pin
DaveAuld6-Jul-14 20:22
professionalDaveAuld6-Jul-14 20:22 
GeneralRe: All of the above Pin
KarstenK7-Jul-14 0:01
mveKarstenK7-Jul-14 0:01 
GeneralRe: All of the above Pin
Abhinav S7-Jul-14 0:43
Abhinav S7-Jul-14 0:43 
GeneralRe: All of the above Pin
KarstenK7-Jul-14 1:19
mveKarstenK7-Jul-14 1:19 
GeneralAll of the above... Pin
Brisingr Aerowing6-Jul-14 18:08
professionalBrisingr Aerowing6-Jul-14 18:08 
GeneralRe: All of the above... Pin
KarstenK7-Jul-14 0:05
mveKarstenK7-Jul-14 0:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.