Live data from Hacker News

Scala vs Go

quora.com

81–90 of 109 posts

Re: Scala vs Go

#81
post #53

You can find a similar comparison here: http://jimplush.com/talk/2015/12/19/moving-a-team-from-scala...

Basically replace "Go" in that article with "Java 8". Java 8 makes for a much stronger argument for their situation considering they wouldn't have needed to rewrite any of the Scala code.

The author of the article almost admits it multiple times. With really only one point:

One of the other benefits of Go was widening the pool of backgrounds we can hire. We can take someone from any language background and have them ramped up on Go in weeks. With the Scala side there’s the JVM learning curve, the Java world of containers, black magic of JVM tuning, profiling tools, etc…

Do new developers really need to know about the JVM and tuning? Hell I'm not even an expert with JVM tuning. You can go pretty far with the defaults.... Containers... nobody uses containers anymore. Profiling, debugging, monitoring tools.. ahhh the JVM has the best. You need to profile code regardless of language.

That is like saying Go lang developers really need to know about C and calling channels black magic.

I don't know of a wider pool than Java.

Re: Scala vs Go

#82

> Scala code can be very dense and hard to grok at the early stages of learning. This seems to be the crux of his argument, and I think it's a rather poor one. I have used both Go & Scala professionally. Yes, it took less time for me to start writing real code in Go. However, I found Go's "simplicity" to be limiting and frustrating when it came to building production applications. Things like the weird split between…

Can't help but quote [1]:

«"Generics are not free." Creating a modern statically typed language WITHOUT generics isn't free either. Just like implicit interfaces are not free, just like the reflect package is not free, just like using interface{} somewhere isn't free, just like telling people to use code generators isn't free.»

[1]: https://news.ycombinator.com/item?id=13358631

Re: Scala vs Go

#83
post #65

Earlier quoted context omitted.

Java was a way For Sun to sell more servers so they pushed it as application server technology.

But do you know who designed the server tech? Was it old mainframe people?

For what it's worth, the initial EJB spec was written by IBM, so I guess the answer to your question could be yes.

"The EJB specification was originally developed in 1997 by IBM and later adopted by Sun Microsystems"

https://en.wikipedia.org/wiki/Enterprise_JavaBeans

Re: Scala vs Go

#84
post #70

Earlier quoted context omitted.

I've been playing around with OCaml a fair bit in my spare time too. I've been using Go at work full time for about 4 years so that's my main comparison. I love OCaml as a language but the ecosystem is really pretty bad. There is just too much fragmentation and lack of libraries. I would have expected more from a language that is over 20 years old. Don't get me wrong, I want it to succeed since I agree it has a reall…

If you're looking for OCaml with a better ecosystem, take a look at F#. It's basically OCaml on .NET.

Yes, I agree. It seems almost perfect apart from the fact that non windows support is still lacking.

Re: Scala vs Go

#85

Would be interesting to get a gauge on how many bugs are typical in code in each language. From what I've heard Go code features a comparable number of bugs to Python per line of code. But far more lines of code. I don't know how that compares to Scala but would be very interested to know.

Complete tangent, but I must say that since I recently started using pycharm it has really caught most of the obvious typo and uninitialized bugs and my python code is really crashing surprisingly rarely as I prototype to death. Just saying in case there are others who haven't been trying modern python tooling and don't know that you can get real close to a compiled language type safety certainty these days before yo…

Speaking of tangents... I use pycharm too. Do you ever use type annotations in Python? I'm really digging it in Typescript for Javascript.

Re: Scala vs Go

#86
post #43

> Scala code can be very dense and hard to grok at the early stages of learning. This seems to be the crux of his argument, and I think it's a rather poor one. I have used both Go & Scala professionally. Yes, it took less time for me to start writing real code in Go. However, I found Go's "simplicity" to be limiting and frustrating when it came to building production applications. Things like the weird split between…

It also confuses ease of reading with density of meaning. It presents the simplistic idea that the less dense statement is always the easiest to read, which might be true in isolation but it's almost always false in the larger context. It's pretty easy to prove this, simply ask yourself, would you rather read a quicksort implementation in C or assembly? C is certainly more dense in meaning, but it's also much easier…

