[Tip] Solve your first error first
Author |
Message |
wtd
|
Posted: Thu Sep 30, 2004 9:38 pm Post subject: [Tip] Solve your first error first |
|
|
This one came up lately, and it seems worthy of an entry here, desipte its simplicity.
When looking at compiler errors and trying to fix them, always fix the very first error first.
In many cases, the errors that follow are a result of the first error. Fixing the first may have a cascading effect and sove many more. On the other hand, solving a problem that's not the first error is often in vain, since finally fixing the first error may break the code you "fixed" in other ways. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Thu Sep 30, 2004 11:18 pm Post subject: (No subject) |
|
|
just to add on to that - if your first error is not making sence and the line looks alright, don't just desreguard it for the reasons above. Examine the line above and see if that is what casuing the real problem - often enough its a missing semi-collon ; |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
wtd
|
Posted: Thu Sep 30, 2004 11:36 pm Post subject: (No subject) |
|
|
Good corollary. The compiler is not perfect, and C++ syntax is complex, allowing you to say something that makes no sense and still have it be (almost) valid syntax.
Of course, in retrospect, this is usually a good tip for any programming language. |
|
|
|
|
|
Dan
|
Posted: Fri Oct 01, 2004 2:51 pm Post subject: (No subject) |
|
|
In some cases i have seen the complier acautly dose get messed up and your code is fine (esptaly in dev-c++), one thing you should try is resting the complier and then rebuiding. I know this probly dose not hapen alot but i have wasted a few hours trying to fix a bug when the complier was just messed over |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
wtd
|
Posted: Fri Oct 01, 2004 4:03 pm Post subject: (No subject) |
|
|
I'm writing all of this from the perspective of someone using the commandline tools exclusively.
IDEs do so much to screw with programmers' minds, and they all do different things to that effect, that to address their quirks would be a lifelong labor. |
|
|
|
|
|
Dan
|
Posted: Fri Oct 01, 2004 6:05 pm Post subject: (No subject) |
|
|
true that.
For my C/C++ corse in uni i am writing all my code in the unix comand line with a text editor and then compling with gcc |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
|
|