Hacker News new | ask | show | jobs
by bunderbunder 4859 days ago
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.