News for hackers. Stuff that matters.
Re:Current Proposals for C++17 by perone on Thursday February 25, 2016 @01:39PM (#11176603)
This is moving fast, a moratorium for some time would be beneficial for community. Like the one that happened in Python sometime ago.
Re:Current Proposals for C++17 by scott_s on Thursday February 25, 2016 @02:31PM (#11177094)
I think this is rather unlike the Python 3 situation. My guess for the resistance to Python 3 adoption is that it was, by design, not backwards-compatible with Python 2. C++ versions are not completely backwards-compatible, but I think they are more than the Python 2 to 3 switch. What is certain is that lots of other languages release new versions a few times a decade. See, for example, version histories of:

https://en.wikipedia.org/wiki/Java_version_history

https://en.wikipedia.org/wiki/C_Sharp_(programming_language)...

https://en.wikipedia.org/wiki/ANSI_C

Re:Current Proposals for C++17 by vmorgulis on Thursday February 25, 2016 @01:59PM (#11176806)
Stroustup is pushing a lot forward:

"C++ use is on the increase. We need to improve C++ to sustain the momentum, not better serve the C++ programmers, not out of fear of competition."

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n449...

Re:Current Proposals for C++17 by Rexxar on Thursday February 25, 2016 @02:23PM (#11177027)
I'm not a native English speaker and I'm no sure I understand this part correctly : "..., not better serve the C++ programmers, ...". Does it means that improving c++ is not done to help c++ programmers ?
Re:Current Proposals for C++17 by msbarnett on Thursday February 25, 2016 @02:28PM (#11177061)
As a native English speaker, it doesn't make sense (it's ungrammatical, in fact), and I'd assume it is probably a typo.

It was probably intended to be "..., to better serve the C++ programmers, ...". That would provide a contrast for the final "not" to be operating on.

Re:Current Proposals for C++17 by alexbock on Thursday February 25, 2016 @02:36PM (#11177132)
You're reading the sentence correctly, but I think it was a typo and was probably intended to say:

"We need to improve C++ to sustain the momentum and to better serve the C++ programmers, not out of fear of competition."

The accidental repetition of not is not an unusual mistake, and the original sentence doesn't match the tone of the previous paragraph given that he says "I deem something 'major' or 'minor' based on what it does for users"

Re:Current Proposals for C++17 by jjawssd on Thursday February 25, 2016 @02:27PM (#11177056)
I am a native english speaker and that quote makes absolutely no sense
Re:Current Proposals for C++17 by vmorgulis on Thursday February 25, 2016 @02:28PM (#11177072)
"... nor fear the competition"?
Re:Current Proposals for C++17 by meetingcpp on Thursday February 25, 2016 @03:09PM (#11177400)
um, nope, not going to happen...

C++ did that in the 2000's, in that time there wasn't much news about standardization, because of this C++ was seen as legacy, people moved to other languages. The new languages such as Rust, Go etc. are also a result of this.

The C++ committee has now a process of ongoing standardization established, which will improve the language further, and make it easier and more efficient to write C++. Also, the standards are usually backward compatible for at least 2 standards. What gets removed is often obscure features like auto_ptr, random_shuffle etc. which are superseeded by better alternatives. Clang modernize can even get your code base automatically updated to a new standard.

I know, that some of you are left behind, as you are stuck with the traditional "almost never update the toolchain" model, but clang and other tools are such a leap forward, that this is not a model for the future anymore.

So, C++ ecosystem evolves to become better, and make you as a programmer more productive and lets you write easier and safer code.

Re:Current Proposals for C++17 by hexagonc on Thursday February 25, 2016 @04:21PM (#11177884)
While I appreciate the effort to make things easier, as someone who is trying to move from C++98 to C++11, I'm not sure the new features make the language easier to use so long as you still have to learn the old ways of doing things. Speaking for myself, at least, this just causes interference between competing habits. What would be better for me and maybe others, would be if some of the unsafe or deprecated features in C++ were disallowed or if there were a compiler option to disallow them. I know this would break C89 compatibility but so what if you know you only care about the newer and more efficient features of C++?
Re:Current Proposals for C++17 by meetingcpp on Thursday February 25, 2016 @04:31PM (#11177974)
If you can, go for C++14 directly, it offers improvements over C++11.

Language features that ease your daily working with C++11/14:

- Lambdas, especially when working with <algorithm>

- ranged for loop

- auto instead of typing long types

- variadic templates increase compilation speed over the previous macro based simulation of this feature.

- the basic support for multithreading which std::thread & co offer.

And also, as always in C++: you only pay for what you use. You still can write code in old styles pretty well with C++14, same will be true for coming standards.

Re:Current Proposals for C++17 by mattkrause on Friday February 26, 2016 @12:46AM (#11179980)
Agreed. Auto looks like a useless bit of syntatic sugar, but it can make working with the standard library (and its impenetrable iterator classes) a whole lot simpler. On top of that, boost has some nice features that make easy-but-annoying tasks like walking a file system and parsing program options easy.

If your last exposure to C++ featured nothing but raw pointers, you should really give it a second look.

Re:Current Proposals for C++17 by GFK_of_xmaspast on Thursday February 25, 2016 @01:46PM (#11176665)
The last big change was c++11, and that was already five years ago.
Re:Current Proposals for C++17 by snuxoll on Thursday February 25, 2016 @02:14PM (#11176944)
Forgetting about C++14?
Re:Current Proposals for C++17 by msbarnett on Thursday February 25, 2016 @02:20PM (#11177002)
C++14 just cleaned up a couple of minor things from C++11. It was essentially intended to be a point release.

C++17 is the first "big" standard change since C++11. It will likely be followed by a small bug fix revision, analogous to C++14, a couple of years later.

Re:Current Proposals for C++17 by petra on Thursday February 25, 2016 @02:32PM (#11177102)
Wasn't a lot of memory safety and thread safety introduced in c++14?
Re:Current Proposals for C++17 by msbarnett on Thursday February 25, 2016 @02:42PM (#11177184)
C++11 introduced threading and a memory model for C++.

C++14 had relaxed requirements on constexpr, initializers in lambda captures, using auto for return type deductions, and a few other small tweaks.

Re:Current Proposals for C++17 by danbolt on Thursday February 25, 2016 @08:19PM (#11179237)
C++11 had unique_ptr and shared_ptr, but C++14 helped with adding make_unique. In my opinion, that makes a big difference because now making a special unique pointer is an atomic operation in your program.
Re:Current Proposals for C++17 by Kristine1975 on Friday February 26, 2016 @01:59AM (#11180177)
If only make_unique (and make_shared) worked with uniform initialization...

  struct Foo {
    int i;
    float f;
    bool b;

    // No constructor
  };

  std::make_unique<Foo>(1, 2.3f, true);
Doesn't compile, since make_unique requires an appropriate constructor (see https://isocpp.org/files/papers/n3588.txt for the rationale).

It also doesn't work when Foo's constructor is private, even when called from a function that would have access to this private constructor.

And this is my beef with C++: Yes it's powerful, and I quite like it, but you sooner or later hit these speed bumps that unnecessarily complicate things.

Re:Current Proposals for C++17 by GFK_of_xmaspast on Thursday February 25, 2016 @03:33PM (#11177571)
I don't consider c++14 to be a big change.