开发者

clojure vs. Ruby [closed]

开发者 https://www.devze.com 2023-01-09 09:28 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this q开发者_JAVA百科uestion can be improved and possibly reopened, visit the help center for guidance. Closed 12 years ago.

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.


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 ;)


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.


Ruby is a nice language though I'm partial to the Django framework over Rails. One thing that I have found working with interpreted languages is their ambiguous implementation of threads. In both Ruby and Python the interpreter will only crunch though one thread at a time.

As far as clojure goes, think about how big the library will be when you try to use it. Coming from .Net you already have a huge lib. Python and Ruby are fairly mature at this point, and you can find most any extensions you could imagine. It is so easy to take a big library for granted until you don't have it. Before switching look at .Net nuke. Haven't used it but it's supposed to be model/viewer layer for .Net.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号