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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/27/05 01:36
Read: times


 
#103003 - I second it
Responding to: ???'s previous message

Further to Erik's excellent advice - I read the code and came to the same conclusion - I already know that DEC R1 ;decrement R1

Reading this code is little better than deciphering the output of a dissassembler.

Having said that, do you really need a pre-emptive task switcher? Could you not poll each line in order, skipping the ones that are not active?

Could you not have four copies of essentially the same code for each line? It would be 'cleaner' to have one set of subroutines that you pass a line number to. Having four copies of the same is normally a last ditch effort to gain performance at the detriment of maintainability. With your use (abuse?) of macros - having the delay as a macro -what does it gain you over having a subroutine?

If you gave the same task to 10 programmers -each would solve the same problem differently, but you would most likely see common methods used within that 10. So what I'm saying is that there is no one correct way of solving your problem, but some methods may be better than others. The main criteria is: 'does it work?' next is 'can anyone else understand it and maintain it?'. That 'someone else' could be you 6 months later! I would suggest you read 'Code Complete' which goes into depth about all the philosophical questions one asks when writing code.

http://www.cc2e.com/




List of 4 messages in thread
TopicAuthorDate
Improved code advice ?            01/01/70 00:00      
   code advice            01/01/70 00:00      
   I second it            01/01/70 00:00      
      Thirded            01/01/70 00:00      

Back to Subject List