Penguin

Differences between current version and predecessor to the previous major change of C++.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 23 Last edited on Tuesday, November 9, 2004 1:16:01 am by AristotlePagaltzis
Older page: version 19 Last edited on Wednesday, November 19, 2003 6:24:25 pm by AristotlePagaltzis Revert
@@ -1,13 +1,13 @@
-A ProgrammingLanguage developed by BjarneStroustrup as the successor to [C], keeping all of its power and flexibility, adding all new disadvantages. It's an almost-superset of its predecessor and adds ObjectOrientation, [Template]s and [ NameSpace] s. 
+A ProgrammingLanguage developed by BjarneStroustrup as the successor to [C], keeping all of its power and flexibility, adding all new disadvantages. It's an almost-superset of its predecessor and adds ObjectOrientation, [Template]s and NameSpace~ s. 
  
 ---- 
  
 !!! Advantages 
  
 * Strict typing so the [Compiler] picks up more errors. 
 * Typesafe generic programming via [Template]s, and a standard library of them, the [STL]. 
-* [ NameSpace] s to help avoid symbol name collisions between independent pieces of code. 
+* NameSpace~ s to help avoid symbol name collisions between independent pieces of code. 
 * Code reuse via ObjectOrientation. 
 * iostreams as a replacement for printf(3). 
  
 ---- 
@@ -15,54 +15,66 @@
 !!! Complaints 
  
 !! String class 
  
-What's the point of a string class if it's not fully compatible __ char *__ and is therefor useless for many IO operations? Eg you need a character buffer and can't pass a string object to 
+What's the point of a string class if it's not fully compatible <tt> char *</tt> and is therefor useless for many [I/O] operations? Eg. you need a character buffer and can't pass a string object to 
  
-* __ istream::getline(char *, size_t)__  
-* __ read(char*, size_t)__  
-* __ get(char*, size_t)__  
-* ... the list goes on. 
+* <tt> istream::getline(char *, size_t)</tt>  
+* <tt> read(char*, size_t)</tt>  
+* <tt> get(char*, size_t)</tt>  
+* ... and the list goes on. 
  
 !! Variable interpolation 
  
 Interpolating variables into strings is absolutely hideous and easier done by reverting back to [C]. Compare: 
  
