views:

351

answers:

8

Hi,I've just completed my freshman year in college and am majoring in EE (with a lot of interest in CS as well) . I know some Python,C/C++ and Java and also a little bit of Actionscript . I am planning to learn either Haskell or Ruby on Rails. Haskell because it is a functional programming language, and I've been really impressed by this paradigm and Ruby on Rails , as I don't know any 'web' programming language and have heard that you can develop apps in RoR very easily and quickly . Which one should I learn ? and please suggest some links / books for starting off .

+1  A: 

Ah but you do know a web programming language in Python (heck even server side Java). Ruby is the language and Rails is the web framework. My suggestion is to try a Python framework first, such as Django before attempting to learn both Ruby and Rails. While it might not be blessed, you can get a taste of functional programming in Python if you really want to.

dsspence
+7  A: 

If you know some python,C/C++, and Java then you know three web programming languages. Haskell is great if you want to expand your mind a little with such concepts as Laziness, Purely Functional Programming and Inferred yet Strongly typed systems. I can't recommend learning it enough for those reasons. It will really change your approach to code and design.

Ruby won't teach you much that the three you already mentioned can't already teach you. And it won't give you any more experience in Web Programming than the others are already capable of giving you. So in that respect it doesn't seem to offer you much. It will teach you a widely used language in web application development so it wouldn't be a total loss though.

Note: I'm not dissing Ruby here. It's a nice little language but but your question didn't really point to any need to learn Ruby.

Jeremy Wall
Neither C nor C++ are web programming languages (also java and python are only web programming languages in the sense that they are often used for that, not in the sense that that's their primary usage area or what they were originally invented for). While it is possible to write CGI applications in C or C++ (or any other language that can write to stdout and read from stdin) there isn't really any library support for that and I'm pretty sure that hasn't been done since perl was invented.
sepp2k
If the criteria for a web programming language is whether the language was originally invented for it or not then almost no language is a web programming language. If however the criteria is whether that is the primary area of useage then I think the criteria is wrong.As to Whether C/C++ are useable for web programming CGI as a technology is completely beside the point. Embedded web servers are all the rage and C/C++ have plenty of those. And if you're looking for a useage case then the company I work for serves literally billions of requests in applications written using C/C++.
Jeremy Wall
+3  A: 

What a strange question. I think the choice will depend on your goals.

RoR will work the way you are used to in Python, Java, etc. and provide you with a template to quickly make web apps. If your primary goal is to make some specific web app, I would recommend this choice.

Haskell will be much slower going -- at least it was for me -- because you must change the way you think in order to do anything productive in it. If your motivation is to make something specific, you might find yourself frustrated with Haskell. However, if your motivation is to broaden your horizons as a programmer, Haskell will be much more enlghtening than RoR.

For what it's worth, it was about six months into learning Haskell that I felt comfortable that I could write anything I wanted (in the way I could with imperative programming). Now it has been four years, and to write programs in other languages I frame them in Haskell (in my mind) first and translate backwards. It was totally worth it. But people's learning times vary.

luqui
If you choose Haskell, the Big Ones (Learn You a Haskell and Real World Haskell) will be good tutorials, since they are targetted at imperative programmers.
luqui
+1 for Real World Haskell I found it invaluable.
Jeremy Wall
+1  A: 

If you want to learn more about functional programming and web programming, it would be cool to learn both Haskell and Ruby on Rails. Start working on one of them and when you get bored switch over to the other one. They're quite different topics.

Tip: Ruby on Rails is a framework, not a programming language. Ruby is the programming language you're asking about. You can use it for general programming, not just web apps.

Parappa
+11  A: 

Ruby (and Rails) cover pretty much the same areas of programming as Python (and Django) -- while any new language (and framework) will extend your culture, picking a new one that's pretty close to one you already know is a somewhat "low effort, low return" choice (can still be quite practical, if you have little time and energy to invest, or need the specific new tools for some practical reason, of course).

Haskell is very different from all the languages you already know, and for that very reason it will greatly expand your mind (and by the same token it will most likely be a much harder learning effort: no pain, no gain;-).

To pick between the two alternatives, therefore, "γνῶθι σεαυτόν" is the imperative -- if you know what you're after, then you will pick well (Attic Greek would be yet another potential language to learn -- probably even harder to learn than Haskell, but the mind-expanding possibilities are proportionately larger too!-).

Alex Martelli
+9  A: 

Learn 'em both! While the other answers here are basically right, I think you should question your question. If you have a strong interest in CS then learning languages should be like trying new cuisine: You should try new ones regularly! Don't look at this as a committing choice. Try one for now, then try the next when you get the hankering. When i was in college I probably learned three or four languages a term.

MtnViewMark
Great analogy! :-)
luqui
+2  A: 

The rails framework for Ruby is legendary, but it should be noted that Haskell also have some (less known) web frameworks, like HappS, Yesod and Snap. So maybe you could compromise and learn Haskell and later one of it's frameworks.

If you want to get started with Haskell web development, I recommend Learn you a Haskell for Great Good, Real World Haskell and Programming in Haskell, for learning Haskell as they are the standard resources for learning Haskell.

As for the frameworks, I think snap is the one that is most beginner friendly, and besides their website looks good (and I think that is a good indicator for web frameworks.) They also have a nice tutorial.

HaskellElephant
+1  A: 

If you are designing hardware, you may be interested in these Haskell DSL's (domain specific languages) for hardware design:

http://www.google.com/search?q=haskell+hawk+lava+ruby

http://en.wikipedia.org/wiki/Bluespec,_Inc.

ja