4 ms·
Has someone learned Scala and Go simultaneously ? This may seem a strange question - but I underwent this when I solved the Stripe CTF gitcoin challenge. I thin
by sandGorgon 13y ago
Has someone learned Scala and Go simultaneously ? This may seem a strange question - but I underwent this when I solved the Stripe CTF gitcoin challenge. I think that particular challenge was the most interesting because it branched into the leaderboard challenge.
I wrote the same code in Ruby-Celluloid, Python-subprocess, Scala-Akka and Go. When I did this, I came to an strange realization - I absolutely did not have fun writing Scala/Akka code as much as I did writing Go (minus the unused variable fascism).
Again, I'm not at all arguing the ecosystem of the JVM vs Go, but I just had a much better time grokking Go code than Scala/Akka - especially the package manager (pulling deps directly from github, etc.) I even sent in a patch for a go package ("gocmd" on github) barely a couple of hours after I first touched go for the first time in my life.
I dont have production worthy experience in either, so I dont have a strong opinion... but I really ended up wondering if Go makes Scala obsolete.
- namelezz 13y agoI was learning Scala and Go simultaneously. Hey, you forget to mention compiling time. Go is so fast that I just want to cry when I compile my Scala code.
- nutate 13y agoTrying to drink the scala kool aid here at work, but I had a similar situation with Go and a freelance job. Went from 0 real experience to working code in very little time w/ go. With scala I feel like I've spent more time waiting for it to compile than actually coding. Especially since we have been doing so much in Python, the switch back to compiled Java (with saccharine scala flavor) is like jumping back a decade in terms of productivity. Also, as you mentioned, the Go syntax is much easier to read, superficially just K&R C style with the types on the opposite side of the variable names.
- anentropic 13y agoOh good it's not just me... found it very annoying that the Go compiler complains of unused variables!
- sandGorgon 13y agoArent there people (like me) who will pay good money for a version of the Go compiler without that check ? Does anyone know if I can disable it in the source code somehow and build a Go compiler (I doubt it though - if Go was never built with things like deadcode optimization because of this enforcement)
- nutate 13y agoI found it a bit of a restriction, but ideally I'm not shipping code with unused variables, so why put them in. In the worst case I'd viciously comment things out, then uncomment them and add them back where I'd deleted once I figured out what the problem was.
- sandGorgon 13y agoIf you chart out a software project from "blank file" to "write one line - code review by 8 people before merge", then Go is suited to the latter. I find myself writing a lot of malleable code when I'm prototyping and Go is really getting my way. I dont dispute it is really useful (I worked for 6 years writing C, so I know about traps) but I really, really, really wish they would put a command line option to disable it.
- edwinnathaniel 13y agoMy IDE (IntelliJ or Eclipse) will remove unused variables when I save the file. Very very handy...
- anonymoushn 13y agoYou could build this by just removing the symbols that would trigger the check, either in a modified compiler or in a preprocessor. Go is pretty easy to parse so you should have an easy time of it. If you want your unused symbols, you could insert "_ = unusedSymbol" instead.
- krenoten 13y agoI learned both at roughly the same time, and have put both into large-scale production. I had been a user of mostly C, Python, and a little Erlang before with applications in back-end systems. I reached a decent degree of proficiency in Go in a couple days. Scala I think I will not be great at for a few more months. With Go, I could grok large codebases in a matter of minutes. With Scala, I'm often bewildered by advanced patterns employed by some wizards. I think Scala lets you code-masturbate a lot more, if that's your thing. So it's important to have a culture of KISS or the wizards among you may sacrifice understandability for having some fun. But the advanced constructs occasionally allow you to do things that would be pretty ugly in Go. The JVM has nicer tooling built around it, and you will probably need to rely on it from time to time. As a non-ide user, getting scala projects to compile with sbt can take longer than writing some small applications. Go services have a much smaller memory footprint out of the gate. I think I greatly prefer Go for simple services. But for projects that may require a lot more code and functionality, scala's abstractions may have a lot of value for you. I've needed to tune JVM GC settings a lot, and I haven't yet run into major GC issues with Go. I'm sure there are some gotchas, but I've yet to run into them.
- deleted 13y ago[deleted]
- bad_user 13y agoScala is a functional programming language. Go is even more impractical than Java for FP. Scala runs on the JVM, Go does not. Depending on your views on these matters, you may lean towards one or the other, but it's still apples versus oranges.