Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 03 Jul 2012
Offline Last Active Yesterday, 03:10 AM

Posts I've Made

In Topic: Is it bad to use macros such as __LINE__ or __DATE__?

05 April 2016 - 08:31 AM

__DATE__ and __TIME__ can make trouble if you need bit-by-bit reproducable builds. I would assume that is not true for games, but I've been working on projects where that was a hard requirement.

In Topic: "It's when you...", or: little things you've discovered about...

03 March 2016 - 09:36 AM

When you realise that after all these years there is still yet more C++ syntax to learn, like function-try-blocks:


Wow. I actually checked the standard to confirm that it's really standard C++ and not some strange extension, but I'm pretty amazed right now. I guess that's how you felt when you learned it a few years back!

In Topic: Criticism of C++

06 January 2016 - 02:34 AM

C++ has different goals and try to keep them by forcing backward compability, what if C++ had to be designed nowdays from scratch? It will result in much more clean, simple and performant language with less maintenance burden both on client and compiler side.


And it would never have gained the popularity it has today. Without backwards compatibility, you don't get this huge code base that already compiles as C++ and can start using C++ features where you see them fit. If it had broken with backwards compatibility early on, it would be in a similar position that D is in today: People know about it, many think it's even a good language and still very few people (in comparison) use it.

In Topic: Criticism of C++

05 January 2016 - 06:16 AM

Yeah, a few breaking changes for a future release would not hurt too much, as long as it doesn't go the Python way where 99% of Python 2 programs don't work with Python 3 and still a significant amount still don't work after running 2to3.


But as long as compilers keep clean support for the old standards, carefully removing clutter might be a good option. I have not seen a lot of C++98 code being reused without any change in modern C++. All projects I worked on either kept everything in the old standard or updated at least parts of the code (usually because C++ compilers were bad back in the day and people had to rely on or workaround compiler extensions or quirks which are no longer valid for most modern compilers). So requiring to update parts of a very old code base (in this case up to 18 years) doesn't seem like too much of a problem.


But I have the feeling that the things that would be changed would not be the things opponents of C++ have in mind when they speak about "breaking backward compatibility". Lots of the undefined and implementation defined behaviour would (have to) remain for various reasons.


Those things have already happened (e.g. std::auto_ptr in C++, gets in C) should continue happening, but with sound judgement and not break relatively recent code (I'm looking at you again, Python).

In Topic: Criticism of C++

04 January 2016 - 09:13 AM


If that is something that makes the language unviable for you, use a different one.

Can we not have a civil discourse on the pros/cons of a language without resorting to this?



It was an honest suggestion. If, after evaluating your needs, you find that C or C++ are not the right languages, then I hope you will use something else. If you find that C++ is the right language for the problem you are trying to solve, then it's often because all this implementation defined stuff makes it a very efficient language (if used right). Without these implementation defined features, you would lose many of the benefits of C++ and could just as well switch to C#.


I guess what I'm trying to say is that things like the unspecified size of basic data types (or any other of the things flagged as implementation defined) are an advantage of the language, rather than a disadvantage. Sure, it causes problems of its own, but the alternative solutions cause other problems. You have to decide which of the problems are more acceptable for your project and chose the appropriate language.


You defined something as "broken" what in fact is not. If you still think it's a defect in the language, it means you need to use a different language. You complain to me about reiterating the same arguments, while you are doing the same.