9 ms·
C++17 is a slight disappointment, I hope C++20 will be the real deal - concepts could really be a game changer and move semantics needs more fixes :/.
by cominous 9y ago
C++17 is a slight disappointment, I hope C++20 will be the real deal - concepts could really be a game changer and move semantics needs more fixes :/.
- pjmlp 9y agoIt still is pretty sweet for polyglot developers.
- VHRanger 9y agoHow so?
- cbsmith 9y agoThere aren't a lot of languages that combine functional programming/generics & OO together quite so extensively. There's a lot of power you can unlock there if you can just manage the cognitive load of the syntax.
- jordigh 9y agoI really like how D combines these two. The functional programming tools are a lot easier to use than C++ and a lot more practical than Haskell or OCaml. I absolutely adore the idea of purity in D: no side effects. That's all it should be, really. What this means is that it allows you to write pure functions in dirty, imperative ways as long as all the mutation is confined to the function and doesn't leak out. I really like it.
- pjmlp 9y agoD is a very nice language, just needs a better GC implementation and more community love.
- cbsmith 9y agoD is, in a lot of ways, C++ without the syntactical compatibility with C.
- jordigh 9y agoAbsolutely agreed. D is kind of the C++ I always wanted. It's familiar, I can see the C++ lineage, and it's so much nicer to write than C++. I'm currently having fun writing Advent of Code in D: http://inversethought.com/hg/aoc/file/tip/2017 http://inversethought.com/hg/aoc/file/tip/2017
- pjmlp 9y agoOn my case, C++ only gets used to do low level stuff as library to integrate into Java and .NET applications. So modules and concepts were nice to have, but C++17 is already a very good improvement to write such kind of libraries.
- mratzloff 9y agoIt's not as major of an update as previous releases, but there are a lot of little convenience features. String views, same-line nested namespaces, [[fallthrough]], if with init (I'm sure Google single-handedly got this included; it's very Go-reminiscent and really nice when not using exceptions), structured bindings, maybes with std::optional (occasionally useful), and even just something as simple as emplace returning a reference. What fixes do you think std::move needs, out of curiosity?
- cominous 9y agoIts not std::move, but the complexity coming with it. Its a hassle applying move semantics correctly and there is not the one goto solution for simple things. Im not aware of a proposal to change that issue, but at least there should be better defaults. This talk explains the pain quite well: https://www.youtube.com/watch?v=PNRju6_yn3o https://www.youtube.com/watch?v=PNRju6_yn3o
- repsilat 9y agoThe amount of prayer I have put into RVO and moves happening "right"... As someone who isn't a C++ programmer, is there anything better than looking at annotated asm? Templating everything and trying it with something that isn't copyable? (Actually, would that even work with RVO?)
- jcelerier 9y ago> As someone who isn't a C++ programmer, is there anything better than looking at annotated asm put a debug breakpoint in the move constructor and run your tests :p
- devinj 9y agostd::move should extend the lifetime of a temporary like static_cast does. (Or else not accept temporaries). Otherwise, no new features necessary. But that one bites sometimes.
- deleted 9y ago
- ashleyn 9y agoFor me, the parallelism TS is the Big F*ing Deal: http://www.bfilipek.com/2017/08/cpp17-details-parallel.html http://www.bfilipek.com/2017/08/cpp17-details-parallel.html
- greenhouse_gas 9y agoWhat are concepts? Is it like java/golang interfaces or rust traits?
- steveklabnik 9y agoIt’s sorta like traits but also different.
- jordigh 9y agoD has had concepts for quite a while. They call them template constraints: https://dlang.org/concepts.html https://dlang.org/concepts.html You should give D metaprogramming a try. It's a whole new world, a new fantastic point of view.
- maxxxxx 9y agoThat looks really interesting. Is this all done at compile time or runtime? After further reading the answer seems to be compile.
- ben-schaaf 9y agoDefinitely compile time. D has a somewhat similar feature called contracts (https://dlang.org/spec/contracts.html https://dlang.org/spec/contracts.html) which happen at runtime, but don't influence function/template resolution.
- systems 9y agoD is in a tough situation right now I think its good all around and balanced languages, but, there is always a better language for any use case, where D is an alternative Ocaml, if you want performance close to C/C++ plus and high level abstractions Rust, if you want manual memory managment C# and Java, if you want large ecosystems and advanced features Also C++ is now moving and improving fast Even Ada is sort of making a come back
- planteen 9y agoI'm curious about the Ada comeback - do you have any examples? I know it is still used in space & defense, but I thought those were legacy code bases.
- systems 9y agoWell, I would recommend you search for Spark, and check the website of AdaCore But, I would suggest that investing in Rust might be more valuable for one's career I am learning a bit of ADA, only for educational purposes and to scratch an itch, it is very different from anything I used, and I like that