Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Micro-Services: Clojure vs. Scala (glennengstrand.info)
2 points by gengstrand on May 18, 2015 | hide | past | favorite | 4 comments


sorry, but i cannot agree that someone may decide to go with clojure or scala based on the fact that one has type inference while the other not. Specially when you already have approaches to have type inference on clojure http://typedclojure.org/. Both languages have so much different concepts and ideologies on how to solve problems. To me it is much more about the mindset that each requires you to apply while solving a problem.


What do you mean by the term "mindset?" To me, that term usually implies a kind of groupthink.


I mean in terms of the philosophy behind it. A programming language is a tool for thinking. And each language, fits better with some specific way of thinking about a problem. So you are mastering a programming language when you can adapt the way you think about the problem to fit the best characteristics of that language. And i feel the discussion about using Scala or Clojure should be more about that, and not so much about the amount of code needed to write a program on each one, or the fact that one has Type Inference in its nature, while in the other it is optional. Just my 2 cents ;)


I agree with your intentions; however, when comparing two languages, you need some quantifiable basis for comparison. "Better fit" is very ambiguous and hard to measure whereas code size is very specific and repeatable. I believe I used something like this.

wc `find ~/git/clojure-news-feed/server/feed/src -type f -name '.clj' -print | xargs`

wc `find ~/git/clojure-news-feed/server/feed/test -type f -name '.clj' -print | xargs`

wc `find ~/git/clojure-news-feed/server/feed2/src -type f -name '*.scala' -print | xargs`

I used code size because you hear about that alot but I agree that it is a very imperfect basis. Less code doesn't necessarily mean fewer bugs. When I coded these two services, I wasn't thinking of code size at all.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: