tags:

views:

697

answers:

6

Hello,

Is it possible to do CAD/CAM software without having to use C++? My company developed their software with c/C++ but that was more than 10 years ago. Today,there is a lot of legacy code that switching would force us to get rid of but i was wondering what the actual risks are. We have a lot of mathematical algorithms for toolpath calculations, feature recognition and simulation and 3D Rendering and i was wondering if C# can handles all of that without great performance loss.

Is it a utopia to rewrite such algorithms in c# or should that language only deal with UI. We are not talking about game development here (Halo 3 or Call Of Duty) so how much processing does CAD/CAM really need?

Can anybody enlighten me on this matter? Most of my colleagues are hardcore C++ programmers and although i program in c++ i love .NET but i am having a hard time selling .NET to them other than basic UI. Does it make sense to consider switching to .NET in such a field, or is it just not a wise idea?

Thank you

+11  A: 

If you have a lot of legacy code that would need to be rewritten, I don't see it making business sense to switch to a different language. Even if there were gains to be had from using a different language (which is questionable), the cost of testing and debugging the new code would more than overcome them. You also have a development team that are experts in C++. There would be a big productivity drop while they came up to speed on the new language.

KeithB
Rewrite legacy code must be done only there is a real crisis. Such a crisis for example is when your main language/platform vendor is about to promote another one. This case could happen for example if Microsoft decided to leave it's C++ toolchain in favor of the .NET one.
Gabriel Cuvillier
+3  A: 

C# Can interop with C++ code. You can start writing new code in C# and have it call existing c++ code when needed. It wouldn't have to be just for UI. Look into C++/CLI and the C# Interop methods for information on how to use existing c++ code with new C# code.

Also, I asked a similar question here: http://stackoverflow.com/questions/30729/c-performance-for-proxy-server-vs-c

NotDan
+1  A: 

CAD/CAM applications are fairly calculation intensive, and speed will definitely be one of the criteria for selecting a package, so I would be wary of moving to a slower language.

You need to think very carefully about the reasons for switching language. Is it because you don't like C++, or because C# will bring real benefits. It is quite likely to slow your application down. Check out the C++ C# speed comparisons.

Computer Language Benchmarks Game C++ vs C#

In my humble opinion, you'd be better off keeping all of the toolpath calculations in C++, and if you really must move any code over to another language, move it over to a scripting language which the user can easily edit, without re-compiling.

I use CAD/CAM applications every day at work, and there are a number of things in the UI which get on my nerves. They would be simple fixes if only I could get at the source.

If your company makes a CAD/CAM application which has a UI written in a scripting language which I can tweak (Lua, Python etc), I'll buy a copy.

Hugo

Rocketmagnet
Debian Sempron are not the freshest measurements on the benchmarks game website!
igouy
A: 

Another thing you need to consider is platform independence - if there is a possibility that you/you company need to migrate your CAD software to Linux/Unix (Of course, for bussiness decision), it will be quite painful. Currently, even C++ with MFC/Win32 calls gave us many headache...

lz_prgmr
A: 

The Open Design Alliance library is cross-platform. They have recently introduced a beta of the .NET version of their library. See my answer to http://stackoverflow.com/questions/169390/open-source-cad-drawing-dwg-library-in-c/206456#206456 for more details.

Having said that I concur with the other answers here - if it ain't broken, don't fix it, both the code and the coders. MSFT still use C++, as does the ODA - their codebase originates in C++ & is wrapped for .NET.

CAD bloke
A: 

Have a look at pythonocc.org. Its provides you an open source, complete CAD api, so you can start working on an application directly. The motto of the project is Agile CAD and lives up to its promises.

Jelle