C++ was my next loved language after Turbo Pascal and I still like it.
Nowadays I use mostly JVM and .NET languages and after reading Meyers's latest book, and still following the standardization process, I have to agree with you.
On private projects I can control what gets used, but at company wide level, it is almost impossible to do so.
So one ends up with a gigantic C++ code base, many times just C with C++ compiler, with different meanings depending which ANSI version, compiler extensions and version are being used.
Considering most common companies don't follow code reviews or use static analysis tools, this just leads to quite some buggy code.
Scala allows you to do the same thing in many different ways, and with operator overloading ... the approach you chose to coding defines almost a 'custom syntax' for a project.
Which makes it very hard to read sometimes - you have to infer the 'style' before you can get too far.
To be fair - that's a different kind of 'inconvenience' than C++ from C - but the comparison is pragmatically valid.
The problem is that Scala seems to attract the same type of thinking as C++, where there is a culture that rewards obscure, bizarre syntax.
I mean, why is it an exclamation mark to send messages to actors in Akka?
I need to write code to get things done. I want to spend minimal time figuring out bizarre operator-overloaded library syntax.
Yes. But their cultures are a little different.
C++ I think is 1/2 academic, 1/2 Engineering - with a lot of voices, and a lot of anachronistic 'grey beards' arguing over stuff. Even for Java, James Gosling said 'Sun less less a company than it is a debating society'.
Scala is almost purely academic - but driven by a single person / small team. Scala was not designed to solve an Engineering problem, thus it seems a little 'intellectually masturbatory' (pardon the term).
Scala is way to hard to learn - partly because it's a 'new paradigm' but partly for the reasons aforementioned. So it's only going to make it's way into production for specific entities.
Scala may have a 'big future' if tutorials, training and approaches settle down on commonly accepted standards and practices.
But it's not going to go mainstream because the alternatives are far more accessible.
The examples you mentioned are relative small. You know what's big? Walmart. WellsFargo. Honeywell. Novartis.
I don't think 'it will be a while' before Scala gets into those shops, I think it will be 'never' unless there is a change to how Scala is presented. As of 2016, it's still a little academic and cliquish.
Though I predict some things will change and it might gain popularity.
> The examples you mentioned are relative small. You know what's big? Walmart. WellsFargo. Honeywell. Novartis.
https://www.lightbend.com/resources/case-studies-and-stories...
https://www.lightbend.com/resources/case-studies-and-stories...
https://medium.com/@kvnwbbr/transitioning-to-scala-d1818f25b...
Which is cool, and doesn't surprise me.
But I don't see the trend lines of Scala heading in the direction they need to be in such that it becomes and incumbent language.
I don't see it as having enough disruptive power to break into the Javascript/C/C++/Java or even C# club.
My own experience is with Scala is that there is just way, way to much 'change' for some added value.
I wish they could make some tweaks to Java to incorporate some elements of Functional programming and I would be happy.
And before you blow up, it's possible to mix both styles, obviously Scala itself is an example of that.
A specific example: a lot of FP comes along with how collections, lists, maps etc. are managed and used. Lodash/underscore provides a lot of that for JS and makes a lot of JS 'functional-like'. If Java had such libraries with the mechanisms to use them (first class functions - Lambda's are not quite that) - then Java would be a lot better. Anyhow - to get the 'good things' about FP I don't think you need an entirely new linguistic paradigm.
http://www.flotsam.nl/dispatch-periodic-table.html
When I was a teenager, it was fun to do that in C++ until I realized everybody thought it was fun but their version of fun wasn't compatible with my version of fun.
So being able to use this language as a system language, I very much look forward to.
But your mileage may vary.
I don't think it is possible to create a language that can prevent dumb code from being written.
Some languages may be slightly worse than others, but the root cause (and solution) is the same across the board.
For starters, there's not the syntactic ambiguity (or at least human uncertainty) found so often in C++.
There may be language complexity, e.g. how visibility interoperates can be difficult in weird cases. But I can at least parse it.
Rust? Go?
I used to choose C for pet projects (when I cared about performance) but I've been learning Rust for ~3 months now. I think I'll replace my usage of C by Rust from here on as much as I can.
I also had a brief affair writing Go but it didn't resonate nearly as well with my background as Rust does.
Since 2006, I only had one project where using C++ really mattered. A mix of Assembly and C++ was used for image codecs, which were just 5% of the whole application done in WPF.
On personal projects, I went back to it for portable code across Android and Windows Store, but now with Xamarin being part of Microsoft, I am using it for newer projects.
A certain skepticism is crucial for staying sane.
People who are still programming in C++ today do so either because they like it or because they have no choice.
Also banks.
As for the banks, the ones around where I live only care for Cobol, RPG, JEE and .NET.
I'm running into it as much as I can too, but it does look like a language we should replace with something simpler once we get an specification that works.
Examples, please.
(Patchy p, (~) ((* -> *) -> *) (ApplyState p) Tree) => Patchy (PatchInfoAnd rt p)About obscurity, how many GHC extensions were required to make it accept this code? (Is GADT enough?) And by the way, this is in the interface, while the C++ example is in the implementation.
Besides, that's Haskell code that happens in practice. This is one I've just looked at, if I did some research I would certainly come up with more egregious code (maybe even mine). This one probably isn't even problematic (it's hard to say from the interface), but in general, mixing those extensions does lead to some very interesting problems from time to time.
Haskell has the same excessive complexity problem that C++ suffers. I do think this is the right thing to do right now. But I can't imagine it not looking as dated in 4 decades as C++ is now.
instance (Patchy p, ApplyState p ~ Tree) => Patchy (PatchInfoAnd rt p)
I don't personally like typeclassitis, but this is actually easy to interpret:"If 'p' is a patch-like thing, and its ApplyState is a Tree, then 'PatchInfoAnd rt p' is a patch-like thing"
D has been catching my attention a lot though. I just wish it had something kind of like C++'s move semantics, to make implementing owned pointers (C++ unique_ptr, Rust Box, etc) possible. Maybe it does and I just haven't seen it used yet. The other problem I have with D is that most libraries seem to rely on the GC.
- http://dlang.org/phobos/std_typecons.html
- http://dlang.org/phobos/std_algorithm_mutation.html#.move
My personal worry with D is that the language changes a bit faster than, say, C++ or Rust. I don't know how whether the code I write today will still compile in five years. I wouldn't mind a feature freeze on the language design and the existing stdlib APIs.
Edit: Sorry, should say "main D architects" - there are many other people involved in developing D.
OK, don't use iostreams, or stringstreams perhaps, and use boost very sparingly.
But not at all?
Generally, however, I'm not really a fan the ‘generic programming’ paradigm the STL (and boost) are based around. In C++ it quickly leads to an explosion of complexity.
And as for the best part of C++, RAII and sparing use of templates. ;-)
C++ devs are a hardy breed :-)
The blog post has an excuse, I'm not sure the book does.
Most apps don't need this heartache.
But the language complexity gets more insane with every revision. It's now at the point where Scott Freakin' Meyers can't figure out the interpretation of a short little chunk of code.
I'm now actively looking for gigs in which I can develop high-performance code in a language _other than_ C++, just because it's such a minefield.
I don't follow the discussions of the standards committee carefully, but it seems like they must place almost no premium on keeping the language (and its programs) understandable by non-language-lawyers.