- // C way  
- char buffer[ [16];  
- snprintf(buffer,15,"output-%n.txt", counter); 
+<verbatim>  
+ // C way  
+char buffer[16];  
+snprintf(buffer,15,"output-%n.txt", counter); 
  
- // vs 
+// vs 
  
- // C++  
- strstream ss;  
- string s;  
- ss << "output-" << counter << ".txt" ;  
- ss >> s; 
+// C++  
+strstream ss;  
+string s;  
+ss << "output-" << counter << ".txt" ;  
+ss >> s;  
+</verbatim>  
  
 !! GarbageCollection (not) 
  
-Since BjarneStroustrup liked [Simula67 | http://www.cetus-links.org/oo_simula.html] but decided GarbageCollection was "too slow", he designed his own perfect language with ObjectOrientation but no GarbageCollection. Quite a few people will readily assume he must have been on crack. Besides having to manage memory yourself, you now have to cope with new syntactic sugar that can conceal which part of your code is responsible for what bits on your heap. Great fun - really! 
+Since BjarneStroustrup liked [Simula67 | http://www.cetus-links.org/oo_simula.html] but decided GarbageCollection was "too slow", he designed his own perfect language with ObjectOrientation but no GarbageCollection. Quite a few people will readily assume he must have been on crack. Besides having to manage memory yourself, you now have to cope with new syntactic sugar that can conceal which part of your code is responsible for what bits on your heap. Great fun - - really!  
+  
+''Whoever wrote this last paragraph needs to smoke less crack themselves.'' -- SamJansen  
  
 !! [Template]s 
  
 Your compiler will segfault regularly instead of producing error reports when you stuff up a [Template] definition. When it does produce an error report, it looks like the (drastically snipped down) one below (in this case it's from the [STL]). 
  
- /usr/include/stlport/stl/_hashtable.h: In method `size_t _STL::hashtable<_STL::pair<const CActionHandler::Keycode,void  
- __<snip>__  
- /usr/include/stlport/stl/_hashtable.c:347: instantiated from `_STL::hashtable<_STL::pair<const CActionHandler::Keycode,void  
- (CActionHandler::*)()>,CActionHandler::Keycode,_STL::hash<CActionHandler::Keycode>,_STL::_Select1st<_STL::pair<const  
- CActionHandler::Keycode,void (CActionHandler::*)()> >,_STL::equal_to<CActionHandler::Keycode>,_STL::allocator<_STL::pair<const  
- CActionHandler::Keycode,void (CActionHandler::*)()> > >::resize(unsigned int)'  
- /usr/include/stlport/stl/_hashtable.c:169: instantiated from `_STL::hashtable<_STL::pair<const CActionHandler::Keycode,void  
- (CActionHandler::*)()>,CActionHandler::Keycode,_STL::hash<CActionHandler::Keycode>,_STL::_Select1st<_STL::pair<const  
- CActionHandler::Keycode,void (CActionHandler::*)()> >,_STL::equal_to<CActionHandler::Keycode>,_STL::allocator<_STL::pair<const  
- CActionHandler::Keycode,void (CActionHandler::*)()> > >::_M_insert(const _STL::pair<const CActionHandler::Keycode,void  
- (CActionHandler::*)()> &)'  
- /usr/include/stlport/stl/_hash_map.h:188: instantiated from here  
- /usr/include/stlport/stl/_hashtable.h:557: no match for call to `(const _STL::hash<CActionHandler::Keycode>) (const  
- CActionHandler::Keycode &)' 
+<pre>  
+ /usr/include/stlport/stl/_hashtable.h: In method `size_t ~ _STL::hashtable<_STL::pair<const CActionHandler::Keycode,void  
+__<snip>__  
+/usr/include/stlport/stl/_hashtable.c:347: instantiated from `_STL::hashtable<_STL::pair<const CActionHandler::Keycode,void  
+(CActionHandler::*)()>,CActionHandler::Keycode,_STL::hash<CActionHandler::Keycode>,_STL::_Select1st<_STL::pair<const  
+CActionHandler::Keycode,void (CActionHandler::*)()> >,_STL::equal_to<CActionHandler::Keycode>,_STL::allocator<_STL::pair<const  
+CActionHandler::Keycode,void (CActionHandler::*)()> > >::resize(unsigned int)'  
+/usr/include/stlport/stl/_hashtable.c:169: instantiated from `_STL::hashtable<_STL::pair<const CActionHandler::Keycode,void  
+(CActionHandler::*)()>,CActionHandler::Keycode,_STL::hash<CActionHandler::Keycode>,_STL::_Select1st<_STL::pair<const  
+CActionHandler::Keycode,void (CActionHandler::*)()> >,_STL::equal_to<CActionHandler::Keycode>,_STL::allocator<_STL::pair<const  
+CActionHandler::Keycode,void (CActionHandler::*)()> > >::_M_insert(const _STL::pair<const CActionHandler::Keycode,void  
+(CActionHandler::*)()> &)'  
+/usr/include/stlport/stl/_hash_map.h:188: instantiated from here  
+/usr/include/stlport/stl/_hashtable.h:557: no match for call to `(const _STL::hash<CActionHandler::Keycode>) (const  
+CActionHandler::Keycode &)'  
+</pre>  
+  
+This is perhaps a good reason to stay away from [C++] and program in [INTERCAL] or [PASL]. Or maybe [Java] (see [JavaAndC++]). Or in something like [OCaml], which has parametized types, classes, and modules, covering most if not all the possible uses of [C++] [Template]s in a saner manner.  
+  
+----  
+  
+!!! See also  
  
-This is perhaps a good reason to stay away from [C++] and program in [INTERCAL] or [PASL]. Or maybe [Java] (see [JavaAndC ++]). Or in something like [Ocaml | http://www.ocaml.org ], which has parametized types, classes, and modules, covering most if not all the possible uses of [C++] [Template]s in a saner manner
+[C++Notes ] offers hints on [C ++] and [STL ] constructs if you can't find a better language to program your application in..
  
 ----- 
 CategoryProgrammingLanguages, CategoryImperativeProgrammingLanguages, CategorySystemsProgrammingLanguages, CategoryObjectOrientedProgrammingLanguages, CategoryMachineOrientedProgrammingLanguages