Each post must contain one bad programming practice to add to the list. I'll start:
In C++, overload library functions by using #define. That way it looks like you are using a familiar library function where in actuality you are using something totally different.
Name:
Anonymous2010-10-19 17:19
A function taking no parameters and returning no value.
void perform_side_effects(void);
Name:
Anonymous2010-10-19 17:23
>>41
putting void in a parameter list to signify no parameters
Single character variable names. I can't believe academics encourage this practice still.
I can think of a lot of Python-specific ones, but I'll limit myself to one case.
class SomeObject (object):
member = OtherObject() #This will hurt you.
Name:
Anonymous2010-10-19 20:48
Using opiates
Name:
Anonymous2010-10-19 20:53
>>48
There's nothing wrong with using i or j as loop variables. It's a widely understood convention, and trying to be clever by calling them something like index will only confuse/piss off other people who have to read your code.
Name:
Anonymous2010-10-19 21:08
EVERYTHING HAS ALREADY BEEN ANSWERED IN >>9
THREAD OVER
Name:
Anonymous2010-10-19 21:26
>>50
No. It will only confuse you if can't handle the extra readability.
>>52
Your code should convey its semantics as clearly as possible. That means choosing familiar idioms whenever you can. The extra 200ms it takes your maintenance programmer to figure out that by int counter you really meant int i are better spent elsewhere.
Writing an HTTP client library and making it impossible to do a simple GET request and put the result into a string in less than 15 lines of code. I'm looking at you, Java.
Not cleaning the cappuccino tube in the coffee machine after yourself. It irritates other programmers in your team and impairs your overall performance.
>>21 it is always associative and usually commutative. + is commutative on every ring. If you're doing calculations on non-ring environtments, you are utterly doomed.