Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Bad Programming Practices

Name: Anonymous 2010-10-19 0:35

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: Anonymous 2010-10-19 17:19

A function taking no parameters and returning no value.

void perform_side_effects(void);

Name: Anonymous 2010-10-19 17:23

>>41
putting void in a parameter list to signify no parameters

Name: Anonymous 2010-10-19 17:24

>>42
Using Java

Name: Anonymous 2010-10-19 17:25

>>43
winner

Name: Anonymous 2010-10-19 18:03

Using PHP

Name: Anonymous 2010-10-19 18:06

Using anus

Name: Anonymous 2010-10-19 18:31

Using namespace std;

Name: Anonymous 2010-10-19 20:34

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: Anonymous 2010-10-19 20:48

Using opiates

Name: Anonymous 2010-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: Anonymous 2010-10-19 21:08

EVERYTHING HAS ALREADY BEEN ANSWERED IN >>9
THREAD OVER

Name: Anonymous 2010-10-19 21:26

>>50
No. It will only confuse you if can't handle the extra readability.

Name: Anonymous 2010-10-19 21:49

>>52
You don't understand what readability is.

Name: Anonymous 2010-10-19 22:01

>>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.

Name: Anonymous 2010-10-20 0:05

>>53-54
yhbt lol

Name: Anonymous 2010-10-20 0:10

index is also a standard function, however deprecated. Don't call anything index, it just makes compiling with -Wshadow annoying.

Name: Anonymous 2010-10-20 2:31

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.

Name: Anonymous 2010-10-20 2:44

>>57
You have to be kidding me. I've never used Java, but it can't possibly be that bad!

Name: Anonymous 2010-10-20 3:04

>>58
It really is that bad. Hopefully now that I've got MonoDroid set up I can ditch that pile of crap and write the app in C#.

Name: Anonymous 2010-10-20 9:12

Using Microsoft Security-Enhanced CRT

Name: Anonymous 2010-10-20 9:45

UML diagrams.

Name: Anonymous 2010-10-20 12:06

In C/C++, using #ifdef rather than if.

Name: Anonymous 2010-10-20 12:12

>>62
4/10

Name: Anonymous 2010-10-20 12:22

>>62

if def(__WIN32__)
{
    #include <windows.h>
}

int main()
{
}

stdin:1: declaration expected

Name: Anonymous 2010-10-20 12:25

Writing programs for "mobile devices"

Name: Anonymous 2010-10-20 12:50

Not cleaning the cappuccino tube in the coffee machine after yourself.  It irritates other programmers in your team and impairs your overall performance.

Name: Anonymous 2010-10-20 13:02

Not working from home

Name: Anonymous 2010-10-20 15:25

>>66
this
says everything

Name: Anonymous 2010-10-20 17:15

>>62
wat

Name: Anonymous 2010-10-20 23:56

ALWAYS invert indentation.

Name: Anonymous 2010-10-21 0:36

Emply the YHBT operator extensively.

Name: Anonymous 2010-10-21 1:25

>>71
You can't spell for shit.

Name: Anonymous 2010-10-21 1:52

>>71
Thus, you cannot conjure the spirits of the computer with your spells.

Name: Anonymous 2010-10-21 6:43

>>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.

Name: Anonymous 2010-10-22 13:46

>>74
RING MY ANUS

Name: Anonymous 2010-10-22 13:58

Using C++, C#, Java, or Visual Basic.Net.

Name: Anonymous 2010-10-22 13:58

Using C++, C#, Java, or Visual Basic.Net.

Name: >>76-77 2010-10-22 13:58

I hope I've made my point quite clearly.

Name: Anonymous 2010-10-22 13:59

>>75
+5 Funny

Name: Anonymous 2010-10-22 16:36

overloading operators

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List