Live data from Hacker News

Why we love Scala at Coursera

tech.coursera.org

71–80 of 184 posts

Re: Why we love Scala at Coursera

#71
post #61

"Refactoring a statically typed language is easier than refactoring an interpreted one; modifying existing PHP, and even Python, is a difficult chore that engineers shy away from because modifications are likely to create more bugs than they fix." Over the years I've worked pretty deeply with both static (C++/Java/Scala) and dynamic languages (Python/Ruby). I simply don't agree. The biggest thing that contributes to…

Not to start a needless back and forth, but I've worked in both static and dynamic languages on projects large and small as well. I do believe that unit tests are the biggest improvement by a long stretch for re-factorability, but a good type system simply eliminates whole swaths of error cases, and modern systems don't require a lot of overhead either.

Another advantage for some strongly typed languages are the complex, yet safe refactorings they enable automatically by a good IDE. This is not universal though, and is a serious downside to picking Scala over Java.

Re: Why we love Scala at Coursera

#72

The quote about refactoring ease in Scala is interesting, since I imagine the experience would be the same in plain old Java - refactoring in any statically typed language is much easier when you are comparing to PHP, Python and Javascript.

In fact it is a little dishonest. Refactoring in Scala is considerably worse than refactoring in Java due to the complexity of the language.

Re: Why we love Scala at Coursera

#73
post #18

Earlier quoted context omitted.

Please don't miss the larger point of this talk (and others by the same speaker); programming languages in general are not what they should be according to this speaker. If anything, though, he seems to agree that Scala is a good choice compared to the plausible alternatives: "At the very least, I can endorse Scala relative to the set of existing alternatives pretty strongly." "I judge things compared to what could b…

Actually Haskell is quite nice and does a better job. Practical too.

I'm curious, what languages do you consider impractical?

Re: Why we love Scala at Coursera

#74
post #61

"Refactoring a statically typed language is easier than refactoring an interpreted one; modifying existing PHP, and even Python, is a difficult chore that engineers shy away from because modifications are likely to create more bugs than they fix." Over the years I've worked pretty deeply with both static (C++/Java/Scala) and dynamic languages (Python/Ruby). I simply don't agree. The biggest thing that contributes to…

Am I missing a big problem with dynamic typing? Wouldn't clearly defined naming conventions solve part of the problem?

Re: Why we love Scala at Coursera

#75
post #61

"Refactoring a statically typed language is easier than refactoring an interpreted one; modifying existing PHP, and even Python, is a difficult chore that engineers shy away from because modifications are likely to create more bugs than they fix." Over the years I've worked pretty deeply with both static (C++/Java/Scala) and dynamic languages (Python/Ruby). I simply don't agree. The biggest thing that contributes to…

Type safety dramatically reduces the number of unit tests required. Since unit tests often depend on the structure of code, that reduces the amount of rewritten and modified test code and the stability of the tests over refactors, which in turn must make refactoring easier.

Re: Why we love Scala at Coursera

#76
post #45

From an experience standpoint, isn't the fact that you'd have to teach people a new language coming in the door detrimental to the use of that language? Comparing a company that takes in people that have been coding Ruby/Python/Java/whatever for 5+ years, versus one that takes in people that don't have Scala experience but teaches them on the job, wouldn't the former move faster and generally have more experience, ma…

Think about it like this: If you switched to a Dvorak keyboard and suddenly were typing 90% faster, jumping over to a co-worker's machine with a QWERTY keyboard doesn't suddenly render you ineffective.

It might take a moment to switch gears, but it's all there.

Re: Why we love Scala at Coursera

#77

Earlier quoted context omitted.

> The biggest thing that contributes to refactorability has nothing to do with type safety. Instead unit test coverage, by a mile, is the thing that makes code easy to refactor Type Safety is Unit Test Coverage. Typing is a statically checked test of correctness of your program. Languages like C give static typing a bad name. Types are not things like 'float', 'int', 'double'. Types are 'degrees', or 'radians'. Types…

> usually work correctly after they compile I still don't buy in to this trope. Q: What is true of every single bug in production? A: It passed both your type checker and your tests.

That's a tautology. By that reasoning, don't bother writing any tests, because all your bugs in production will get past them anyway!

My bugs got past my type-checker, but only 100 of them. You have 1000 because the 900 my type checker caught, your dynamic language didn't. Then you go and write unit tests for them, and spend a day writing code that my compiler generated automatically for me.

Re: Why we love Scala at Coursera

#78

The quote about refactoring ease in Scala is interesting, since I imagine the experience would be the same in plain old Java - refactoring in any statically typed language is much easier when you are comparing to PHP, Python and Javascript.

In fact it is a little dishonest. Refactoring in Scala is considerably worse than refactoring in Java due to the complexity of the language.

True, I'm curious what (if any) IDE the quote-author is using for refactoring. Or perhaps they are just referring to the simplicity of something like being able to rename/edit a method signature and have the compiler catch all the references to the old name immediately.

Re: Why we love Scala at Coursera

#79
post #7

All of the praise here for scala can be applied, verbatim, to Java itself. Some of the concerns are no different than Java (UTF-8), or are actually not a problem there (intellij IDE vs eclipse). While the comparison to dynamic languages is valid, this is a rather shallow discussion of scala itself.

"Combining for-comprehensions with composable futures makes asynchronous concurrency look like straightforward synchronous code." I would really enjoy seeing this in Java.

I'd like to see the Scala code too. I've played with both and in the end, both codes are pretty complex, just complex in different ways.

It's a complex problem with a lot of edge cases and tricky error cases that need to be handled properly, which is where the elegance of the language or the programming paradigm usually goes down the drain.

I'd like to see a fully functional snippet of code that gracefully handles errors in both languages.

Re: Why we love Scala at Coursera

#80

My favorite quote from the article: "Python probably takes the cake for being regular. PHP gets cake in the face… Scala is somewhere in-between."

If you have complete control over your programmatic infrastructure and you are getting PHP 'cake in the face' you shouldn't blame PHP. You're just a shitty programmer.
Post reply on HN