How to be a good programmer.

Miscellaneous Forums/General Discussion/How to be a good programmer.

Found this here: http://www.shanemcdonald.com/laughs/l-computer-programmer.html

Want to be a good programmer ? If so, follow these programming practices and guidelines:

1) Never write a line of code that someone else can understand.

2) Make the simplest line of code appear complex. Use long counter intuitive names.
Don't ever code "a=b", rather do something like this :

AlphaNodeSemaphore=*(int)(&(unsigned long)(BetaFrameNodeFarm));
3) Type fast, think slow.

4) Never use direct references to anything ever.
Bury everything in macros.
Bury the macros in include files.
Reference those include files indirectly from other include files.
Use macros to reference those include files.

5) Never include a comment that will help someone else understand your code.
If they understand it, they don't need you.

6) Never generate new sources. Always ifdef the old ones. Every binary in the world should be generated from the same sources.

7) Never archive all the sources necessary to build a binary. Always hide on our own disk. If they can build your binary, they don't need you.

8) Never code a function to return a value. All functions must return a pointer to a structure which contains a pointer to a value.

9) Never discuss things in concrete terms. Always speak in abstract. If they can understand you, they don't need you.

10) Never complete a project on time. If you do, they will think it was easy and anyone can do it and they don't need you.

11) When someone stops by your office to ask a question, talk forever, but don't answer the question. If they get their questions answered, they don't need you.

12) Load all sentences either written or spoken with alphabet soup. When someone asks you out to lunch, reply:
"I can't because I've almost got my RISC-based OSI/TCP/IP client connected by BIBUS VMS VAX using SMTP over TCP sending SNMP inquiry results to be encapsulated in UDP packets for transmission to a SUN 4/280 NFS 4.3 BSD with release 3.6 of RPC/XDR supporting our ONC effort working."

13) Never clean your office. Absolutely never throw away an old listing.

14) Never say hello to someone in the hallway. Absolutely never address someone by name. If you must address someone by name, mumble or use the wrong name.
Always maintain the mystique of being spaced out from concentrating on complex logic.

15) Never wear a shirt that matches your pants. Wear a wrinkled shirt whenever possible.
Your shirt must never be tucked in completely. Button the top button without wearing a tie. This will maximize your mystique.


lol at "Always maintain the mystique of being spaced out from concentrating on complex logic."

LOL big time :)

good find GA...

--Mike

This was always my favorite:

How To Write Unmaintainable Code http://www.thc.org/root/phun/unmaintain.html

Hungarian Notation is the tactical nuclear weapon of source code obfuscation techniques; use it! Due to the sheer volume of source code contaminated by this idiom nothing can kill a maintenance engineer faster than a well planned Hungarian Notation attack.

I love killing time on sites like this. Thanks for the link; I'd used up Computer Stupidities a while ago.

lol at "Always maintain the mystique of being spaced out from concentrating on complex logic."
lol. That's the one that made me chuckle, too. :P

/me resumes the mystique o_0

scott: thanks for the link. I gotta try this out on some people "Quidquid latine dictum sit, altum sonatur.
- Whatever is said in Latin sounds profound." lol

Bedazzling Names
Choose variable names with irrelevant emotional connotation. e.g.:
marypoppins = (superman + starship) / god;
This confuses the reader because they have difficulty disassociating the emotional connotations of the words from the logic they're trying to think about.


classic!

Nice! I like this one:

Obscure film references
Use constant names like LancelotsFavouriteColour instead of blue and assign it hex value of $0204FB. The color looks identical to pure blue on the screen, and a maintenance programmer would have to work out 0204FB (or use some graphic tool) to know what it looks like.


4) Never use direct references to anything ever.
Bury everything in macros.
Bury the macros in include files.
Reference those include files indirectly from other include files.
Use macros to reference those include files.

8) Never code a function to return a value. All functions must return a pointer to a structure which contains a pointer to a value.

How true! Sounds like every non-trivial C(++) project that I've ever looked through... :)

Nice

Scary - I inherited a program written to the above specifications. I must be a bad programmer since I am slowly making it understandable.

Yep. Whenever i try learning c++ or anything i just look at the code and say "omfg this is complex" but then i figure it out and i see that the guy making it was just utterly numbifyingly STUPID and had to make such complex unreadable unlogical code for no reason! I wonder if they even understand it, if they look at it a few months after writing it.

Of course, one can also write perfectly readable code, and then run it through a code obfuscator to convert it to something that even SETI couldn't distinguish from background noise. (But which still compiles without error and generates a working executable)

(There are actually code-obfuscation contests, where people can compete to generate the hardest-to-read code imaginable. For example, http://www.ioccc.org/main.html , the International Obfuscated C Code Contest)

Is blitz-code easy to obfuscate? :P

xlsior: Amazing link. Those guys are sure clever. Check this out:

http://www.ioccc.org/2004/arachnid.c

There's some pretty neat ones out there if you start looking...

www.ioccc.org/2004/arachnid.c

omg

That reminds me of the programs people write for graphic calculators. I once saw a Doom clone running on a TI85. The code was all 1>2>A>C

If I remember correctly, that arachnid one is (obviously)
a maze program and it is able to use its own source
code as input!

Crazy Ouroborus-ness!