C# vs. VB

Posted by Andrew on July 03, 2007

Rowan posted about C# vs. VB:

> None, if challenged, would be able to build anything using
> C# that Phil couldn’t build just as well in VB.

This isn’t the point. Different languages have different levels of expressiveness and also different aesthetics. A program written in Haskell may be 10 times shorter than the same program written in C++ for example [1].

Personally, I have two favourite languages: Ruby and Haskell :-)

In Ruby I can write this:

10.times { |i| puts i }

But in C# I have to write this:

for (int i = 0; i < 10; i++)
{
  Console.Write(i);
}

Which do you find more beautiful? :-)

1. http://web.cecs.pdx.edu/~apt/cs457_2005/hudak-jones.pdf

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

  1. James Newton-King Tue, 03 Jul 2007 20:46:42 CDT

    Using C# 3.0 you could do something like this:

    5.Times( i => Console.WriteLine(i) );

  2. Alex Tue, 03 Jul 2007 21:30:38 CDT

    James… that is exactly what I just wrote up…

  3. Andrew Tue, 03 Jul 2007 22:34:57 CDT

    Yep, Lambdas are a good thing and I wonder sometimes why we had to go through the “delegate” syntax to get there.

  4. Brenda Wed, 04 Jul 2007 00:28:55 CDT

    php ftw:

    echo implode(range(1,10));

  5. Brenda Wed, 04 Jul 2007 00:32:52 CDT

    you could also one line your C#
    for (int i = 0; i

  6. Parle vous Anglais? « Rowan Simpson Wed, 04 Jul 2007 16:52:57 CDT

    […] Andrew from Mindscape makes the point that every different language has “different levels of expressiveness and also different aesthetics.” […]

  7. anastasiosyal Thu, 20 Dec 2007 05:44:24 CST
Comments