Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualCorvwyn

Posted 01 March 2013 - 02:14 AM

In my opinion there's also the matter of productivity. By using unique/shared_ptr you avoid any nasty side-effects that might happen, and it takes less time to write code since you don't have to think of cases like that. There's a reason XNA and C# gained such popularity, and productivity is definitely one of them.

 

Things like this, along with other language improvements and the new libraries for DirectX should make C++/DirectX a much easier development choice than it was before. Sure, it might not be XNA, but it's becoming easier to use. This might be what the thread starter is looking for. 

 

Of course there will be a slight performance loss when using smart pointers, but as long as you use them as intended it should be negligible. unique_ptr should have virtually no performance loss. I use these almost exclusively, except in some lower level code. That being said, you should definitely learn how pointers work. The good thing with C++ is that you can always optimise if you find bottlenecks. If there's one thing I've learned to get things done, it's not to optimise prematurely. I'm not an expert here though. I'm apparently more of a tech demo developer and I haven't really finished a game yet :P

 

Hmm... This is starting to sound like a Microsoft/C++11 rant. I'd better stop.


#1Corvwyn

Posted 01 March 2013 - 02:03 AM

In my opinion there's also the matter of productivity. By using unique/shared_ptr you avoid any nasty side-effects that might happen, and it takes less time to write code since you don't have to think of cases like that. There's a reason XNA and C# gained such popularity, and productivity is definitely one of them.

 

Things like this, along with other language improvements and the new libraries for DirectX should make C++/DirectX a much easier development choice than it was before. Sure, it might not be XNA, but it's becoming easier to use. This might be what the thread starter is looking for. 

 

Of course there will be a slight performance loss when using smart pointers, but as long as you use them as intended it should be negligible. unique_ptr should have virtually no performance loss. I use these almost exclusively, except in some lower level code. That being said, you should definitely learn how pointers work. The good thing with C++ is that you can always optimise if you find bottlenecks. If there's one thing I've learned to get things done, it's not to optimise prematurely.

 

Hmm... This is starting to sound like a Microsoft/C++11 rant. I'd better stop.


PARTNERS