如果您有大量需要重写的遗留代码,我认为切换到不同的语言没有商业意义。 即使使用不同的语言可以带来好处(这是值得怀疑的),测试和调试新代码的成本也足以克服这些好处。 您还有一个 C++ 专家的开发团队。 当他们加快学习新语言的速度时,生产力会大幅下降。
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.
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.
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.
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.
Have a look at pythonocc. Its provides you with a python module that wraps the OpenCASCADE CAD kernel. OpenCASCADE is the sole industry strength open source kernel I'm aware of. Nice features are STEP and IGES support and the ability to generate FEM meshes from BRep data.
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...
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 Open source cad drawing (dwg) library in C# 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.
发布评论
评论(6)
如果您有大量需要重写的遗留代码,我认为切换到不同的语言没有商业意义。 即使使用不同的语言可以带来好处(这是值得怀疑的),测试和调试新代码的成本也足以克服这些好处。 您还有一个 C++ 专家的开发团队。 当他们加快学习新语言的速度时,生产力会大幅下降。
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.
C# 可以与 C++ 代码互操作。 您可以开始用 C# 编写新代码,并在需要时让它调用现有的 C++ 代码。 它不一定只是用于 UI。 查看 C++/CLI 和 C# 互操作方法,了解如何将现有 C++ 代码与新 C# 代码结合使用的信息。
另外,我在这里问了类似的问题:
代理服务器的 C# 性能(与 C++)
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:
C# Performance For Proxy Server (vs C++)
CAD/CAM 应用程序的计算量相当大,速度肯定是选择软件包的标准之一,因此我对转向较慢的语言持谨慎态度。
您需要非常仔细地考虑切换语言的原因。 是因为你不喜欢C++,还是因为C#会带来真正的好处。 它很可能会减慢您的应用程序的速度。 查看 C++ C# 速度比较。
计算机语言基准游戏 C++ 与 C#< /a>
以我的拙见,您最好将所有刀具路径计算保留在 C++ 中,并且如果您确实必须将任何代码移至另一种语言,请将其移至脚本语言用户可以轻松编辑,无需重新编译。
我每天在工作中使用 CAD/CAM 应用程序,UI 中的许多内容让我感到不安。 如果我能找到源头的话,它们将是简单的修复。
如果贵公司制作的 CAD/CAM 应用程序具有用我可以调整的脚本语言(Lua、Python 等)编写的 UI,我会购买一个副本。
雨果
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
看看 pythonocc。 它为您提供了一个包装 OpenCASCADE CAD 内核的 python 模块。 OpenCASCADE 是我所知道的唯一具有行业实力的开源内核。 不错的功能包括 STEP 和 IGES 支持以及从 BRep 数据生成 FEM 网格的能力。
Have a look at pythonocc. Its provides you with a python module that wraps the OpenCASCADE CAD kernel. OpenCASCADE is the sole industry strength open source kernel I'm aware of. Nice features are STEP and IGES support and the ability to generate FEM meshes from BRep data.
您需要考虑的另一件事是平台独立性 - 如果您/您的公司有可能需要将 CAD 软件迁移到 Linux/Unix(当然,为了业务决策),那将是相当痛苦的。 目前,即使是使用 MFC/Win32 调用的 C++ 也给我们带来了很多头痛......
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...
开放设计联盟库是跨平台的。 他们最近推出了其库的 .NET 版本的测试版。 请参阅我对 开源 cad 绘图 (dwg) 库的回答在 C# 中了解更多详细信息。
话虽如此,我同意这里的其他答案 - 如果它没有损坏,就不要修复它,无论是代码还是编码员。 MSFT 仍然使用 C++,ODA 也是如此 - 他们的代码库源自 C++ 和 C++。 为 .NET 包装。
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 Open source cad drawing (dwg) library in C# 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.