Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clojure vs. Ruby [closed]

I'm ASP.NET developer. I want to learn web development technologies and other languages than Microsofts. I heard about two languages but I don't know which one is better or how to favor one over the other especially that clojure is new somehow.

Could anyone help me about why to choose one of them over the other?.

Thanks.

like image 307
Mostafa Elmoghazi Avatar asked Jul 26 '10 13:07

Mostafa Elmoghazi


People also ask

Is Clojure in decline?

The Clojure community is growing stronger In fact, 25 percent of current developers have been using Clojure for a year or less, which is a great sign of the health of Clojure looking at 2022 and beyond.

Is Clojure alive?

As far as the future of the language is concerned Clojure is alive and ever evolving. The core developers seem to be careful about the additions they make. But you still have to revisit and reconsider your acquired idioms with each new version of the language. A book like The Joy of Clojure gets dated rather fast.

Is Clojure dying?

Clojure isn't dying, but it doesn't have a large company like Google (golang), Microsoft (C#) or Sun / Oracle (Java) behind it. One of the deciding factors of a language becoming widely used is marketing.


2 Answers

Ruby will obviously give you a better bang for your buck if your aim is to get things done and to reuse mature libraries. It must have one of the most vibrant ecosystem considering web development. The quantity of new stuff is big and, most importantly, the quality is often amazing.

It has a very nice package distribution system, and a number of tools which makes practical web development a breeze, at all levels.

In the heavyweights web frameworks you have:

  • Rails, which you have necessarily heard about. It is probably one of the best compromise today between big community and intelligent design. The other one would be django in my opinion but it is a python framework
  • Merb, which is a lighter alternative in the full blown framework department

And you have a ton of lighter ones, like Sinatra , which is probably one of the most elegant small web framework i have ever seen, or Camping, which is small and very fun to use.

This is only the beginning. Be it for ORMs, templating engines, or anything else you'd want to do with it web related, you have a ton of quality options.

On the negative side for ruby:

  • It is a very dense language, with a lot of things to learn, and a distinct inclination for "magic" constructs. It is quite beautiful, but it is far from the simplest language.
  • It is slow. If you want to do anything that needs performance, ruby is probably not the language you need. That may or may not be a problem depending on what you want to do with it
  • It doesn't have as many library for "regular programming" than it has for web programming, although it is clearly not the desert either. A language like python has a more wide range of libraries if you step out of web programming though.

Clojure is a very different beast altogether. It is a very new language, and it is entirely functional. If you never programmed in a functional style before, it may be a paradigm shift that will make you less productive for a while, but you will almost certainly learn a lot in the process.

It is also a lisp, and like with functional programming, it will probably mean a lot of new things to learn, but a lot of enlightenment at the end of the process.

It is a very elegant language, with a very vibrant community. It is also a lot faster than ruby, and it is only getting better with the new 1.2 version.

So on the positive side :

  • It is a clever language. Contains a lot of interesting ideas, notably regarding concurrency. It is not object oriented
  • It's fast for a dynamic language
  • It runs on the JVM, and has a very strong and easy to use interop system with Java. That basically means you have the whole Java ecosystem to your disposal.

On the negative side :

  • It is very new. That is not a disadvantage in itself, but is the reason for other troubles you might have with it along the way.
  • It has very few well integrated and thought libraries. This is the point that is the most detrimental in my opinion. You basically have everything you will ever need in java world, but the solutions may be ugly. You might want to code your own wrapper library in the process, but this takes time.
  • It is not like everything you know. It's not object oriented, it is not imperative, and it hasn't anything like classical C syntax. So depending on your other language experiences, it might take a long time to learn

So the summary is :

If you want to learn new things in a very comfortable environnment while having the possibility to build things very fast by leveraging mature libraries, choose ruby.

If you want to learn even more new things, you don't mind in totally new territory, eventually taking more time to do things, and you want to participate to a community that might be on its way to modify the way we think about programming, while hacking and having fun in the process, choose clojure ;)

like image 200
raph.amiard Avatar answered Oct 10 '22 01:10

raph.amiard


Switching from ASP to Ruby is probably easier than switching to Clojure, also it has a larger community and ecosystem. However, if you are interested in functional programming and/or fancy concurrency features, you should give Clojure a shot.

like image 43
Konstantin Haase Avatar answered Oct 10 '22 02:10

Konstantin Haase