Hacker News new | ask | show | jobs
by rohansingh 4860 days ago
Sigh. I'll actually do the job of debunking these one by one.

1. Almost every mainstream language has case-sensitivity. This avoids ambiguity by having only one right way to express a given variable. Since Visual Studio has excellent autocomplete, you don't have to repeatedly use SHIFT, and you are unlikely to accidentally mistype the variable name.

Of course, when I see an argument like, "When you accidentally leave Caps lock on, it really matters," I have trouble taking the author seriously.

2. The reason switch is different from if-else is something you can learn from any language primer. The author makes the following argument: "It’s easy to forget to type in each of these Break statements!"

In fact, it's not easy. The "break" is required by C# in any non-fallthrough cases. Not typing it will generate a compiler error. Not something you can miss.

3. Here the author makes a red herring of an argument regarding how you can use Visual Studio to setup event delegates for UI components. Apparently some paradigms are supported for VB.NET, and others for C#. Of course, what your IDE supports has nothing to do with which language is "better".

The basic argument is that you need to return to the design view to create an event delegate rather than being able to do it from code view. Of course, most experience C# writers will stay in code view and just type the following themselves:

    _myButton.OnClick += ... (tab to autocomplete new delegate and handler)
4. The author then continues to say that the comparison symbols in C# are "stupid" compared to Basic's "And", "Or", etc. This argument almost doesn't deserve to be addressed, but I'd like to point out that C# has the advantage of not overloading the assignment operator (=) with equality comparison (==). Keeping these separate prevents a common class of error.

5. The author fails to trigger autocompletion for creating a new property in C#. This is largely because he doesn't know that the way you do this in Visual Studio for C# is to type "prop <property name>" and hit TAB. The behavior is then exactly the same.

Regardless, still a comparison of IDE features rather than languages.

6. The author complains that the "PMT" function, which "calculates the annual mortgage payment for a loan", is not a builtin in C#. I am not rightly able to apprehend the kind of confusion of ideas that would provoke such a statement.

7. The author argues against needing semicolons in C# for line endings. Alright, at least this is actually about the language itself. Personally I'm not a huge fan of needing semicolons either. A style thing, but I'll let it stand.

8. The author complains that the type for a variable declaration precedes the variable name in C#. Somehow this is a major problem. Obviously just scraping the bottom of the barrel here.

9. The author complains that C# does not automatically cast enums to ints or other types. I'll leave it to other sources that talk about the pros and cons of implicit casting a la Scala.

10. The author complains that is not possibly to reinitialize arrays to a new length in C#. He admits that he has been told that, "I should be using lists and not arrays anyway." But he retorts that, "The point is that - as so often - Visual Basic makes something easier to code than C# does."

I fail to see why using a List<string> is somehow harder than string[].

In conclusion, I really have to hope that this is a joke.

5 comments

>Andy ‘Wise Owl’ Brown decided to write a tongue-in-cheek rant whilst he could still remember the pain-points

It's at the top of the freaking article.

Sorry. Early morning over here. I guess I suffered a reading comprehension failure.
The tone you've decided to take is rather unfortunate. In fact many of your counter-points seem to essentially be "well he is just a stupid-head!"

You spend more time attacking the author than actually addressing his points. Which is just a shame. In fact most of your list is just a different attack against the author.

I actually prefer C# (and was a long term VB 6.0 user). But even with that being as it is, I still don't feel your post comes at this in a constructive way.

You're right, I was a bit short in some cases. But really, it is aggravating to have to explain why PMT() should not be a builtin in the global namespace.
> The author then continues to say that the comparison symbols in C# are "stupid" compared to Basic's "And", "Or", etc. This argument almost doesn't deserve to be addressed

It does. I'm pretty sure VB's "And" and "Or" don't short-circuit…

> 8. The author complains that the type for a variable declaration precedes the variable name in C#. Somehow this is a major problem. Obviously just scraping the bottom of the barrel here.

The author also complains that out-parameters have to be annotated as out-parameters in C#, apparently does not realize parameters don't have to be out-parameters.

> But he retorts that, "The point is that - as so often - Visual Basic makes something easier to code than C# does."

Basically, he complains that C# makes it harder to do the wrong thing than Visual Basic. Which tells you a lot about the mindset.

> It does. I'm pretty sure VB's "And" and "Or" don't short-circuit…

Interesting, didn't know that. However, I got the feeling that he wasn't talking about how the operators work so much as what they are named.

You are correct; 'And' and 'Or' do not short circuit. You have to use 'AndAlso' and 'OrElse' if you want short circuiting.
AndAlso and OrElse are the short-circuiting equivalents.
10. The author complains that is not possibly to reinitialize arrays to a new length in C#. He admits that he has been told that, "I should be using lists and not arrays anyway." But he retorts that, "The point is that - as so often - Visual Basic makes something easier to code than C# does."

I feel like this case in particular captures the essence of a cultural difference between C# and Visual Basic. However much it's grown over the past 20-odd years, VB's roots as a RAD kit - a platform designed to let people slap together code without having to worry themselves overmuch about engineering concerns - are still with it.

It leads to things simply being seen differently. To the author, the point is that it's easier to do X, as simple as that. To the kinds of programmers who tend to gravitate toward C#, on the other hand, Redim Preserve is a code smell that indicates it's time to rethink your choice of data structures. The idea of having a language-level feature whose only purpose is to make it easier for people two write bad code is anathema.

I don't want to hate on VB.NET too much, because overall it's a very good language. I personally prefer VB's switch statement, for example. Deciding between a jump table and a sequence of conditionals should be the compiler's job, not the programmer's. However, I do have one huge complaint about it in there are some features that it never should have inherited from VB6 in the first place. Phrases like 'Redim Preserve' and 'On Error Goto Next' always make me shudder. And when I'm called in to help figure out performance and stability issues in our VB projects, they play a part in my findings with alarming regularity.

10 is weird anyway even if it's satire. System.Array.Resize(ref array, newSize)