This is my new coding bible https://www.thc.org/root/phun/unmaintain.html
Wonderful! I was already doing most of these, but there’s always a few that I forget.
Oh yes! My company actually follows most of these rules. How neat!
"How to Hide Forbidden Globals
Since global variables are “evil”, define a structure to hold all the things you’d put in globals. Call it something clever like EverythingYoullEverNeed. Make all functions take a pointer to this structure (call it handle to confuse things more). This gives the impression that you’re not using global variables, you’re accessing everything through a “handle”. Then declare one statically so that all the code is using the same copy anyway."
Love it -^
Disparage In the Comments
Discourage any attempt to use external maintenance contractors by peppering your code with insulting references to other leading software companies, especial anyone who might be contracted to do the work. e.g.:
/* The optimised inner loop.
This stuff is too clever for the dullard at Software Services Inc., who would
probably use 50 times as memory & time using the dumb routines in <math.h>.
*/
class clever_SSInc
{
… .
}
If possible, put insulting stuff in syntactically significant parts of the code, as well as just the comments so that management will probably break the code if they try to sanitise it before sending it out for maintenance.
This part was great
arTiCl3w0nDeRFultH1s1S.
The really fun thing here is very few people need to actually work at any of this…it just come natural.
Ah, you should see Chaz and Alli’s scriptings in C# in our Unity game. My eyes are bleeding and my brain wants to leap out of my head and run off somewhere where it only has to think about brussels sprouts.
Cas
Yeah. For people like you and me…
I had to put up with a project that was written by guys who like to confuse you with their indentation… They knew how it worked, but they only applied it here and there. In the end it was a mess. When I started with Java I didn’t have such problems…