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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/27/05 08:00
Modified:
  09/27/05 08:09

Read: times


 
#101598 - the borderline
Responding to: ???'s previous message
Oliver Sedlacek said:
I think that the important bit is that the expected flow is what the function promises to do, so a function called char getCharFromBuf() promises to return a char. The only permissible reason for breaking the promise is an exception which makes it impossible to fulfil.


Well there is a very narrow borderline in defining "exception" - in this case, you might as well call an "unexpectedly early" CR an "exception" which would justify the "jump", when the called routine could not return the "promised" "non-CR" character... So that's all about conventions only, and common experience shows that it is better to keep this kind of stuff to minimum - maybe with the exception that in case of "critical error" a jumpout/shortcut is correct or acceptable...

I think the main difference is in the tools - while in C or some HLL the try...catch construction gets automatically translated into a quite complicated set of instructions, which updates automatically (with each rebuild) as the work progresses; in asm it is all about discipline. Again, common experience shows that in asm it is better to avoid constructions requiring discipline as much as possible.

Jan Waclawek


List of 24 messages in thread
TopicAuthorDate
RET to a different address            01/01/70 00:00      
   here is how pseudocode            01/01/70 00:00      
      RET to a different address            01/01/70 00:00      
         no flaw, but 1.000.000 gotchas            01/01/70 00:00      
            That's what I wanted to know            01/01/70 00:00      
               Yes            01/01/70 00:00      
               "clever"            01/01/70 00:00      
                  OT: my wife            01/01/70 00:00      
         no flaw, but seriously not recommended            01/01/70 00:00      
            experience            01/01/70 00:00      
               reload SP            01/01/70 00:00      
                  restoring stack            01/01/70 00:00      
         Recognisable string            01/01/70 00:00      
      named return value            01/01/70 00:00      
   Bad Practice            01/01/70 00:00      
      Well phrased            01/01/70 00:00      
   What I am doing with it            01/01/70 00:00      
      try...catch            01/01/70 00:00      
         setjmp / longjmp            01/01/70 00:00      
         when to try ... catch            01/01/70 00:00      
            the borderline            01/01/70 00:00      
               Promises            01/01/70 00:00      
                  who cares if an exceptiom is "acceptable            01/01/70 00:00      
      Parsing input data            01/01/70 00:00      

Back to Subject List