It also confuses ease of reading with density of meaning. It presents the simplistic idea that the less dense statement is always the easiest to read, which might be true in isolation but it's almost always false in the larger context.

This is my experience with Go in a nutshell. You start out pleased by how easy it is to read the code. You end up frustrated by how much damn code you have to wade through to understand a relatively simple system.

Perhaps the fantasy is that Go forces programmers to write simple, elegant systems. In reality, of course, the effect is much smaller than hoped. Go is much easier to get right than C, so programmers have no fear of writing vast reams of code. This is not such a problem for the original author, whose understanding of the system precedes the implementation, but anyone else reading the code has to refine meaning from very meager ore.

Re: Scala vs Go

#87

Earlier quoted context omitted.

>Things like the weird split between functions returning errors but occasionally panicking, lack of inheritance, and poor dependency management through github links make Go a poor choice for applications within a business setting. FWIW I've been using Go since 0.8 and this stuff isn't really an issue for me. 1. Panics should not cross package boundaries unless they are meant to be fatal! 2. "lack of inheritance": 90%…

> For all my non-trival projects I always fork all my dependencies into their own repos That sounds absolutely terrible. Even worse than having to track down & install libraries and headers for C projects. At least in the case of those libraries, you can enforce a particular version using autoconf or whatever. Vendoring source code for dependencies (especially in separate repos) is fragile and a pain for anyone else…

How so? The project just includes a script that git clones the forks into your Go workspace for the project /foobar/src....

Re: Scala vs Go

#89
post #43

Earlier quoted context omitted.

It also confuses ease of reading with density of meaning. It presents the simplistic idea that the less dense statement is always the easiest to read, which might be true in isolation but it's almost always false in the larger context. It's pretty easy to prove this, simply ask yourself, would you rather read a quicksort implementation in C or assembly? C is certainly more dense in meaning, but it's also much easier…

>It also confuses ease of reading with density of meaning He says more about that later and I find that part more interesting: "Go code is explicit and the Scala code requires context to understand." I believe he is saying that in order to understand a particular Scala expression you need more information from outside the immediate local context than in Go, i.e. information only available in type definitions. I haven…

Just to muddy the waters a bit, you also need to add in familiarity with standard libraries and conventions. To use an example that hopefully a sufficiently large chunk of the readership is at least passingly familiar with, if you're familiar with the Java Spring framework and its conventions then understanding an annotated piece of code is usually fairly trivial. Without that understanding however it's going to be utterly confusing as none of the code would seem to bear any relation to the rest.

Programming is in many ways the act of artfully layering abstractions to concisely express a complicated concept. If you are unfamiliar with, or do not understand some of those abstractions you're obviously not going to fully understand the concept being expressed.

Part of the advantage to a strong type system is that you only need to learn a particular abstraction once. Once you learn how a particular type (or set of inter-related types) functions, anytime you see that type used from then on you immediately understand something about the system its being used in. This is in contrast to a weakly typed system where the only thing you know for sure is how the author encoded his expectation of the system at a given point (this is important, you don't know what the author intended just from the code as the author could have made a mistake). In a weakly typed system it's left as an exercise for the reader to try to divine the expected behavior from clues left in the code. This is of course not even touching on the case when the runtime behavior deviates from the expected behavior in often quite significant fashion.

Looked at from another perspective, strongly typed languages promote modularity and re-use of concepts, while weakly typed ones tend to favor explicit and single use concepts. That is, the abstractions in the strongly typed system are implicit, but often re-used across many code bases, while the abstractions in the weakly typed language will tend to be explicit and either re-used less often, or else customized for a particular use case to the extent that it's unsafe to make assumptions about the expected behavior of the abstraction.

Re: Scala vs Go

#90
post #79

Earlier quoted context omitted.

I believe Google actually did some research that concluded something to this effect, and it was a big part of why they started pushing Go internally. Whether or not that's the right conclusion based on that data is debatable... I'd argue not.

Why not? It seems reasonable to me that as the number of people working on some piece of code grows the average skill will settle around "not an expert", whatever that means.

I'd tend to expect the same (and agree that "not an expert" is vague), but I'm actually a bit more curious about the proposal that it's a normal distribution. Why would it be? If I had to guess, I might go for something downward-skewed, or maybe even some kind of typically bimodal thing.
Post reply on HN