During the last 4 weeks, I started to write a small 3D editor
. I started it in C#, using Irrlicht.NET
for the UI. But three days ago, I decided that it would be better to stop development and restart it with C++ and wxWidgets
, before it would be too advanced. The main reason behind this decision was that it would be simpler to improve Irrlicht simultaneous with the Editor, and easier to try out different approaches to new features, because writing everything in C++ removes the need to write and use wrapper code in managed C++. So I sat down and ported - or better - completely rewrote the editor from scratch. This is the result:
A simple 3D editor, with nearly the same functionality, once written in C# and once in C++
There are small differences between these two versions, for example some toolbar icons or menu entries are still missing, and the docking controls look a bit different due to the completely unrelated used docking frameworks, but everything works and is usable. It is quite interesting to compare the results of this work. For example, the common myth (which I believed too, until now) that you are developing applications faster with C# is now dead for me. You cannot compare the development time of these editors (about 32 hours for the C# version and about 5 for the C++ version) because a lot of user interface research went into the first one. But you can compare amount of code: The C#/windows.forms editor needs about 70 KB of code, while C++/wxWidgets only needs 36 KBytes. Thats quite a difference. And interestingly, the code does exactly the same on both sides, I'm using libraries for the same stuff in both versions.
And there is another interesting thing: The C++/wxWidgets version is way faster. The C++ application starts up instantly (C# version always needs some seconds), all views and trees update faster, moving of windows is faster (repainting 3D stuff) and I even have the subjective impression that clicking buttons is presenting results faster. So now, where is the advatage of C# again? I'm a C# fan, but now a bit disillusioned. But who knows, maybe C# just is a bit slower when it works with mixed mode assemblies.