views:

1418

answers:

20

After finish reading "The Pragmatic Programmer", I have come to a conclusion that it's time for me to learn some new language other than C#/VB.NET every year.

I have come down to 2 languages that I would like to go with. Ruby & F#

Should I go with Ruby or F#? That is the question.

Ruby is dynamic language, where a lot of C# features seem to came from F# is a functional language which I have never been exposed to.

OK, I have been think so much about which one to go with. Can someone give me a tip on what I need to consider before delving into either of those languages?

Thanks.

+10  A: 

I'd say go with F# as it's the most different from what you already know. You'll probably learn the most from it.

David Thibault
A: 

Consider first what you want to do.

indivent
A: 

It depends on what you want to do with the language, I think Ruby would provide you with more immediate job skills, whereas I think F# would be invaluable in adding to your programming skills, as it is somewhat of a paradigm change moving to functional thinking (at least more than the move to Dynamic languages), and lets face it, has a heap more geek-cred :)

johnc
+1  A: 

I would recommend both... I was in a similar position about a year ago or so... I started with Haskell (sorry, I'm not a .NET person), and I got into it and learned a TON about functional programming that I found very invaluable.

After I got my fill in a couple months, I moved on to Ruby, which is now my absolute favorite programming language. I would say, anyone can benefit from learning Ruby, if only because it is so fun to work with.

You really do need to learn a strongly functional language though... that goes a long way... you can program functionally in Ruby, but Haskell is much better for learning functional style because it is so purely functional.

Mike Stone
+3  A: 

It kind of depends on the sort of work you plan to do; I usually try to involve a new language in my work if I believe it will help me solve a particular problem or improve my processes.

If you primarily do work based in mathematics or processing, you will get a kick out of F#. If you do a lot of web development, give Ruby a shot. Either way, I don't think you stand to lose anything by giving one or both a try.

I generally take one work week to give a new language a try. I'll play around with it each evening...after 5 days I've usually got a vibe for whether or not I would like to continue working with it.

Hope that helps!

Alan Harris
A: 

If your goal is to widen out and learn something new, Ruby might be the way to go. Not only is it a script language used (these days) predominately for web development, it's also just a really useful language that is a pleasure to code with. I think it'll give you a very different perspective from C#/VB.NET.

Lucas Oman
+3  A: 

Consider not only what you want to learn, but how that knowledge will serve you. If it's an academic decision only, look at both and decide what you think is more interesting. If both seem interesting, maybe pick ruby as it is gaining popularity. That way you can take part in interesting discussions with a wider range of people, and you may also find some usefulness with a future project.

Also, in Ruby's case, you often need to do it "The Ruby Way". A lot of their way of doing things is very good, and even for those people who have switched away from Ruby, take something of their design with them, improving the project they are doing.

scubabbl
A: 

Better to go with Ruby because its more widely used, and therefore gives you added benefits of learning current technology. It also takes you out of MS-land, which can only be good.

+6  A: 

If you are on windows, ruby was really designed and thrives in a shebangable (#!) environment, like a nix based system. They have made improvements, but hosting rails apps in particular is quite difficult on windows.

If you are used to c# and have the environment set up, its my understanding it takes very little time to get F# running.

When IronRuby finally goes bronze, there will be a nice alternative with real windows support. For now I would say learn F# if you want to casually learn, and learn Ruby if you really want a departure, and want to spin up a nix vm or something like that.

All that said, I'm doing ruby in my spare time, happy coding!!!

DevelopingChris
+16  A: 

F# will teach you about functional programming which may lead you to type theory and how to use the type system to do proofs.

Ruby will teach you about elegant OO systems, duck typing and exploiting dynamic languages.

Having spent time learning about both subjects, I think the type theory path is more interesting myself and that it provides you with new tools to help ensure correctness. I know I'm biased, but I'd say go with F# :)

By the way, C# will see more new features like that of F# over its lifetime than it will see features borrowed from Ruby. This is partially due to the team at MSR that works on new directions for C# and partially because F# is closer to the frontier of programming language research than Ruby is.

Jason Dagit
A: 

I think it depends on what language you know now. If you know Python then I would learn F# since it teaches you functional programming. If you know Haskell, then learn Ruby. I recommend learning more about each language's philosophy and the decide which will help you in the long run.

John
+4  A: 

I would rather suggest F#, for a variety of reasons. F#, is first of all a Functional programming language ( F# is an OO language too ). The MS research team modeled the languaged based on Python, ML, and C#. Learning F# would help you explore the world of functional progamming, and secondly, its very easier to grasp and work - because you are comfortable with c# already. I would strongly suggest F# :) for now. Ruby could be your next language.

+2  A: 

It depends on your background, I like to suggest people to go into the "unknown" since you will probably teach you something that you can use in your old language.

Having said that, if you're used to OOP/Imperative programming and you want to get to know functional programming I'd go for something more strict like Haskell. In languages that support procedural constructs like F# or Lisp you'll see yourself falling back to using loops when don't seem to find the correct recursion, while on Haskell you're forced to use what functional tools have available for you (unless you want to learn monads, and in that case you'll already know most of the functional stuff).

If you're an experienced programmer I'd suggest you to try Haskell (or even F# even if it's ugly! :P) since you'll learn a lot of useful things. If haven't programmed for long I'd go for Ruby since it's a bit less...harsh(?) and you'll get to see what a "beautiful" language is :)

Federico Builes
A: 

Ruby, because it's based on dynamic runtime, when F# is introduced some of the concepts, but still use the static CLR.

dimarzionist
+1  A: 

OK, I have decided.

As a hardcore Windows user, I am going with Ruby to explore *NIX world while learning a new language. It seems killing 2 birds with one stone.

But don't get me wrong. I am going to learn a functional language for sure. Next Year, it will be either F# or Haskell.

thank you folks for all your suggestions and thoughts on this.

Sung Meister
A: 

Are you sure you want to constrain yourself to just Ruby or F#? What is the reason why you want to learn these languages -- do you want to think in a more "functional" way? Or do you wish to explore a language with more expressive syntax?

If it's the former, I highly suggest you learn Haskell instead of F# :P Web site here: http://book.realworldhaskell.org/

If it's the latter, go learn Ruby.

cruizer
Well I have to start somewhere... thank you or the suggestion though.
Sung Meister
A: 

I'd suggest either Python or Ruby. Both of them add many cool features worth learning, ease of setup and fast learning curve. Mastering them will definitely make you a better programmer and a more efficient one.

As for F#, it could be a next step after Ruby; Ruby already introduces neat functional features(the Enumerable class, the blocks, Procs and metaprogramming) that will prepare the ground for F#.

I'm not familiar with F#, but... are you sure you want to dig into it without studying at least superficially some more classical functional programming languages such as List, Scheme or OCaml? Heck, even Javascript has many functional language features worth looking into.

I hate the fact that whitespaces are signifcant in Python. I just cannot stand that...
Sung Meister
A: 

I would like to add that I disagree with the top poster. There are excellent Ruby editors and IDEs available for Windows, and Ruby and Rails both run fine in Windows. While it may be a bit more difficult to set up a host server for heavy-traffic sites in Windows, the difference is not all that great and tools are available. (For example, you can use Apache in front of multiple Mongrels without much difficulty.)

A: 

Sung Meister commented: I hate the fact that whitespaces are signifcant in Python. I just cannot stand that... Did you know that F# under #light mode is whitespace significant as well? Perhaps you should stick to Ruby!

Ric Deez
+2  A: 

Ruby offers nothing over C# so id go F#. F# is much harder to learn though....

ben
...and much more rewarding...
Ishihara