Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> As someone who was writing Visual Basic.NET back when it came out, there was no upside to it over writing in C#

Sure there was: C# didn't exist yet. It didn't exist for many years to come. It simply wasn't an option. C/C++ was, however.



You may be confusing Visual Basic .NET with Visual Basic 6 and its predecessors. C# actually predates VB.NET by about a year.

VB.NET may be syntactically similar to VB6, but under the hood they were so different that migrating projects to VB.NET essentially meant a complete rewrite.


Visual Studio had a built-in migration utility which could get you 80-90% there. However if the original VB6 was spaghetti code written without Option Strict and Option Explicit enabled you had much bigger problems.

The biggest breaking change was the removal of the global Printer Object so any printing code needed a complete rewrite.


My recollection is that the migration tool was really just a tool that would fill your VB6 code with comments telling you that you had to rewrite stuff. Trouble spots were largely related to error handling On Error Goto and error handling blocks had to be refactored into proper Try...Catch blocks, which affected a lot of code, and another trouble spot was all File I/O had to be rewritten/redone, same with any drawing code; Resource files had to be recreated, etc; I don't even think it could load the FRX files but I might be misremembering. I felt it simply wasn't worth even bothering to try to directly convert to VB.NET, and since those programs I wanted to move forward I had to pretty much rewrite anyway, I decided to use C# instead and just make new versions.


The migrated VB6 code I saw back in the era when VS2003 came out was a thin glue layer over some compiled DLLs. So the result of using the converter was a thin VB.NET wrapper around very outdated, vulnerable, unsupported third-party code.

Maybe other shops had a lot of pure VB6 code, though.


VB.NET and C# were released concurrently, weren't they?


Yes. I thought he wrote VB, not VB.NET.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: