4 ms·
It is unclear to me why msft is still investing in VB.net. C# is a better mainline language; F# is a better bleeding edge language. VB.net seems like a holdover
by bigdubs 11y ago
It is unclear to me why msft is still investing in VB.net. C# is a better mainline language; F# is a better bleeding edge language. VB.net seems like a holdover from the ASP days, and honestly is riddled with issues (no differentiation between assignment and equality, it's 2015 btw).
- archon 11y agoBecause a lot of businesses have codebases in VB. My company moved to C# for new development long ago, but we still have maybe 20% of our codebase in VB. It's not worth the time it would take to convert it, so it stays in VB. It's nice that Microsoft continues to support VB for companies like mine where being required to move to C# would cause a lot of problems for us.
- bigdubs 11y agoTake binary. Open in IL Spy, switch language to C#. Done.
- maximilianburke 11y agoAnd lose all code comments, revision control history, etc. Not to mention the risk of doing that on a large scale.
- bigdubs 11y agoI've done this before on a large scale (vb=>c#). You don't lose revision control history, thats still in the history for the previous file. If you're doing things in vb that can't be done in c# (there are a few things), you're writing bad code. The risk is greater in using bad technology / having legacy code.
- samsaga2 11y agoYou can use telerik converter. It's free and it works pretty well. http://converter.telerik.com http://converter.telerik.com
- thebouv 11y agoI can see why VB is used in large codebases for legacy apps. What I don't understand is continuing to work on the language and releasing v14 with improvements. That's just encouraging legacy code to stay the way it is, albeit with some new sugar.
- noblethrasher 11y ago> no differentiation between assignment and equality, it's 2015 btw F# has about as much differentiation between assignment and equality as VB, although it is nicer in F#. ==================== Now, I haven't used VB in almost 10 years, and have programmed in C# and F# for about a decade (even before F# was included in VS). But, once you get past the verbosity, VB is actually a slightly more powerful language than C# (my most favored language). VB has more query comprehension operators. VB has a more elegant way of wiring up events using the `Handles` keyword. VB has XML literals. Once nice trick is that you can use them to simulate better string interpolation. VB has a more robust way of handling exceptions (though C# will gain this in the next version). VB allows you to use automatic type propagation ("type inference") with lambda expressions. Not that big of a deal, but coming from F#, I'm always slightly annoyed that I can't use `var` with lambdas in C#. VB's `Select..Case` is more powerful than C#'s `switch` The `Like` operator. String concatenation via the "&" is nicer in VB Late binding is nicer in VB (though arguably more powerful in C# 4+). I prefer C#'s way of doing overload resolution (start with the most derived class first), but some of my colleagues have exploited VB's method of overload resolution (consider all methods in the inheritance hierarchy at once) to create some elegant code. I've been meaning to investigate it.
- bigdubs 11y agovb 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)
- Spearchucker 11y agoBy what criteria are C# and F# better than VB.Net? VB is more readable (not operator, inherits and implements keywords, etc), is functional, dynamic, compiles to the same byte code, and has useful features the other two don't (e.g. project-level imports). It's a lot easier for people with a Basic or Pascal background to use than either of the other two. Are the only things going for C# and F# that they're your favourite languages? What makes your story more compelling than someone who likes VB.Net more than the others?