Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/01/05 19:38
Read: times


 
#84208 - Divide and Conquer!
Responding to: ???'s previous message
I said:
One obvious problem here is that the expression is unnecessarily complex.
You need to break it down into simpler steps - then it will be easier to understand and easier to debug!!


Shahzad said:
you know that that is not the problem that is causing the code not to work

Maybe it is, maybe it isn't - but how do you know??

Shahzad said:
i can easily debug using debugger or using TC but you know i have only few LED's on my 8052 board so very limited debugging on 8052.

That is precisely why it is so important that you write your code in a way this is easy to debug!

Shahzad said:
now i know that its better to spend some money and have a good development environment to develop embedded projects.

Far better to write code that works!
But, of course, none of us can turn out 100% bug-free code 100% of the time - so you have to assume that you will need to spend some time debugging your code. Therefore you have to write your code in such a way that you can easily debug it with the tools available.

Again, the expression you've written is unnecessarily complex and will be hard to debug with even the best tools - therefore you really need to re-structure it.

Brian Kernighan said:
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.



List of 25 messages in thread
TopicAuthorDate
Keil C Code not working            01/01/70 00:00      
   Desktop turbo c++ ?            01/01/70 00:00      
      Slightly??!!            01/01/70 00:00      
      agreed            01/01/70 00:00      
         i got the math to do div / multiply            01/01/70 00:00      
         Debugger? Simulator? Maths?            01/01/70 00:00      
            Question...            01/01/70 00:00      
               Please use Correct Terms            01/01/70 00:00      
            Re Andy Debugger, Simulator? Math            01/01/70 00:00      
         *unnecessarily* complex!            01/01/70 00:00      
            Re andy            01/01/70 00:00      
               Divide and Conquer!            01/01/70 00:00      
         Bad Burner?            01/01/70 00:00      
            Re Andy Bad Burner            01/01/70 00:00      
         Project Configuration?            01/01/70 00:00      
   debugging?            01/01/70 00:00      
      thanks for the link            01/01/70 00:00      
   Data Sizes - Lesson not yet learned?            01/01/70 00:00      
      Re Andy            01/01/70 00:00      
   brackets ?            01/01/70 00:00      
      (no) brackets            01/01/70 00:00      
   WriteCommandLCD ?            01/01/70 00:00      
      Re Andy            01/01/70 00:00      
         Problem not fixed yet?            01/01/70 00:00      
            Problem not fixed yet?            01/01/70 00:00      

Back to Subject List