• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

C++ without Fear

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First I wanted to clarify the link to C++ without fear in the welcome to Brian took me to the Amazon page for the 2004 release.

I wanted to know whether the new book covered the recent changes to c++ and what Brian thought the most significant changes changes would be? http://www.pcworld.idg.com.au/article/381241/iso_finalizes_c_update/
 
author
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh yeah -- it's t here in the book, so my advice is, buy the book!

To be honest, I must give you a longer answer here. I cover most of the C++0x spec, but it is very, very expensive... also, large parts of it were difficult to test, difficult to acquire a compiler for, and also about things still being changed.

What is most important depends on what you use it for. To me some of the most important new features of the spec are:

-- "long long int" type (64 bits usually), though that's long been supported by some compilers

-- ranged-based "for" which works like "for each" in Basic; it removes need to check boundry conditions yourself, and so is much less error prone, as well as convenient

-- subclasses inherit base-class constructors... a potentially huge change for object oriented programming, saving much work, potentially

-- strongly-typed enumerations... so that the "enum" keyword can be used to creating even stronger type declarations

-- user-defined constants... essentially you can define new "literal" formats for the compiler to recognize. This is a further step in enabling you to truly use classes like they were primitive types. You can make a literal like "3i" into an instance of an Imaginary number class, for example, so that "5+3i" denotes a complex number. (Cool.)

-- more consistent initialization rules

-- smart pointers, which implement garbage collection for you

These are just some of the features I felt really important.

I am sorry I did not get to lambda functions and multi-threading... but these I felt were outside the scope of the book, which was already getting too large. Lambda functions are extremely difficult to explain, by the way... it's like you're creating a function definition "on the fly" without ever calling it in the normal way. Personally, I find it incredibly difficult to explain why this is useful, although there are some very advanced programmers who want it.

== Brian Overland
 
reply
    Bookmark Topic Watch Topic
  • New Topic