6 ms·
C++ Status at the end of 2015
- Aleman360 11y agoCan't wait for modules. Header files are the worst. Also really excited for co-routines. I never liked using promises. Wow, had no idea ranges and contracts are on the table too. With all this stuff, C# is really losing its appeal.
- rhodysurf 11y agoYeah I want modules and contracts badly
- edwinnathaniel 11y agoTo me it has always been the tooling and its ecosystems around the language that matters, not some of these advanced features... So C# might lose its appeal to you specifically but not to many people ;)
- Aleman360 11y agoTrue, C# tooling is an order of magnitude better. Still hate IDisposable and events using strong references.
- joebaf 11y agoLots of important stuff is being discussed/voted/cleaned up... hope modules, ranges and contracts will meet the deadlines to be in cpp17
- _yosefk 11y agoC# is memory-safe by default. C++ will forever let you (and your coworkers, and library code you use/misuse) access memory outside array bounds and dereference pointers to already-freed objects. This extends to C++'s advanced features (such as objects captured by reference in anonymous functions.) This is a big benefit of C# (and every other remotely popular language except C and C++; how C compares to C++ is a separate question.) Arguably, some systems cannot afford a garbage-collected language, but your comment kinda assumes you can choose between C# and C++.
- Aleman360 11y agoI work on UI for universal Windows apps where the choice is C#, C++, or JavaScript. Modern C++ is pretty nice if your team is ready to embrace it and leave old styles behind. I still use C# for utilities and prototypes but for production stuff, users' time is more valuable than mine.
- pcwalton 11y agoThis comment fails to address the main point yosefk was making: that C++ is not memory safe, and C# is. In fact, it completely ignores the point in presupposing that C++ is for "production stuff" and C# is for "utilities and prototypes", when the point of memory safety is to make your code not fail in production.
- Aleman360 11y agoEmbracing Modern C++ (RAII, STL, range-based for loops) helps you avoid a big chunk of memory safety problems. Contracts and some of the stuff in the new Core guidelines take it further. Everyone's needs are different obviously. The stuff I work on has tons of users and start up perf and minimal memory usage are primary requirements. Most of our bugs are nullptr access violations or straight up programming errors that C# doesn't shield you from either.
- pcwalton 11y ago> Embracing Modern C++ (RAII, STL, range-based for loops) helps you avoid a big chunk of memory safety problems. Not really. RAII still allows for dangling pointers/references. The STL is vulnerable to iterator invalidation. Ranges are likewise vulnerable. > Contracts and some of the stuff in the new Core guidelines take it further. How do contracts help memory safety? The ISO Core C++ bounds/lifetime checker does, yes, but as I mentioned in the other comment I don't know whether it is still going to be C++ in practice. > The stuff I work on has tons of users and start up perf and minimal memory usage are primary requirements. Those are valid reasons to use C++, yes. > Most of our bugs are nullptr access violations or straight up programming errors that C# doesn't shield you from either. C# doesn't make null dereference undefined behavior :)
- santaclaus 11y agoIt's not a language feature, but a defacto standard package manager would be a huge boon for C++ development.
- McP 11y agoAgreed. biicode (https://www.biicode.com/ https://www.biicode.com/) might have potential.
- StephanTLavavej 11y ago> Atomics in signal handlers - N2547 - its listed as missing here (at msdn), but listed as done here at vc blog That was me being cautious, see http://blogs.msdn.com/b/vcblog/archive/2015/04/29/c-11-14-17-features-in-vs-2015-rc.aspx http://blogs.msdn.com/b/vcblog/archive/2015/04/29/c-11-14-17... - "I previously listed "Atomics in signal handlers" as No, because despite maintaining <atomic>'s implementation, I didn't know anything about signal handlers. James McNellis, our CRT maintainer, looked into this and determined that it has always worked, going back to our original implementation of <atomic> in 2012."
- joebaf 11y agoGood catch, thanks!
- biaxident 11y agoWhat's the best way to learn C++ nowadays?
- svaha1728 11y agoThat's a difficult question to answer without knowing your current skillset. I'd definitely recommend CPPCast (http://cppcast.com/ http://cppcast.com/) for learning about the C++ community. Pluralsight has some decent videos as well.
- jgh 11y agoClicked the link going "Please don't be a website that looks like a C++ dev made it". It's a website that looks like a C++ dev made it.
- nrjames 11y agoI found that diving into openFrameworks (looking at their examples, etc...) and hacking my own stuff was a great way to learn. Cinder would do the same.
- copperx 11y agoI would argue that reading A Tour of C++ would make you ready to write a modern C++ program, if you are a programmer and are comfortable with pointers.
- AlexeyBrin 11y agoI read "A Tour of C++" and I found the book terse and the information too condensed. I honestly doubt that a programmer that doesn't know C++ could learn C++ from this book.
- MattHarrington 11y agoRecommended resources for learning C++ nowadays: "Jumping into C++" by Alex Allain, "C++ Primer Plus" by Stephen Prata, and Kate Gregory's C++ courses on Pluralsight. You can get a free 3 or 6 month Pluralsight subscription by signing up for Microsoft's free Dev Essentials program.
- BudVVeezer 11y agoThe author may be a bit confused as to what C++17 will be. Modules will be in a TS, most likely. Transactional memory, concepts, ranges, and filesystem are already in published TSes (not planned for the IS in this round). Out of the list presented, only fold expressions and __has_include are actually already voted in for C++17 itself. The rest are in various stages of standardization (mostly TSes) and are not guaranteed to ever become part of the IS (though hopefully many will).
- StephanTLavavej 11y agoThat's incorrect - the Ranges TS was just started, and certainly hasn't been published yet (not even as a PDTS). Filesystem was the first published TS.
- BudVVeezer 11y agoAh, that's right, ranges was a new work item planned for TS (but still not planned for IS in C++17).
- kabdib 11y agoC++17: > Single-quotation-mark as a digit separator I have to admit to utter befuddlement about why you would ever want that. (Presumably they will also require scanf to honor this as well . . . that'll be fun). Just when I thought the C++ committees were getting their heads screwed on straight. Am I missing something, or is this another trigraph disaster?
- theseoafs 11y agoWhat number is this? 100000000000000
- gamegoblin 11y agoI actually really like the Java way of doing this: 100_000_000_000_000
- JoachimSchipper 11y agoThat works, but even in C I'd simply write this as (100 * 1000 * 1000 * 1000 * 1000), which is perfectly clear and no slower. (Or, rather, as ((uint64_t)100 * 1000 * 1000 * 1000 * 1000), but you'll need to do something to prevent overflow in most languages, anyway.)
- tzs 11y agoThat also works in Perl, Ruby, C#, ADA, D, and Julia. According to Wikipedia [1] underscore was proposed for C++ but rejected because it conflicts with user-defined literals. Is there any reason they could not have used space? Offhand, I can't think of anyplace where a space in a literal number would not currently be illegal, so adding that as a separator should not introduce any problems, but C++ has grown massively in complexity since I last seriously used it so I could easily have overlooked something. [1] https://en.m.wikipedia.org/wiki/Integer_literal#Digit_separators https://en.m.wikipedia.org/wiki/Integer_literal#Digit_separa...
- pklausler 11y ago
- bsaul 11y agoC++ has changed so much i barely recognize anything ( i used to code in c++ a bit like c with classes). Which makes me wonder : do we have any idea on the market share 20xx c++ versions represent ? I mean, how much c++ code produced today is "modern c++" ?
- nulltype 11y agoMy favorite quote from the C++17 specs (https://isocpp.org/files/papers/D4492.pdf https://isocpp.org/files/papers/D4492.pdf): """ The note was written for committee members, but “escaped into the wild.” Here are a few comments from the web: • http://www.reddit.com/r/programming/comments/33us7z/what_will_c17_be_bjarne_stroustr http://www.reddit.com/r/programming/comments/33us7z/what_wil... up_on_c17_goals/ • http://forums.theregister.co.uk/forum/1/2015/04/27/c_daddy_bjarne_stroustrup_outlines_dir http://forums.theregister.co.uk/forum/1/2015/04/27/c_daddy_b... ections_for_v17/#c_2500733 • https://news.ycombinator.com/item?id=9441245 https://news.ycombinator.com/item?id=9441245 As you see, people outside the committee also have strong opinions. Those opinions can depart radically from the ones I hear in the committee and from reality. """
- pkd 11y agoThis is an honest question. In what areas of the industry does C++ dominate the language landscape except hardware drives? I used to think this was true for games but I've seen most studios move to C# as the community has matured around it. All other major spaces seem like they've moved on to more managed languages.
- Aleman360 11y agoAAA games, embedded, operating systems (err, Windows shell at least), web servers, core libraries, etc. Still big in medical devices too, embedded or not.
- MattHarrington 11y agoQuantitative finance, scientific computing.