home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 16232 < prev    next >
Encoding:
Text File  |  1992-11-14  |  1.2 KB  |  39 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!snorkelwacker.mit.edu!ira.uka.de!ira.uka.de!slsvaat!josef!kanze
  3. From: kanze@us-es.sel.de (James Kanze)
  4. Subject: Re: Just what is so great about streams?
  5. In-Reply-To: tim@gold.iss.nus.sg's message of Thu, 12 Nov 1992 06:19:42 GMT
  6. Message-ID: <KANZE.92Nov13200446@slsvhat.us-es.sel.de>
  7. Sender: news@us-es.sel.de
  8. Organization: SEL
  9. References: <1992Nov12.061942.16473@nuscc.nus.sg>
  10. Date: 13 Nov 92 20:04:46
  11. Lines: 26
  12.  
  13.  
  14. |> This posting is a genuinely answer-seeking question,
  15.  
  16. |>   what _is_ so great about streams?
  17.  
  18. I don't really like the syntax for streams either.  In fact, I don't
  19. think many peoply do.
  20.  
  21. We use them for two main reasons:
  22.  
  23. 1. Type safety:  There's no way you can do something like:
  24.     printf( "%f" , 1 ) ;
  25.  
  26. 2. Extensibility:  How do you expand printf to handle user defined
  27. types.
  28.  
  29. So we learn to live with the ungainly syntax.
  30.  
  31. Does anyone know of a better way of handling IO formatting in a
  32. type-safe, extensible manner.  It's too late to change the iostream
  33. syntax, but I am curious as to what the alternatives are.
  34. --
  35. James Kanze            GABI Software, Sarl.
  36. email: kanze@us-es.sel.de    8 rue du Faisan
  37.                 67000 Strasbourg
  38.                 France
  39.