Skip to main content
gamedev.net
🔒 Locked

Most common syntax error

Started by Eskhan Apr 26, 2003 at 3:45 PM 42 replies 1.8k views
Original Post
Eskhan
Eskhan
What is your most common syntax error? The one my compiler catches most often is too few paranthesises in large function calls
--------------------Though this program be madness, yet there is a method in't
Zipster
Zipster
The compiler rarely catches any syntax errors, because I usually find and fix any as I''m writing the code and before it is compiled, however I have to say I remember getting a lot of errors resulting from mis-typing variable or function names.
Enigma1625
Enigma1625
Yeah simple typos are usually what cause the mose errors for me. I''ve come to realize not to panic when after compiling a simple bit of code I get 76 errors, because I know that most likely I just mispelled something

unkn.Enigma1625
unkn.Enigma1625
downward_spiral
downward_spiral
Getting the case wrong in variable names such as aBigLongVariableName, or spelling them wrong when I go back to a class I wrote months ago.
David
walkingcarcass
walkingcarcass
Unrolling a loop 64 times by copy-paste, then finding 64*n typos

********


A Problem Worthy of Attack
Proves It''s Worth by Fighting Back
spraff.net: don't laugh, I'm still just starting...
Eskhan
Eskhan
hehe, ouch
--------------------Though this program be madness, yet there is a method in't
Dire.Wolf
Dire.Wolf
Forgetting to put the leading/trailing underscore on a member variable:

myMemberVariable_

Then I''ll do something like:

myMemberVariable.Foo();

When I''m programming late at night sometimes I''ll screw up my if-statements when testing for equality... = instead of ==
[email=direwolf@digitalfiends.com]Dire Wolf[/email]
www.digitalfiends.com
Eskhan
Eskhan
quote:

When I''m programming late at night sometimes I''ll screw up my if-statements when testing for equality... = instead of ==



guuh, just mentioning that makes my head hurt, i remember once when i had c++ homework and i was running really short on time, i spent probably over and hour trying to find out why the hell my program wouldn''t work, then i catch a = instead of a == in an if statement, damn i was so stressed out
--------------------Though this program be madness, yet there is a method in't
BrownBean
BrownBean
I''ve seen someone do this, then took hours debugging:


for ( int x = 0; x < 10; x++ ); // not the semi colon shouldn''t be there
printf ( "Number: %d\n", x );


// output, only once instead of 10 times...
"Number: 0

I agree with the "=" once instead of "==", still make that error.
Peon
Peon
I don''t really make me syntzx error anymore, but then again, the things I''m working on now are pretty simplistic. I would say the most common one for me right now would be writing the wrong thing for an argument that calls for a pointer. I end up with a lot of "paramter 2 cannot be converted to type blah blah" syntax errors, when working with pointers.
Peon
CraZeE
CraZeE
void funcName(void); <-- Ouch
{
}
To learn, we share... Give some to take some -
quant
quant
.h
-keyboard
Utwo
Utwo
The thing I hate about using ''='' instead of ''=='' in an if() statement, is that using ''='' is perfectly valid. It just does something other than what you want it to. Haha.
---signature---" Actually, at the time, I didn't give a damn about the FoxNews issue... just that you would come swooping in with your Super Mith cape flapping behind you and debunk it just because it didn't happen in your living room." - InnocuousFox
Eskhan
Eskhan
Yeah, at least you should get a warning
or something
--------------------Though this program be madness, yet there is a method in't
Spudder
Spudder
Its gotta be semi-colons for me, 95% of my errors are missing semi-colons which i never seem to notice until i compile.
cowsarenotevil
cowsarenotevil
I do the = instead of == a lot, and I also always make mistakes with variables in nested for loops.

-~-The Cow of Darkness-~-
-~-The Cow of Darkness-~-
eldee
eldee
mine usually result from undescriptive iterators in nested loops..
a while back i used to get alot of errors related to cyclic depenency

-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

Blaste
Blaste
I would have to say... semicolons, either I forget them, or I put them where they don''t need to be. The Borland compiler I use warns you about the == and = things in if structures, which is awesome and has saved me a few times

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.