4 ms·
Agree with your premise. Disagree with your conclusion. What you've effectively called a bug is in fact a feature. The whole point is to take the proper-supe
by dxbydt 15y ago
Agree with your premise.
Disagree with your conclusion.
What you've effectively called a bug is in fact a feature.
The whole point is to take the proper-superset aspect of Scala ( ie. every java OO pgm will qualify as a scala pgm ), and then gradually migrate the OO parts to a functional paradigm over time. This allows you to retain giant Java codebases that are in production currently, while gradually moving away from Java by taking these baby steps.
One very practical example - there's a boatload of concurrent code in Java out in production. Unfortunately, threads are not in the average programmer's toolbox. Multithreading, mutexes, locks, schedulers etc used to be stuff that OS guys who wrote IPCs studied. Now all of that has unfortunately become part of the Application Programmer's toolset, simply because Java exposes the threading API & makes it insanely easy to create, suspend, group & destroy threads. So the application programmers go wild & create all manner of multi-threaded Java apps & when stuff gives inconsistent results ( same method accessed by multiple threads, no lock etc. ), they wonder why. With Scala, you can rewrite just those bits using the Actors framework & not worry about relatively low-level constructs like mutexes.
Here's a simple example:( http://bit.ly/kOczaj http://bit.ly/kOczaj )
- cageface 15y agoAgreed. Scala is a (relatively) messy language because it tries to solve the real-world problem of bringing working devs into the functional fold. Haskell was the laboratory, Scala is the factory.
- djhworld 15y agoOh yes, I definitely agree that Scala has a much better approach to threading with Actors and so on and there's definite improvement over Java with lamdas and functions as first class citizens. What I'm moaning about is, for me, I tend to like doing things "the right way" (i.e. The Scala Way) and it irritates me that there's nothing there to enforce you to do that. That isn't necessarily a problem with Scala per se, it's an issue with myself, but it's one of the reasons why I've stopped doing development in Scala for now and going down the Haskell route. Who knows, perhaps once I've got some decent Haskell behind my back, I might be able to transfer those ideas over to Scala and write Scala how I'd want to write it.