Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Squaring the circle

Sign in to follow this  


Interesting observation for the day:

In C++ beginner programmers often utilize the default behaviour of the compiler created copy constructor and assignment operator, often without realizing it. Eventually this practice causes problems (See the Rule of Three). Later the programmer develops an aversion to these default implementations. Some start automatically writing implementations whether they are needed or not. Some start disabling copy construction and assignment whenever they can get away with it.

Of course, then there are programmers who come full circle and use the default copy constructor and assignment operator implementations regularly. Usually this a result of religious use of member variable types that properly support copy construction, like smart pointers or container classes.

Sometimes I wonder if there's a way to teach C++ that would help beginners skip the intermediate steps and go right to choosing the right member variables. So far it seems like a pipe dream until we can get more of these useful classes into the standard library itself. Of course, it's like pulling teeth to get posters on our boards here to use std::vector, much less boost.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!