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

Squaring the circle

Sign in to follow this  
SiCrane

75 views

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  


0 Comments


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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!