Live data from Hacker News

Scala: the Case for Correctness

arthur.gonigberg.com

1–10 of 63 posts

Re: Scala: the Case for Correctness

#2
Having jumped back into some green field work in Scala in the past few days, I will say I'm quite impressed with the improvements to the SBT, IntelliJ, universe. Compile time seems to be improved considerably (though the project is still quite small so time will certainly tell).

One problem, which is also one of the advantages of scala is that the interop with Java often means that all your Option[] etc code can still get NPEed by some offending Java Lib you've decided to use.

As the fidelity and ubiquity of pure scala libs improves this will hopefully go away to a some extend.

Re: Scala: the Case for Correctness

#3
Scala gets a lot of things right by default. Also it got a lot of flexibility and power. Almost "a framework" to write other languages within the language.

Use it every work day for over two years... Like a lot, but sometimes wishes it would be a bit simpler and more aesthetic.

Re: Scala: the Case for Correctness

#4

Having jumped back into some green field work in Scala in the past few days, I will say I'm quite impressed with the improvements to the SBT, IntelliJ, universe. Compile time seems to be improved considerably (though the project is still quite small so time will certainly tell). One problem, which is also one of the advantages of scala is that the interop with Java often means that all your Option[] etc code can stil…

[deleted]

Re: Scala: the Case for Correctness

#6

Having jumped back into some green field work in Scala in the past few days, I will say I'm quite impressed with the improvements to the SBT, IntelliJ, universe. Compile time seems to be improved considerably (though the project is still quite small so time will certainly tell). One problem, which is also one of the advantages of scala is that the interop with Java often means that all your Option[] etc code can stil…

You can always use Option() as in:

scala> Option(System.getProperty("kaboom"))

res1: Option[String] = None

then map, getOrElse or fold at will.

(edited format)

Re: Scala: the Case for Correctness

#7
Not mentioned here: pattern matching. It certainly goes a long way to ensure all cases are being handled, since the compiler lets you know when your patterns are non-exhaustive.

Re: Scala: the Case for Correctness

#8
post #7

Not mentioned here: pattern matching. It certainly goes a long way to ensure all cases are being handled, since the compiler lets you know when your patterns are non-exhaustive.

It is.

"Yes, you can write more concise code; yes, you have a more advanced type system; yes, you can pattern match. There are hundreds of other reasons that Scala makes a great language. When a language can offer me constructs to write more correct code, I'll always be willing to deal with the learning curve."

I think the point was that these are the things that he thinks are of more value to developers than the other good things that Scala offers.

Re: Scala: the Case for Correctness

#9
post #8
post #7

Not mentioned here: pattern matching. It certainly goes a long way to ensure all cases are being handled, since the compiler lets you know when your patterns are non-exhaustive.

It is. "Yes, you can write more concise code; yes, you have a more advanced type system; yes, you can pattern match. There are hundreds of other reasons that Scala makes a great language. When a language can offer me constructs to write more correct code, I'll always be willing to deal with the learning curve." I think the point was that these are the things that he thinks are of more value to developers than the oth…

Exhaustiveness checking on pattern matches is a big thing that helps with correctness though, so it seems like it should have been in his list.

Re: Scala: the Case for Correctness

#10
post #8
post #7

Not mentioned here: pattern matching. It certainly goes a long way to ensure all cases are being handled, since the compiler lets you know when your patterns are non-exhaustive.

It is. "Yes, you can write more concise code; yes, you have a more advanced type system; yes, you can pattern match. There are hundreds of other reasons that Scala makes a great language. When a language can offer me constructs to write more correct code, I'll always be willing to deal with the learning curve." I think the point was that these are the things that he thinks are of more value to developers than the oth…

I thought it was worth mentioning as a separate point; just saying "you can pattern match" doesn't say much, when it's actually a key feature to guarantee certain correctness in a program.

Pattern matching offers mainly correctness and conciseness, maybe the correctness part should have been emphasized more.

Post reply on HN