top | item 36559384

(no title)

tylercrompton | 2 years ago

Wouldn't it be easier to convert VB6 to VB.NET and then convert that to C#? The latter conversion is mostly just a find-and-replace operation, as I understand it.

discuss

order

kwhitefoot|2 years ago

Sounds like you haven't tried doing it. V6 and VB.Net are fundamentally different languages. VB.Net has much more in common with C# than it has with VB6. It is the conversion from VB6 to VB.Net that is the hard part but it is probably no harder to convert directly to C#.

In particular the way that object destruction works is completely different. VB6 using reference counting and .Net languages use a garbage collector.

Systems using reference counting destroy objects and run the destructors as soon as there are no references to the object while those using garbage collectors might only dispose of the objects when memory is low, perhaps never. This means that object lifetime can be very different and that patterns such as RAII require extra work in .Net.

fomine3|2 years ago

That's true but was VB6 programs seriously made about memory and resource management? I think it should be modernized anyway when upgrading.