5 ms·
I switched to clojure for a new job from doing scala for 5 years. I just feel a weight has been lifted off of my head. Weight of syntax, slow compilation, weigh
by dominotw 7y ago
I switched to clojure for a new job from doing scala for 5 years. I just feel a weight has been lifted off of my head. Weight of syntax, slow compilation, weight of implicits ( some of them are so bad even editors like idea couldn't figure out what is going on). And most importantly the weight of the constant feeling of not being able to fully understand the meaning of endless math terms thrown at me casually like monads, freemonads, applicatives , categories, Kleisli ect.
I spent so much time learning what all these math concepts apply in programming but now I don't remember what any of these mean anymore and I am still shipping production applications ( in clojure). Sigh, what a waste of my life doing scala :( .
- leetrout 7y agoThis touches on a difference between the Go and Scala communities and courses from my very brief experience learning scala for work the past couple months. The older I get the more I want things that are explicit and easy to understand. Tons of sites and videos and blogs exist that break down the features of Go without a ton of math lingo. I never see Scala materials free of that. Even when I agree that I need to understand the terms of art I haven’t been in a math class in 16 years and it’s slow going. With Go I was productive in two days and proficient in less than two weeks. Yes I still shoot myself in the foot with channels and race conditions when I’m rushing but at least it’s a super fast compile cycle to iterate and my IDE doesn’t require over 2gb ram like scala / idea does.
- yahyaheee 7y agoYup being easy to understand without lacking functionality is definitely superior to supporting every insane programming concept. It builds stronger communities and better software
- jkachmar 7y agoBig ol’ “Citation Needed” on this one. The flip-side here is that a language that doesn’t support basic programming language theory concepts dooms its users to repeat the mistakes of those who discovered them. I also would personally disagree that any statically types language without generic types and without non-nullability (e.g. `Option`/`Maybe` and `Result`/`Either`) is severely lacking in the ability to express programs that are easy to understand.
- yahyaheee 7y agoproof is in the pudding on that one, sorry don't think there are academics studying this but it's an obvious outcome from the war that was Go/Scala/Node. Go is eating Scalas lunch because its easy to understand and communities are stronger than individuals. Sure Scala has more 'features' but Rob Pike would say every feature has a cost and you need to weigh that, didn't see that ever happen in Scala. Go is taking the time to get each piece right and I'm glad for it.
- MiroF 7y agoAdoption isn't everything and google has incredible marketing sway. Tensorflow almost won the ML framework wars despite being clearly outclassed by Torch and it took until recently for Torch to overcome the Google brand name
- yahyaheee 7y agoMarketing and they understand how to build communities, this is actually the most important thing. TF isn't a great product so thats showing through now, Go and K8s are and you don't see the backtick there.
- jkachmar 7y agoAnother commenter points out that Go has Google backing it, which is a significant confounding factor in terms of figuring out how good it is on its own merits. I’ll add to this and say that Go is a language that is very well-suited for Google’s issues. Namely, take a bunch of engineers with a particular area of familiarity (e.g. familiarity with C and/or Java) and throw them at code, scaling up by number-of-engineers where necessary. My issue with pointing to this and calling it “practical” and “easy to understand” is twofold: (1) Go implicitly makes its ease of understanding dependent on an having existing background knowledge of concepts that the HN crowd is likely to have, themselves, which biases people but isn’t particularly easy to learn on its own merits (versus, say, Python) (2) Most companies cannot afford to solve engineering problems by throwing more bodies at it, but with Go your option is either that or leveraging external code generation As far as “taking the time to get each piece right”, this stuff isn’t cutting edge technology development! Go isn’t doing dependent typing or borrow checking or scoped effects! Everything that people lambast the language over not having is old hat, it’s like defending a car manufacturer who chose to use carburetors over fuel injection by saying that they’re trying to figure out how to do it right.
- The_rationalist 7y agoDoes clojure interface well with Java libs?
- grzm 7y agoYes. Very well. https://www.clojure.org/reference/java_interop https://www.clojure.org/reference/java_interop
- The_rationalist 7y agoInterested but how much as good as with kotlin? Being compatible is one thing, being as idiomatic is another.
- grzm 7y agoDefine idiomatic. As an example, I find myself using the java.time package quite frequently. An example: (ns dev.scratch.time-ex (:import (java.time Duration) (java.util Date))) (let [from (Date.) until (-> from (.toInstant) (.plus (Duration/ofHours 12)) (Date/from))] [from until]) Returns a 2-element vector containing two java.util.Date objects, the second twelve hours in the future of the first. Here I'm using Date, Instant, and Duration classes. It's consistent with Clojure syntax (methods being first items in a list), and remembering to use . or / (roughly for instance or static methods) for calling Java methods. Using something like the thread-first macro (->) is idiomatic Clojure, and it's not my goal to convince you that Clojure syntax and style is better, just that Java is immediately and idiomatically available (from a Clojure point of view). I find very little friction in using Java directly from Clojure code. I can't speak to comparisons with Kotlin as I have no experience using it.
- dominotw 7y ago> being as idiomatic yea kotlin prbly is a better choice if you mainly want to use java's libraries and write idiomatic java. Clojure is not 'better java' like kotlin, its a completely different paradigm.
- Scarbutt 7y ago
- fhennig 7y agoA while back i was happily writing clojure, but after a while its dynamic typing got problematic and that's when I learned scala. I really liked it, I think functional but statically typed is the way to go. Although I still think that it is a lot of fun to write clojure, it's a breeze with its focus on stateless, functional code. I tried to get into writing a GraphQL API in scala once, and the library made excessive use of the implicit parameters. That was too much for me, there was always something missing and it wasn't immediately apparent where things are taken from or why something doesn't work in one place but does in another.