Home > Articles > Programming > C#

  • Print
  • + Share This
Like this article? We recommend

Like this article? We recommend

Conclusion

A study of C++ and C# can tell a lot about the computing eras in which these languages were created. C++ is rooted firmly in the world of the C language and the early days of PC-based OOP, while C# draws on the C++ heritage as well as borrowing heavily from Java. Given the relationship to Java, C# provides good support for the three pillars of OOP: encapsulation, inheritance, and polymorphism. One thing missing from the technology scene is the ability to join Java and C# code. This would open up the Windows platform to the Java world.

Porting from C++ to C# is a relatively mechanical process that could lend itself to at least partial automation. The SharpDevelop tool is useful in undertaking such a translation. To illustrate, I took some pure C++ code and ported it to C# in a few hours. One area of C# that helps to simplify translation is the fact that C# is a managed language. The latter obviates the need for complex resource de-allocation destructor code. Providing objects fall out of scope, there should be no memory leakage.

C# provides good support for inheritance and polymorphism and in some cases, it is potentially more type-safe than C++. All my example code is included in both SharpDevelop project form and as an executable.

  • + Share This
  • 🔖 Save To Your Account