下,用C ++ [英] C over C++
本文介绍了下,用C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在什么情况下将C是一个更好的语言一起工作比C ++。我想,因为我很年轻,没有长大的基于C像其他人,所以我不知道为什么人们往往还是用C这些天,当C ++现在可用?有哪些优点Ç优惠,让人们仍然希望坚持下去?
In what situation would C be a better language to work with than C++. I guess since I'm young and wasn't brought up on C like others were, so I have no clue why people tend to still use C these days when C++ is now available? What advantages does C offer that keep people still wanting to stick to it?
推荐答案
下面是几个原因:
- 负重:许多老系统使用C已经设定,而不是C ++。在许多情况下,这是不实际的迁移。这尤其是因为成熟的应用已经找到了对付大部分东西C ++有原生提供在C,即使它并不像pretty。
- 可用性:移植C编译器的新架构是比移动C ++编译器也容易得多。因此,C是更普遍一些,尤其是在嵌入式平台。
- 简单:C ++是一个大语言,可能会有点吃不消一些人选择去处理。 C,通过比较,要简单得多。
- 尺寸:虽然您可以通过避免导致较大的二进制文件功能使C ++程序小,你最终在大多数C ++的利益错过了,不妨用C
- 更快的编译:长的时间花费C ++程序编译,特别是在大量模板code,可能会阻碍了开发周期,领导一个团队,以更快的编译C实施
- Encumbrance: Many old systems are already programmed using C, rather than C++. In many cases, it's not practical to migrate. This is especially so since mature applications have found ways to deal with most of what C++ has to offer natively in C, even if it's not quite as pretty.
- Availability: Porting a C compiler to a new architecture is much easier than moving a C++ compiler there. Therefore C is a bit more ubiquitous, especially on embedded platforms.
- Simplicity: C++ is a big language, and may be a little too much for some folks to choose to deal with. C, by comparison, is much simpler.
- Size: Although you can make a C++ program small by avoiding the features that lead to larger binaries, you end up missing out on most of the benefit of C++, may as well use C
- Faster Compile: The long time it takes for C++ programs to compile, especially in heavily templated code, may obstruct the development cycle and lead a team to a faster compiling C implementation.
这篇关于下,用C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文