• Advertisement
Sign in to follow this  

The GD Coding Typo Dictionary (TM)

This topic is 2477 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.


Recommended Posts

Let's admit it, we all make them. However, some are more amusing than others.

For instance, I keep typing [i]bugger [/i]instead of [i]buffer[/i]. and [i]PoopState[/i] instead of [i]PopState[/i]. Also, I rather often type in an entirely unrelated and wrong word - for instance, last night I wrote [b]lever[/b] instead of [b]class[/b]. A while back I remember I was speed-coding and bleeding typos like a dyslexic Eskimo and I misspelt [i]random [/i]as something like [i]rdnadmod[/i]. The hardest part when something like that happens is winning that inner struggle and making the correct choice of deleting the entire word and re-typing it instead of trying to unmangle it one letter at a time, using cut and paste for single letters, [i]because it just seems so right when you're coding like a mofo[/i].

I love typos - it's always great to see the compiler pop up a warning that VK_SHIFT is spelt with an f.

Now share your golden puppies!

Share this post


Link to post
Share on other sites
Advertisement
I very rarely make typos when I code, so I don't have any that spring to mind. Typing existing member names only requires a few keystrokes before IntelliSense kicks in. Additionally, I can't code so fast that I outpace my brain; usually the code I'm writing takes some thought and isn't blindly hacking away like you're some sort of glorified scribe or secretary on crack. Furthermore, mistyping a character causes an immediate backspace and continuation, and if I happen to mess up more than one letter a Ctrl+Backspace deletes the word and I just retype it again.

On a tangential note, your poll demonstrates quite aptly why polls in technical forums are not only pointless but downright annoying in the extreme.

Share this post


Link to post
Share on other sites
"instead of trying to unmangle it one letter at a time, using cut and paste for single letters"

:D


Anyway: FASLE

EDIT: that smiley is a gay

Share this post


Link to post
Share on other sites
[quote]Anyway: FASLE [/quote]

Fasle, all the time, GODDAM FASLE!

Also somewhen I spend a few minutes to figure out the difference between DoQuickload() and DoQuickIoad(). And that happened to me only because of......
[quote]"instead of trying to unmangle it one letter at a time, using cut and paste for single letters"[/quote]

Share this post


Link to post
Share on other sites
[quote name='mind in a box' timestamp='1296078689' post='4765294']
[quote]Anyway: FASLE[/quote]
Fasle, all the time, GODDAM FASLE![/quote]
I had the honour to peek into a legacy codebase recently:

[code]#define FALSE (unsigned)-1
#define FASLE (unsigned)-1
#define AFLSE (unsigned)-1
#define FLASE (unsigned)-1
#define FALES (unsigned)-1[/code]
And yes, there were matching definitions for true. Sadly, the permutations of FILE_NOT_FOUND were nowhere to be seen...

Share this post


Link to post
Share on other sites
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:

[code]
#define WS_E_NOERROR 0x0
#define WS_E_UNKNOWN_ERROR 0x1
#define WS_E_UNDEFINED_ERROR 0x2
#define WS_E_NO_OBJECT 0x3
#define WS_E_INVALIDSTATE 0x4
#define WS_E_UNDERFLOW 0x5
#define WS_E_OVERFLOW 0x6
#define WS_E_NOTIMPLEMENTED 0x7
#define WS_E_INVALIDARGUMENT 0x8
#define WS_E_INDEXOUTOFBOUNDS 0x9
#define WS_E_INSUFFICIENTMEMORY 0xa
#define WS_E_INVALIDCERTIFICATE 0xb
#define WS_E_INVALIDTYPE 0xc
#define WS_E_NOTSUPPORTED 0xd
#define WS_E_UNAVAILABLE 0xe
#define WS_E_INVALIDVERSION 0xf
#define WS_E_INTERNALERROR 0x10
#define WS_E_INVALIDOBJECT 0x11
#define WS_E_FILENOTFOUND 0x12
#define WS_E_UNRECOGNIZEDFORMAT 0x13
#define WS_E_INVALIDFORMAT 0x14
#define WS_E_DISKERROR 0x15

#define WS_E_NULL 0x16

static const wchar_t* WSEString[] = {
L"No error",
L"Unknown error",
L"Undefined error",
L"No object",
L"Invalid state",
L"Underflow",
L"Overflow",
L"Not implemented",
L"Invalid argument",
L"Index out of bounds",
L"Insufficient memory",
L"Null error",
L"Invalid type",
L"Not supported",
L"Unavailable",
L"Invalid version"
L"Internal error",
L"Invalid object",
L"File not found",
L"Format not recognized",
L"Invalid format",
L"Disk or I/O error",
};
[/code]

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.

Share this post


Link to post
Share on other sites
[quote name='Hodgman' timestamp='1296102254' post='4765446']
Ahahha, this is fun: [url="http://www.google.com/codesearch?hl=en&lr=&q=fasle&sbtn=Search"]http://www.google.co...sle&sbtn=Search[/url][/quote]
I would be less worried if several of those weren't in the Android kernel drivers...

