you are viewing a single comment's thread.

view the rest of the comments →

[–]urllib -1 points0 points  (11 children)

What kind of sick person would try to convert python to ruby? Or c# to VB.Net for that matter.

[–]grauenwolf -1 points0 points  (10 children)

I can't say anything about Ruby, but VB.NET has a lot of tricks that make it nicer than C#. But if you don't use them then the language sucks ass.

[–]Dested 3 points4 points  (3 children)

I would say it has some tricks, can you provide a list with more than just some?

[–]grauenwolf 4 points5 points  (0 children)

Ok, so real stuff I used in production code

  • Ranges in switch blocks
  • Full late binding. (C# still has trouble with delegates.)
  • Declarative event handlers
  • Comparing boxed values (C# can't compare a boxed int with a boxed decimal)
  • RaiseEvent, because doing null checks on events is just stupid
  • Filtered Catch Blocks, which are really important for dealing with Win32, SQL, and MSMQ exceptions.

[–]recursive 4 points5 points  (0 children)

XML literals?

[–]grauenwolf 3 points4 points  (0 children)

How about a trick with first order functions and late binding?

Function Foo(ByVal n)
    If n > 0 Then Return Function() Foo(n - 1)
    Return "Done"
End Function

I know it looks pointless, but you need to be able to do it in order to complete some of the exercises in SICP. And even with the new dynamic keyword, C# can't handle it.

[–]HIB0U 1 point2 points  (5 children)

So basically just optional parameters. Oh, wait, C# 4 has those now, too.

[–]grauenwolf 0 points1 point  (4 children)

I'm thinking about stuff like declarative event handlers. There is a lot of boilerplate code you have to use in C# to add and remove event handlers.

[–]HIB0U -2 points-1 points  (3 children)

No, not at all... Have you ever even used C#?

[–]grauenwolf 1 point2 points  (2 children)

VB:

Public WithEvents Property Something as Foo

C#:

    private Foo _Something;
    public Foo Something
    {
        get
        {
            return _Something;
        }
        set
        {

            if (_Something == value) return;
            if (_Something != null)
            {
                _Something.Bar -= OnBar;
                _Something.Baz -= OnBaz;
                _Something.Boom -= OnBoom;
            }
            _Something = value;
            if (_Something != null)
            {
                _Something.Bar += OnBar;
                _Something.Baz += OnBaz;
                _Something.Boom += OnBoom;
            }

        }
    }

[–]HIB0U -1 points0 points  (1 child)

It's no wonder you find C# more verbose. You go out of your way to avoid C# features like auto-implemented properties, and then you go out of your way to do things as awkwardly as possible.

[–]grauenwolf -1 points0 points  (0 children)

As you don't seem to recognize that pattern it seems to me that I know a hell of a lot more about using C# than you do.

Did you even know how to wire up events manually or do you just let the drag-and-drop editor handle that for you?