Page 1 of 1 [ 9 posts ] 

Obres
Veteran
Veteran

User avatar

Joined: 13 Jul 2007
Age: 38
Gender: Male
Posts: 1,431
Location: NYC

13 Jan 2012, 4:37 pm

Quote:
Åccented Letters
Use accented characters on variable names. E.g.

typedef struct { int i; } ínt;

where the second ínt's í is actually i-acute. With only a simple text editor, it's nearly impossible to distinguish the slant of the accent mark.


From How To Write Unmaintainable Code

This is gonna make someone's head explode! :lol:



Apple_in_my_Eye
Veteran
Veteran

User avatar

Joined: 7 May 2008
Age: 50
Gender: Male
Posts: 4,526
Location: in my brain

13 Jan 2012, 6:08 pm

That's the worst thing I've ever seen. If the compiler detects that it should activate a robot that seeks out and beats up the person who did it.



Dilbert
Veteran
Veteran

User avatar

Joined: 29 Mar 2009
Age: 45
Gender: Male
Posts: 1,728
Location: 47°36'N 122°20'W

13 Jan 2012, 6:49 pm

HAHAHA!

There's an awesome advice for non native english speakers: use your own language in naming objects, variables and functions. It easily pops out from the code.

English speakers need to come up with their own scheme. I have my own. My variable names start with var, for example vari or vartextbox. for (vari=0;vari<=10;vari++) { } Function names start with fun and so on and so on. It's just something I'm used to doing and it works well for me.



Fnord
Veteran
Veteran

User avatar

Joined: 6 May 2008
Gender: Male
Posts: 39,163
Location: Stendec

13 Jan 2012, 8:15 pm

con... Numerical constants; ex.: "conpi = 3.1415926535..."
fun... Functions and "calls"
str... String constants
sub... Subroutines
var... Variables

Then again, profanity is a language that every programmer understands!



Titangeek
Veteran
Veteran

User avatar

Joined: 22 Aug 2010
Age: 25
Gender: Male
Posts: 7,702
Location: somewhere in the vicinity of betelgeuse

14 Jan 2012, 12:03 am

Obres wrote:
Quote:
Åccented Letters
Use accented characters on variable names. E.g.

typedef struct { int i; } ínt;

where the second ínt's í is actually i-acute. With only a simple text editor, it's nearly impossible to distinguish the slant of the accent mark.


From How To Write Unmaintainable Code

This is gonna make someone's head explode! :lol:


Mean. Very mean. I like it :twisted:


_________________
Always be yourself, express yourself, have faith in yourself, do not go out and look for a successful personality and duplicate it.
- Bruce Lee


Avantrix
Butterfly
Butterfly

User avatar

Joined: 10 Jan 2012
Age: 26
Gender: Male
Posts: 17

15 Jan 2012, 12:47 am

This reminds me of something my friends used to do in highschool. If they saw an open document on a PC, they would casually slip the word "Walrus" randomly somewhere in your work, if you didn't end up proof reading you would have random "Walrus"'s around everywhere, cant imagi ne what the teachers thought when they were grading the papers.

Next time I see someone coding that has left there code available for sabotage, this is happening to them, haha ! !



Titangeek
Veteran
Veteran

User avatar

Joined: 22 Aug 2010
Age: 25
Gender: Male
Posts: 7,702
Location: somewhere in the vicinity of betelgeuse

15 Jan 2012, 12:49 am

^Wouldn't the IDE catch that?


_________________
Always be yourself, express yourself, have faith in yourself, do not go out and look for a successful personality and duplicate it.
- Bruce Lee


kxmode
Supporting Member
Supporting Member

User avatar

Joined: 14 Oct 2007
Gender: Male
Posts: 2,693
Location: In your neighborhood, knocking on your door. :)

15 Jan 2012, 1:21 am

My favorite coding technique are shorthand conditionals.

(condition) ? value = true : value = false;



Avantrix
Butterfly
Butterfly

User avatar

Joined: 10 Jan 2012
Age: 26
Gender: Male
Posts: 17

15 Jan 2012, 4:43 am

Titangeek wrote:
^Wouldn't the IDE catch that?


Oh, sorry for confusing you, no I wont be typing walrus into any interpreters any time soon, just likening my story to the OP's post : P

Similar because instead of just typing in walrus and deleting a word, just delete the variable, and rename it using an accentuated character, making it hard to find : P