Live data from Hacker News

Choosing Scala

teaching.software-carpentry.org

61–65 of 65 posts

Re: Choosing Scala

#61
post #39
post #32

I don't come from a CS background, but I have been programming professionally many years and recently got started with Scala. I had tried Go before and I like Go. I also really like Scala. Scala requires much more work to learn than Go. I don't think I ever ventured out much from the offical Go documentation, the spec and effective Go and the library documentation to learn Go. With Scala I've already bought 3 books,…

Having worked with Scala for the past almost two years, I can tell you this: you're missing out by not using IntelliJ. It is a huge timesaver, not just from the code completion or the inspections, but also by being able to fire up FSC outside of IntelliJ and have your code recompile very, very quickly when you make changes. The one thing that IntelliJ doesn't do very well yet is work with sbt. It works, sure, but the…

I use sbt for the moment. I may figure out how to get sbt to autocompile with changes. Intellij, while a very good and powerful IDE, can't really replace vim for a vim user because vim users learn vim esoterics by infusing the commands into muscle memory.

Re: Choosing Scala

#62
post #54
post #32

I don't come from a CS background, but I have been programming professionally many years and recently got started with Scala. I had tried Go before and I like Go. I also really like Scala. Scala requires much more work to learn than Go. I don't think I ever ventured out much from the offical Go documentation, the spec and effective Go and the library documentation to learn Go. With Scala I've already bought 3 books,…

Did you know Java before? I can understand not being able to use Scalaz (heck, after three years of scala there are parts of Scalaz I wouldn't go to yet), or read other people's scala code, but my experience is that you can start writing scala to do useful things in two minutes, because you can write java (or C#) and it will work. (Advice for understanding scalaz: look at the type signatures. Try and implement a func…

I knew a little Java, mostly from working with Android. I didn't feel like I was able to do anything within minutes. The very first thing I tried to do though was parse JSON and getting a JSON library working with sbt took about 2 days working part time.

Re: Choosing Scala

#64
post #62
post #54

Earlier quoted context omitted.

Did you know Java before? I can understand not being able to use Scalaz (heck, after three years of scala there are parts of Scalaz I wouldn't go to yet), or read other people's scala code, but my experience is that you can start writing scala to do useful things in two minutes, because you can write java (or C#) and it will work. (Advice for understanding scalaz: look at the type signatures. Try and implement a func…

I knew a little Java, mostly from working with Android. I didn't feel like I was able to do anything within minutes. The very first thing I tried to do though was parse JSON and getting a JSON library working with sbt took about 2 days working part time.

Oh, it was the build system rather than the language or library? I wouldn't've used SBT (still don't). maven handles scala fine.

Re: Choosing Scala

#65
post #53

Earlier quoted context omitted.

The example is merely illustration and not the recommended practice for writing C++! (Can you imagine?) I only meant to illustrate that even in C++ where types have a different meaning I will get a warning with a decent compiler. In either case the expression in both languages garners a silly result. However Scala is happy with the result and reports nothing wrong with it (not even a warning). I was just surprised is…

How is the result in Scala/Java silly? I'd say it's perfectly intuitive to most people that you can concatenate non-strings to strings using that syntax, via an implicit conversion of the non-string operand. You could do the same thing in C++ with operator overloading, and the unnecessary difficulty of building strings in C++ is probably one of the pet peeves of most people, and certainly something hard to explain to…

First off there's nothing intuitive about programming, PLs, or PLT. And certainly nothing perfect about anything related to computers at all.

    "5" + 5
Which is the sillier result: 10, "10", or "55"? All of them are equally valid based on what system of assumptions and implicit evaluation rules you decide are in effect when interpreting this expression. There are some languages that will output 10. Java/Scala will obviously choose the latter result. Neither of them are wrong.

What I think is silly is that, to my knowledge, Scala won't warn you that the result of interpreting this expression is ambiguous and their chosen implementation might not be what you had expected.

A decent C++ compiler will warn you (by default) that adding arrays of bytes to integers doesn't make sense and you are probably making a mistake somewhere. A lesser one will let you opt-in to receive warnings. A poor, silly compiler will just compile it without warning and let you figure out its strange result on your own.

Post reply on HN