Jason in a Nutshell

All about programming and whatever else comes to mind

Java vs C# vs Python vs Ruby: an “objective” analysis

Posted by Jason Baker on April 21, 2009

At my place of employment, we’re looking to migrate some of our old Classic ASP applications to something newer (yes, we still have actively maintained Classic ASP code). So my boss asked me to write up an analysis of the different options we have available.

Now before I give you the link, I have a few disclaimers and other random thoughts:

  • I tried to avoid editorializing so that this can be objective as possible, but it’s impossible to discuss these kinds of issues without being subjective.  Thus, don’t take this as the gospel truth.
  • There may be errors here.  In fact, I can almost guarantee that there are errors with Java and Ruby because I’m not terribly familiar with them.  If there are errors, feel free to leave comments.
  • My boss is a Java guy, so I left some blanks that I’m pretty sure he can fill in.
  • Some of these are blatant oversimplifications.  There’s only so much data that you can squeeze into a spreadsheet.
  • I’ll try and keep up with this for a while, but chances are that I won’t for long.  These languages are all being changed.
  • I’m biased towards Python.

Ok, without further ado, here’s the link:

http://spreadsheets.google.com/pub?key=p7efJLoHuYE-iw6JxBmpSQg&hl=en

Advertisements

12 Responses to “Java vs C# vs Python vs Ruby: an “objective” analysis”

  1. Marano said

    Greate comparison!
    But I thing you made some wrong statements.
    Java doesnt have class methods, but actualy static methods acts like rubys class methods. So, ‘sort of’ ;P
    Of course ruby doenst have function overloading, but its common to pass a hash of options to the method so it acts like overloading, so I thinks its ‘sort of’ again.
    You said that ruby doesnt have private members, every field is private as far as I know. You only can access through a method.
    And 0 in ruby is evaluated as true.
    I hope I didnt say anything wrong or polemic!

  2. Jason Baker said

    1) After researching Ruby’s class methods, it appears you’re right. I was mentioning class methods more in reference to Python’s class methods (which are quite a different thing from a static method).

    2) I’m not sure that passing a hash of options is enough to make it a replacement for function overloading (nor do I feel that languages like Ruby or Python need first-class function overloading).

    3) You’re correct, but after researching the subject, I noticed that fields may be accessed by subclasses. That would technically make it a protected member.

    4) Thanks for pointing out that 0 is true.

    Thanks for looking at this for me! That’s primarily the reason I posted it here.

  3. Paddy3118 said

    In Python, you forgot that False is also false.

    – Paddy.

  4. Jason Baker said

    I left that out mostly because I figured that it would be common sense that False evaluates to false (as is the case in all the other languages).

    Thanks for mentioning that though.

  5. Rao Lakkakula said

    small note that in ruby nil and ‘false’ evaluates to false everything else to true

  6. Developer said

    I didn’t understand. Did you consider a ‘pro’ a language with multiple inheritance?

  7. Jason Baker said

    @Developer: Not necessarily. I put it on there because the language has it. As for whether or not that’s a good thing would be the subject of another blog post.

  8. Arash said

    You got some of your C# info wrong.

    C# does in fact have map, reduce, and filter.

    C# also has closures.

    C# will have optional parameters in version 4.0

  9. GStu said

    Wouldn’t you consider Maven to be a “CPAN-like module archive” for Java?

  10. Michał said

    One issue: You wrote that C# package system is “Windows DLLs – can be painful”.
    In fact these .NET dlls are assemblies, which are different from win32. In fact, the only similarity is the extension. And YES – assemblies are here to make you forget about dll hell!

  11. redeeman said

    java does have an interactive shell, just use BeanShell: http://www.beanshell.org/

  12. Alex said

    “Everything is an object” – Java yellow, C# red. WHY?
    “Optional arguments” – C# DOES have them (since .NET 4.0 I think, so you were probably right at the time of posting).
    “map/reduce/filter” – C# DOES have them (LINQ) which had already existed them for 2 years when you posted.
    “Windows DLLs – can be painful” – this is plain wrong, as pointed out by Michał above.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: