The GD Coding Typo Dictionary (TM)

Started by
37 comments, last by fastcall22 13 years ago

This pearl catches me out every once in a while.

if(x = y)
{
.....
}


You need to turn compiler warnings on. GCC certainly warns about this with -Wall, and I assume every other compiler can too...

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Advertisement
Mispelt Blacksmith with Blackshit yesterday, the keys aren't even near eachother.
You also can find a lot of "pubic" [url="http://bit.ly/ij3KXl"](???)?[/url]

You also can find a lot of "pubic" (???)?

I am honestly a little worried about all those .sql files which seem to *intentionally* include the word 'pubic'...

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]


Mispelt Blacksmith with Blackshit yesterday, the keys aren't even near eachother.


racist.
posiiton. Every dang time.

I used to get the false thing a lot until I realized it's such a stupid return value (and yes, in my experience return values are the primary source of falsehood) and set up my own return value framework, which looks something like this:


#define WS_E_SNIPPET


Returning false is like walking out on a date smiling like a clown - it gives pretty much to zero feedback. On the other hand, each time I type in "WS" or "WS_" autocomplete alerady knows I probably mean WS_E_NOERROR and I won't need to feel sorry about it having to suggest a five-letter word a baby could spell (and I couldn't) over a 15-letter monstrosity with underscores.


Even in this case, you assume there's only x amount of predefined errors, and those are vague. WS_E_OVERFLOW? Overflow of WHAT?
I much rather prefer the function that generates the error reporting it - in the log! That's what log is for after all. And once there is a (detailed) log entry of what went wrong the designer/coder can look at, returning true/false is good enough. After all, when my gameplay code tries to create a projectile but fails to load its mesh, it really doesn't care if it's because the mesh was not found, or the buffer has overflown.

And when I'm doing a lot of nesting/recursion, I'll just wrap the whole thing in try/catch and just have them throw an exception (with a message), catch it, print it to the log, and then return false or something.


posiiton. Every dang time.


That's why I use "location" :P
Comrade, Listen! The Glorious Commonwealth's first Airship has been compromised! Who is the saboteur? Who can be saved? Uncover what the passengers are hiding and write the grisly conclusion of its final hours in an open-ended, player-driven adventure. Dziekujemy! -- Karaski: What Goes Up...
cosnt instead of const. Can't count how many times I've done this. Yes, highlighting helps here, but I usually do not look, scroll right away or switch files....
nirnakuze => normalize
(nira na ku ze => ?????????? => "National Industrial Recovery Act is satisfied, Au Chak"?)

My right hand is rebellious and doesn't afraid of Home Row.

This topic is closed to new replies.

Advertisement