home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 33,319 of 33,346   
   wmacevoy@googlemail.com to All   
   Re: Access Data Items In Ancestor Stack    
   04 May 14 16:01:50   
   
   { Double-spacing and the clc++m banner removed from the quoting.   
     Text reformatted to fit within 80 columns. -mod }   
      
   On Thursday, June 13, 2013 7:50:42 AM UTC-6, Öö Tiib wrote:   
   > On Wednesday, 12 June 2013 15:50:59 UTC+3, Frank Bergemann  wrote:   
   > > Here's the final version - pls. see below. But it's just an example.   
   > > Maybe for other algorithms it will be more usable.   
   >   
   > IMO current model of requesting all information a function needs from   
   > caller by declaring explicit function parameters is cleaner and simpler   
   > to understand.   
   >   
   > That Dobbs article seemingly misses the point. Exceptions are necessary   
   > evil ... efficient way to deal with very rare concerns. Now if a function   
   > realizes that it can not do what it should because some access is not   
   > granted or keys are not authorized then it should either abort the   
   > program or throw exceptions or return error (depends on its contract   
   > requirements). Somehow hacking and repairing the situation by doing   
   > something that is far above its responsibilities is most evil thing to do   
   > because it results with spaghetti code that we all hate.   
      
   I am the author.  I agree that, like the exception mechanism,   
   retain/recall should only occasionally be used.  Named parameters or   
   instance data are typically better choices for getting information to   
   a method that needs it.  The point of the article was to define a grey   
   area between these choices, and global variables (essentially the only   
   other choice without retain/recall).  The example applications in the   
   code illustrate a group of problems where retain/recall significantly   
   simplifies solving certain reasonably common problems.   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca