4 ms·
vb is not a more powerful language than c#. c# exposes more core features of the clr than vb, which is a more fair basis for "power". richter didn't write "clr
by bigdubs 11y ago
vb is not a more powerful language than c#. c# exposes more core features of the clr than vb, which is a more fair basis for "power". richter didn't write "clr via vb", if you want more clues to this. it has a lot of what i would call terrible language design bolted onto an already bad language.
key things in c# not found in vb: unsafe blocks and pointer manipulation, partial interfaces, @ strings (multi-line string declarations), checked/unchecked arithmetic, multiple conditionals in for loops, the coalesce operator.
c# will generally be faster for numeric computing because of unchecked arithmetic by default.
problems with vb: having a case insensitive language is a nightmare. type coercion is a terrible idea and leads to weird bugs. the Is operator in vb is very confusing to its c# counterpart. properties as reference is a nightmare for bugs, similarly if you're going to have a prop with a parameter just use a method.
re your list:
`handles` and += event are the same underlying IL. honestly i prefer += (and -= to unhook), it's a weird dissociation to have the event wiring away from declaration.
xml literals are cool if you're using xml a lot, which not many people are these days. It's weird to have that as a language level priority vs. leaving it to libraries.
the lambda inference is a feature not a bug; it's because they could map to func, predicate or action with a similar generic signature (and wildly different intrinsics)
- noblethrasher 11y agoI probably could have been more clear, but by "power" I was talking about the abstractions afforded by the language. C# also exposes more CLR features than F#, yet it usually clear and uncontroversial when someone says that F# is more powerful than C#; I've never heard people talk about power in terms of performance. But, it's not like C# ever afforded a strict superset of CLR features: until recently, VB exposed exception filters while C# did not, and that is arguably a more important feature in day-to-day programming than pointers and unsigned integers. I also forgot to mention that VB's lambda expressions are more powerful because they can contain iterators. Now, don't misunderstand me: I love, love, love C#. After grokking Haskell's type classes (and Scala's traits), I even slightly prefer C# over F# since the former can more easily simulate those features. But, lets not pretend that VB didn't ever having any significant advantages over C# for day-to-day programming. Even today, VB is probably a nicer environment for Ruby and Python programmers than C#.