Share this post


Link to post
Share on other sites
[quote name='swiftcoder' timestamp='1296102428' post='4765447']
[quote name='Hodgman' timestamp='1296102254' post='4765446']
Ahahha, this is fun: [url="http://www.google.com/codesearch?hl=en&lr=&q=fasle&sbtn=Search"]http://www.google.co...sle&sbtn=Search[/url][/quote]
I would be less worried if several of those weren't in the Android kernel drivers...
[/quote]

That was pretty... scary.

Share this post


Link to post
Share on other sites
[quote name='mind in a box' timestamp='1296078689' post='4765294']
Also somewhen I spend a few minutes to figure out the difference between DoQuickload() and DoQuickIoad(). And that happened to me only because of......
[/quote]
Looks like someone needs a better font. (after a copy paste to my editor, the difference stood out quite well)

stupid fasle, and
#incldue or was that #inculde ?
maybe i should make a new #defien macro?

Share this post


Link to post
Share on other sites
[quote name='KulSeran' timestamp='1296108663' post='4765474']
[quote name='mind in a box' timestamp='1296078689' post='4765294']
Also somewhen I spend a few minutes to figure out the difference between DoQuickload() and DoQuickIoad(). And that happened to me only because of......
[/quote]
Looks like someone needs a better font. (after a copy paste to my editor, the difference stood out quite well)
[/quote]

I thought exactly the same after that happened and switched to another font, so I should be good now ;)

Share this post


Link to post
Share on other sites
I don't really make those kind of mistakes often, since I usually know when I've made a typo straight away, and rectify it using backspaces. However, I always seem to write destory instead of destroy. Maybe I should type destroy over and over again until I always get it right.

Oh, and I also refuse to vote in the poll, since that means I have to answer the second question.

Share this post


Link to post
Share on other sites
[quote name='-Datriot-' timestamp='1296162564' post='4765842']
However, I always seem to write destory instead of destroy. Maybe I should type destroy over and over again until I always get it right.[/quote]
You know how when you say a word over and over again, it starts to sound strange and you get confused about the pronunciation? Same goes for repeatedly typing the same word over and over. By this time tomorrow, you will be typing 'tesrody'...

Share this post


Link to post
Share on other sites
I find that if syntax highlighting is on, typos like FASLE don't properly highlight and it tips me off pretty quick that something is wrong.

Share this post


Link to post
Share on other sites
Add a little spice to your headers

[code]#define FASLE (true)[/code]

Share this post


Link to post
Share on other sites
for the Python folks: [url="http://www.google.com/codesearch?hl=en&lr=&q=%5B%5E%5Cw%5Dsefl%7Cslef%5B%5E%5Cw%5D+lang%3Apython&sbtn=Search"]what is it about those 4 keys[/url]

Share this post


Link to post
Share on other sites
[quote name='Noggs' timestamp='1296275512' post='4766497']
Add a little spice to your headers

[code]#define FASLE (true)[/code]
[/quote]

Genius. +1 from me

Share this post


Link to post
Share on other sites
I always giggle when I have to declare an [url="http://msdn.microsoft.com/en-us/library/bb775507(VS.85).aspx"]INITCOMMONCONTROLSEX[/url] structure. I love common controls, but I don't really want to initialise sex with them.

Share this post


Link to post
Share on other sites
I've been the entire last hour looking for this bug. To make it worst finding it didn't solve the problem cause it happened that I copy-pasted the if clause in several places that I also had to modify once I realized my stupidity.
[code]

if (this_shouldnt_be_called_all_the_time);
dont_do_this_all_the_time();

[/code]

Share this post


Link to post
Share on other sites
[quote name='owl' timestamp='1296387835' post='4766982']
I've been the entire last hour looking for this bug. To make it worst finding it didn't solve the problem cause it happened that I copy-pasted the if clause in several places that I also had to modify once I realized my stupidity.
[code]

if (this_shouldnt_be_called_all_the_time);
dont_do_this_all_the_time();

[/code]
[/quote]

Shouldn't the compiler pop a warning on something like this? Eg, "C7273 - Hey, silly - you didn't REALLY mean that semi, didya?"

Share this post


Link to post
Share on other sites
[quote name='irreversible' timestamp='1296390735' post='4766988']
[quote name='owl' timestamp='1296387835' post='4766982']
I've been the entire last hour looking for this bug. To make it worst finding it didn't solve the problem cause it happened that I copy-pasted the if clause in several places that I also had to modify once I realized my stupidity.
[code]

if (this_shouldnt_be_called_all_the_time);
dont_do_this_all_the_time();

[/code]
[/quote]

Shouldn't the compiler pop a warning on something like this? Eg, "C7273 - Hey, silly - you didn't REALLY mean that semi, didya?"
[/quote]

Apparently not. At least not gcc with ansi compatible warnings enabled.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement