Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 [Tip] Solve your first error first
Index -> Programming, C++ -> C++ Tutorials
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wtd




PostPosted: 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
Sponsor
sponsor
Tony




PostPosted: 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 ;
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
wtd




PostPosted: 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




PostPosted: 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 Razz
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
wtd




PostPosted: 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




PostPosted: 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 Wink
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Display posts from previous:   
   Index -> Programming, C++ -> C++ Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: