Live data from Hacker News

Why we love Scala at Coursera

tech.coursera.org

171–180 of 184 posts

Re: Why we love Scala at Coursera

#171

Earlier quoted context omitted.

Look at it the other way. In fact, you can do a blind test. Try writing in a strongly, (well[0]) dynamically-typed language for a while, and count the number of times your code fails at the REPL due to a type error. Each of those would likely have been a compile time error in a language like Haskell. Just earlier today, I was writing some C++ (I normally write Clojure) and I was bitten by this. I'm used to evaluating…

I tried Go after a few years of Ruby, and compile-time errors is what annoyed me the most. Bzzt that variable is defined but not in use, fail. Bzzt that function is defined but not used, fail. Bzzt that library is included but not used, fail. Felt like I was getting a rap across the knuckles with each failure as I was trying to learn Go. The try/fail/modify/repeat cycle of REPL-driven-development is what appeals to m…

Haskell will give you REPL-driven development and strong typechecking (an optional one in the last haskell compiler).

BTW, Go is not that strongly typed. It seems Google engineers don't like strongly typed languages.

Re: Why we love Scala at Coursera

#172
I've used them all: PHP, Ruby, Java, Scala, Node and Python. I'll stick to Python because the syntax is awesome and it's easy to read. Scala looks so weird to me. If I was really dependent on the JVM (which is indeed a great environment) I would honestly just stick to Java and enjoy the superior IDE support compared to scala.

Re: Why we love Scala at Coursera

#173

Earlier quoted context omitted.

>Simon Marlow, Haskell's lead compiler developer in recent years, quit, leaving arguably a much larger gap than @paulp leaving Tyepsafe Quit what? He is still a ghc developer. He quit his job at Microsoft Research to go work at Facebook, but that doesn't seem quite comparable to quitting a job working at the official scala company on the official scala compiler.

Marlow is _full-time_ at Facebook, bye bye. There's a difference between being a ghc developer and THE ghc developer. He's more of an advisor now than a committer, look at his ghc commit history, lots of comments, few commits. Not saying he's joined the dark side like Erik Meijer, but he's also not actively _working_ on the compiler as he did before; that's for the new guy(s).

>Marlow is _full-time_ at Facebook

And? Before that he was full time at Microsoft. He was never an employee of any sort of official ghc company working on ghc full time.

>Not saying he's joined the dark side like Erik Meijer

What dark side and what is wrong with Erik?

Re: Why we love Scala at Coursera

#174
post #165

Earlier quoted context omitted.

>Over the years I've worked pretty deeply with both static (C++/Java/Scala) and dynamic languages (Python/Ruby). I simply don't agree. How did you use scala? Did you write java code in scala as most people with a C++/C#/java background do? Because that would completely explain the rest of your post. In particular, this statement: >In my experience issues of type safety are rare I've been doing pretty exploratory, "re…

>How did you use scala? Did you write java code in scala as most people with a C++/C#/java background do? Because that would completely explain the rest of your post. Nope. My issue here is that types, once defined, rarely change in any significant fashion. Refactoring is (generally) an exercise in mutation of logic, not so much the underlying types. When types do change the code that operates on them drastically cha…

>My issue here is that types, once defined, rarely change in any significant fashion. Refactoring is (generally) an exercise in mutation of logic, not so much the underlying types. When types do change the code that operates on them drastically changes as well. We're no longer refactoring at that point, we're re-writing and then the issues more or less disappear.

That is the exact opposite of my current experience. I'm changing types constantly. As I flesh out more code, I realize I needed to pass an (Account, Client) not just a Client. Now the compiler tells me every single line in every single file where I need to fix the code to handle that.

>What? In Scala it is perfectly possible to pass an uninitialized reference to a piece of code

Because scala has to make bad concessions to java compatibility. Scala itself is fine, but java opens the door to problems. I did not say scala accomplished this, I said static type systems can. Use ocaml or haskell.

>Just as long as the count and the X co-ord are of different types. Which I'd guess isn't always the case.

But you control the types, that is the point. So if you choose not to use the type system, then obviously it protects you from very little. That is not a problem with the type system, it is a problem with you. You could write a program using only strings if you really hated yourself, and you would thus get absolutely no benefit from the type system. But nobody would be silly enough to blame the type system.

>My belief is that the class of errors they catch are among the most trivial, and most easily caught in testing (unit-testing or otherwise). Thus I simply don't see big gains in either runtime correctness or refactorability. Maybe slight ones, but nothing worth the loss of expression provided by more dynamic languages.

I do not believe your earlier claim to not have been writing java in scala now. If you think there is a "loss of expression", you do not have experience with a modern statically typed language.

>"Static type checking limits programs to only expressing things that the static type system can prove are OK

And if you have no idea how much you can express with the type system, then you draw bad conclusions from that.

Re: Why we love Scala at Coursera

#175
post #135

Earlier quoted context omitted.

Look at it the other way. In fact, you can do a blind test. Try writing in a strongly, (well[0]) statically-typed language for a while, and count the number of times your code fails to compile due to a type error. Each of those would likely have been a runtime error in a language like Python. Just earlier today, I had to write a short Python script (I normally write Go), and I was bitten by this. I'm used to the comp…

So yes, they would be runtime errors in Python. But that's not such a catastrophe, actually. The way I write Python is by being in an IPython shell, writing short functions, unit-testing them as I go. So the development-time cost of those runtime errors is not very high, and in my experience offset by the flexibility and interactiveness. Writing in a functional style without much mutable state is really the thing tha…

> The way I write Python is by being in an IPython shell, writing short functions, unit-testing them as I go.

One can write Scala the same way in a Scala shell.

Re: Why we love Scala at Coursera

#176

Earlier quoted context omitted.

I encountered them on a daily basis when I was doing Scala, and you see these Scala collections WTFs pretty much on every other line when you are prototyping in the REPL. I've come to the conclusion that the only way the Scala collections library will give me confidence is when my head can reason more than 100 types at the same time while having distinct types for every value in the universe. Scala's problems are rea…

It would actually be more convincing if it wouldn't sound exactly like the last dozen "I never used Scala, let's just point out some things I read on the internet about it" people. Why not just try Scala for a while, instead of making things up?

> I encountered them on a daily basis when I was doing Scala.

Your assumption that my criticism over Scala is because I hadn't tried it is as valid as my assumption of your disagreement with me is because you haven't tried hard enough.

I had tried Scala on multiple occasions since 2.8 came out. Every time for about 1 month to 5 months. It's impossible to explain how messed up Scala is without writing a whole book about it so I admit it's hard for me to convince you. God I miss SML and Haskell.

Maybe this guy can:

http://yz.mit.edu/wp/true-scala-complexity/

Re: Why we love Scala at Coursera

#177

Earlier quoted context omitted.

It would actually be more convincing if it wouldn't sound exactly like the last dozen "I never used Scala, let's just point out some things I read on the internet about it" people. Why not just try Scala for a while, instead of making things up?

> I encountered them on a daily basis when I was doing Scala. Your assumption that my criticism over Scala is because I hadn't tried it is as valid as my assumption of your disagreement with me is because you haven't tried hard enough. I had tried Scala on multiple occasions since 2.8 came out. Every time for about 1 month to 5 months. It's impossible to explain how messed up Scala is without writing a whole book abo…

So how would you solve his "issue"? (Assuming that you have understood his problem at all.)

Re: Why we love Scala at Coursera

#178

Earlier quoted context omitted.

JDK8 is a very nice release and I hope it will bring Java a few years ahead, but there are so many things still missing from Java that every time I shriek. From big things like no type class support to tiny things like 1 file per interface/class the Java experience continues to be frustrating in the extreme.

Which is why I said "Scala's tradeoffs" would become unacceptable. Java 8 is basically "close enough" to "The Good Parts" of Scala that most people probably won't be willing to tolerate all of Scala's warts.

> Java 8 is basically "close enough" to "The Good Parts" of Scala

Ehh ... not really. And I honestly don't see the gap between Java and Scala closing. It's widening at a frightening rate.

Java's warts are far worse than Scala's warts. So I'm not seeing why that should be a point either.

Re: Why we love Scala at Coursera

#179

Earlier quoted context omitted.

> I encountered them on a daily basis when I was doing Scala. Your assumption that my criticism over Scala is because I hadn't tried it is as valid as my assumption of your disagreement with me is because you haven't tried hard enough. I had tried Scala on multiple occasions since 2.8 came out. Every time for about 1 month to 5 months. It's impossible to explain how messed up Scala is without writing a whole book abo…

So how would you solve his "issue"? (Assuming that you have understood his problem at all.)

I wouldn't bother. I'd just go ahead and use 2 distinct APIs directly, and then after a while, I'll realize my code look more and more Javaish, and then I'll switch back to Java.

Re: Why we love Scala at Coursera

#180

Earlier quoted context omitted.

So how would you solve his "issue"? (Assuming that you have understood his problem at all.)

I wouldn't bother. I'd just go ahead and use 2 distinct APIs directly, and then after a while, I'll realize my code look more and more Javaish, and then I'll switch back to Java.

Ah, ok. So you haven't understood the problem, but wanted to say something. Great.
Post reply on HN