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 32,817 of 33,346    |
|    fmatthew5876 to All    |
|    iostream replacement    |
|    24 Jan 13 23:59:38    |
   
   From: fmatthew5876@googlemail.com   
      
   { Please limit your text to fit within 80 columns, preferably around 70,   
    so that readers don't have to scroll horizontally to read each line.   
    This article has been reformatted manually by the moderator. -mod }   
      
   Have there ever been any proposals are serious talks about a replacement   
   for the iostreams library? Many people including myself vehemently   
   dislike this library. Among other things, its painfully slow, overly   
   verbose, and is the first example of operator overloading abuse. It also   
   separates formatting from the data. Have you ever tried to print a hex   
   byte with iostreams? Its really ugly.   
      
   Printf while not typesafe, is much more convenient, efficient, easier to   
   use, and supports multilingual applications better. With variadic   
   templates there are now even examples of typesafe printf. Google's   
   coding standards even bans iostream in favor of printf. While I prefer   
   stdio and printf, its a shame that FILE* is not a class and thus does   
   not support RAII.   
      
   I'd really like to see a new IO library that uses printf like syntax   
   along with generic binary read and write functions. There should still   
   be an object oriented class hierarchy with virtual functions, so that   
   you can have a generic stream which may be a file, memory buffer,   
   network socket, ipc, etc.. We could even possibly have a standard   
   version of select() or poll() to wait on multiple stream objects.   
      
   I'm really afraid that if were stuck with iostreams, then new standard   
   library IO additions such as a networking API will either be forced to   
   be iostream compatible for genericity via the iostream interface or   
   completely break with iostream which means we lose the ability to have   
   generic streams.   
      
   iostream is a relic from when C++ was still new and good object oriented   
   design was still not well understood. Its really time for it to go.   
      
      
   --   
    [ 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