Live data from Hacker News

Scala – 1 Star – Would Not Program Again

overwatering.org

221–230 of 324 posts

Re: Scala – 1 Star – Would Not Program Again

#221

I started learning Scala almost a year ago at my latest job - we use it for production systems at a large multinational investment bank. Coming to Scala from experience including C, Java and Haskell, I intially found Scala quite difficult. It is true that there are some things in Scala that are not obvious to newcomers, and that are difficult to discover for yourself - such as the use of Implicits, and the strange pr…

[deleted]

Re: Scala – 1 Star – Would Not Program Again

#222
post #2

I like Scala. It's a JVM language, it's extremely powerful, but maybe it's too powerful for us mere mortals. Eclipse allows very fast compilation times, but when I tried sbt, I gave up because I CAN'T wait for compilation: we're in 2013, I'm using a quad core at 3.4GHz, 12GB of RAM and SSD, so I'm not ready to wait. Eclipse allows fast incremental compilation. Scala's type system is very rich. I don't know if there e…

Rich type system? Can Scala express {x|x is integer, x >= 3} as a type? ATS can. We can even transform this set into unsigned types in C/C++, but in JVM there's no primitive simple way.

yes, it can. It ugly, because you're doing type level programming, but is possible http://apocalisp.wordpress.com/2010/06/08/type-level-program...

Re: Scala – 1 Star – Would Not Program Again

#223
post #187

Earlier quoted context omitted.

Scala reminds me of C++ too, but it's impressive that, in a mere 10 years, Scala has achieved all the multi-paradigm incoherence it took C++ 30 years and tortuous backwards compatibility constraints to attain. Actually, I spent some time over the weekend trying to get familiar with Scala by using it to solve some Project Euler problems, and it was pretty entertaining. Still, the language's bias towards there being mo…

Multi-paradigm incoherence? There is a huge difference between throwing multiple features/paradigms into one language (as C++ does) and integrating them so that they are orthogonal and don't get into your way (as Scala does). The integration part is the hardest thing and Scala designers did the great job there, assuming the constraints that were given. Scala does have some rough edges but they are not the kind of C++…

I'm not sure I'd remove any, but there is a huge incoherence in what is and is not "idiomatic" scala.

The most obvious example that comes to mind is whether you should use mix in traits or type classes for api design. Another one is the "magic-ness" of map/flatmap/filter for for comprehensions but no way to extend that for Functor/Monad/Monoid type classes.

Finally, the Scala community is a huge advocate of Algebraic Data Types yet don't support Disjoint types making any sufficiently complex system cumbersome to model as an ADT.

Re: Scala – 1 Star – Would Not Program Again

#224
post #41

To be honest with you, I use Scala as a better Java. Which means I still code imperatively (and use null instead of None) but with less noise (semi colons etc). But, esp when working with collections, I take advantage of Scala's features. It's not perfect, but it works wonderfully. I can always revisit/refactor my code again later.

Using null instead of None means you are more at risk of hitting a NPE. Here are a couple examples: myVar match { case Some(val) => doSomething(val) case None => handleNone() } myVar.getOrElse("else") In both of these cases, we eliminated the possibility of a NPE through the use of a language feature. :) (edited for formatting)

or myVar.map({ val => doSomething(val) }).getOrElse(handleNone())

Re: Scala – 1 Star – Would Not Program Again

#225
I feel you. I tried Scala out and after several days I just uninstalled everything from my computer which was related to Scala. The main reason is that it feels like some extremely baroque java without any sensible syntax. It looks like the C sytax but in fact it is not. Return types are sometimes explicit sometimes implicit. If you try to learn Scala you have to forget anything you know and learn the over-engineered ways of Scala. And in the end you don't get anything back which is not accessible in other languaes in a significantly easier way. You want functional style and easy concurrency? Go clojure. You want scalability for your webapp with 999999999 visitors per day? Go node. You want scientific calculations with good library support? Go python. You want a sensible type system and monads? Go Haskell. Scala just does not have much to offer in exchange for the terrible pile of contraptions it forces you to use.

Re: Scala – 1 Star – Would Not Program Again

#226
post #209

Earlier quoted context omitted.

Don't have an answer right this minute, but I think eschewing/forbidding variables in trait would prevent the most obvious such collisions. If you can't override variables, you can't silently change the structure to depend on trait order. You'd have to explicitly state order. PS. Of course if you have several same signature methods that call super, which is generated depending on order, same problem persist. So, forb…

If you can't call super nor use variables then this takes quite a lot of power from traits. IMHO being able to stack many traits one on another is a nice pattern.

Yeah, you trade power for easier testing and unforseen side-effects for determinism. IMO it's worth it.

Re: Scala – 1 Star – Would Not Program Again

#228

Earlier quoted context omitted.

We simply disagree on this. I would rather use almost anything else except the random DSL wasteland that is Scala. Even Ruby or Python (with the horrible GILs) is preferable. The groups I worked with made different determinations than your team, but if you guys love it, enjoy. Seriously, if you find a technology your whole team loves, you are KILLING it. Both companies I worked with have since dropped Scala (after li…

I would rather use almost anything else except the random DSL wasteland that is Scala In my experience very little Scala code uses DSLs. Learning Scala isn't that tricky for anyone who knows Java, which is a pretty big pool.

That was not my experience with Scala. Every library we used had its own DSL and that made the code really hard to read. Maybe things are different now, but I'll bet that was a lot of people's first experience with Scala. It's what turned me off to the language, even though I did like using the standard Scala library quite a bit.

Edit: It was two years ago so other than Lift and some SQL DSL I don't recall which libraries we were using. I do recall wishing I hadn't taken that job.

Re: Scala – 1 Star – Would Not Program Again

#229

I'd say a lot of the critiques are fair but quite exaggerated. I work on a large Scala codebase and yes, the compile times for a fresh start across the codebase are very long, but TDD-type loops are very short, because you're generally waiting for two files (your test target and your test code). Still, the compiler performance in Scala is perhaps my chief criticism, though hardly a show-stopper. As codebases in any l…

Once again, I will sing praises of C#. Some of the libraries are terrible, and it's Microsoft... but seriously, it fits the perfect happy medium between Java's clumsiness and Scala's everything-plus-the-kitchen-sink syntax.

Re: Scala – 1 Star – Would Not Program Again

#230

Earlier quoted context omitted.

That doesn't qualify as simple in my book though. Javascript has fewer concepts that programmers need to keep in their heads, but they are horribly inconsistent and quirky. Python, on the other hand, is consistently designed so that there are very few cases where you get hit with unexpected behavior.

Well, to be fair, most unexpected behaviour in js comes from people not knowing the language, or people expecting js to behave like other languages. I do agree though, that js does have its share of design quirks.

> most unexpected behaviour in js comes from people not knowing the language

Isn't this just a rationalization? Any unexpected behavior is by definition something the user didn't know to expect.

Post reply on HN