除了OOP,还有什么使c++比C更好呢

时间:2023-01-15 12:55:13

Well that may sound like a troll question, but since C++ seems hard to fully master (and I never really knew STL was actually "part" of it), I wanted to know what are the disadvantages to use C instead of C++ when not relying much on OOP.

这听起来像是一个巨怪问题,但由于c++似乎很难完全掌握(而且我从来都不知道STL实际上是它的“一部分”),我想知道在不太依赖OOP的情况下,使用C而不是c++有什么缺点。

C++ can have a very much sophisticated syntax sometimes, which is kinda confusing me while trying to use OGRE3D for example...

c++有时可能有非常复杂的语法,这让我在尝试使用OGRE3D时有点困惑……

9 个解决方案

#1


10  

Why C++ is better than C? Besides the obvious list of features, in my opinion the real answer is that there's no good reason to still use C instead of C++. Even if you don't use OOP, you can use it as a better C. Even if you use just once a unique feature of C++ in your program, C++ is already a winner.

为什么c++比C好?除了明显的特性列表之外,在我看来,真正的答案是没有好的理由继续使用C而不是c++。即使不使用OOP,也可以将它用作更好的C。

On the other hand, there's no disadvantage in using C++: it retains the performance goals of C and it is a quite low level language, while allowing very powerful things. And you will not miss any C feature using C++!

另一方面,使用c++也没有什么缺点:它保留了C的性能目标,并且是一种非常低级的语言,同时允许使用非常强大的东西。而且你不会错过任何一个C功能使用c++ !

And don't forget the wide user base and the rich libraries and frameworks available.

不要忘记广泛的用户基础和丰富的库和框架。

By the way, C99 has added some interesting features but after a decade there's still very limited compiler support (so you are bound to ANSI C). In the meantime C++ evolved as well and the compiler vendors are committed to providing conforming implementations.

顺便说一下,C99添加了一些有趣的特性,但是在10年之后,仍然有非常有限的编译器支持(所以你被绑定到ANSI C),同时c++也得到了发展,编译器供应商致力于提供一致的实现。

#2


65  

Non-OO features that C++ has that C does not:

C++具有C不具备的非oo特性:

  1. Templates
  2. 模板
  3. Function overloading
  4. 函数重载
  5. References
  6. 参考文献
  7. Namespaces
  8. 名称空间
  9. You can use structs and enums without writing struct or enum before every declaration or using typedefs.
  10. 您可以在每个声明或使用typedefs之前使用struct和enums,而不编写struct或enum。
  11. Even if you don't define your own classes, using C++'s string and container classes is still often more convenient and safe to work with than c-style strings and arrays.
  12. 即使您没有定义自己的类,使用c++的字符串和容器类仍然比使用C风格的字符串和数组更方便和安全。
  13. Type safety (even though some would call it weak)
  14. 类型安全性(尽管有些人会说它很弱)
  15. Exceptions
  16. 异常
  17. Variable declarations in conditionals, C99 only has it in for
  18. 条件语句中的变量声明,C99中只有for

#3


22  

I'm a big fan of C who over time has become a big fan of C++. One of the big reasons for that is the STL ( the Standard Template Library ) and Boost.

我是C的超级粉丝,随着时间的推移,我已经成为c++的超级粉丝了。其中一个重要的原因是STL(标准模板库)和Boost。

Between the two of them it makes it very easy to write powerful portable applications.

在两者之间,编写功能强大的可移植应用程序非常容易。

#4


11  

One "feature" that hasn't been mentioned much (but I think is noteworthy) is that the C++ compiler community seems to be willing to go to a lot more work to produce conforming implementations. Back when the standard that eventually became C89/90 was in work, nearly every compiler vendor worked at conforming with the latest drafts of the standard, and (especially when the standard was close to complete) really put a lot of work into conforming as closely as they could.

一个尚未被提及的“特性”(但我认为值得注意)是,c++编译器社区似乎愿意做更多的工作来生成符合标准的实现。当最终成为C89/90的标准在工作时,几乎所有的编译器供应商都在遵循标准的最新草案,并且(特别是当标准接近完成时)确实尽可能地将大量的工作投入到一致性中。

That's no longer the case. The C99 standard was (obviously enough) completed over a decade ago, but there's still basically only one implementation that makes a serious attempt at conforming with the whole standard (Comeau). A few others (e.g., gcc) have added some C99 features, but are still missing a fair number of others. One (pcc) is in the rather paradoxical position of having added nearly all of the features specific to C99, but doesn't come very close to meeting the requirements of C89/90.

现在已经不是这样了。C99标准(显然已经足够)在十多年前完成了,但是基本上只有一个实现试图与整个标准(comau)保持一致。其他一些(例如,gcc)已经添加了一些C99特性,但是仍然缺少很多其他的特性。一个(pcc)处于一个相当矛盾的位置,添加了几乎所有C99特有的特性,但是并没有非常接近C89/90的要求。

Given the complexity of C++, producing a conforming implementation is a much more difficult task. Despite this, I'd guess there are already more implementations that are at least really close to conforming with C++ 0x (due to be ratified a year or two from now) than with C99 (ratified roughly a decade ago). Just to pick an arbitrary number, I'd expect to see 3 conforming1 implementations of C++0x sooner than 3 conforming implementations of C99 (in fact, I'd almost expect that many the day it's ratified).

考虑到c++的复杂性,生成符合标准的实现要困难得多。尽管如此,我猜想,与C99(大约十年前批准的)相比,已经有更多的实现至少接近于符合c++ 0x(将在一两年后批准)。为了挑选一个任意的数字,我希望看到c++ 0x的3个实现比C99的3个符合要求的实现早(事实上,我几乎期望在它被批准的那天会有这么多)。

  1. Of course, "conforming" in this case means "to a practical degree" -- I'm pretty sure every implementation of C and C++ has at least a few defects that prevents perfect conformance. The same is true for most other languages, the only obvious exceptions being languages that are defined in terms of a particular implementation.
  2. 当然,在这种情况下,“遵从”意味着“在实际的程度上”——我非常确信,C和c++的每个实现都至少有一些缺陷,这些缺陷阻止了完美的一致性。大多数其他语言也是如此,唯一明显的例外是根据特定实现定义的语言。

#5


6  

References are done automatically and much safer compared to pointers, the standard library is far more extensive, templates make code extremely customizable and substantially faster and safer. C++ offers fantastic code use/reuse and organization. Also, if you don't rely much on OOP, then you're doing it wrong. There's times when objects are not appropriate, but they're not the majority of scenarios.

与指针相比,引用是自动完成的,而且更安全,标准库更广泛,模板使代码变得非常可定制,并且大大加快和安全。c++提供了出色的代码使用/重用和组织。此外,如果您不太依赖OOP,那么您就做错了。有时候,对象是不合适的,但它们并不是大多数场景。

#6


3  

[Note: this is a subjective response but the question itself tends to invoke subjective responses by nature].

[注:这是一种主观回答,但问题本身往往会引起主观回答]。

C++ is a multi-paradigm language and there's a lot more to it than OOP. However, to suggest it's simply better than C is a bit... bold. :-D In the hands of an experienced C coder, and for the right purposes, C code can be very elegant and simple. Consider the Lua interpreter which is coded in C; it compiles to a very small binary which would have likely been a lot bigger even in the hands of an equally skilled C++ programmer, and is therefore well-suited for embedded use. C generally won't be as safe (ex: implicit casting, requires manual resource cleanup, etc) which is one thing which C++ strives to do a little better than C, but it also won't burden the programmer with awkward casting syntax (in C++ one shouldn't need to cast often, but in C it's quite common), e.g.

c++是一种多范式语言,它比OOP有更多的含义。然而,说它比C更好就有点……大胆。:-D在一个有经验的C程序员手中,为了正确的目的,C代码可以非常优雅和简单。考虑用C编写的Lua解释器;它编译成一个非常小的二进制文件,即使在同样熟练的c++程序员手中,这个文件也可能要大得多,因此非常适合嵌入式应用。C一般不会像安全(例:隐式铸造、需要人工资源清理,等等),c++是一件事,努力做一个比C,但它也不会负担程序员与尴尬的铸造语法(在c++中通常不需要演员,但在C语言中很常见),例如:

On the other hand, and I'm trying to speak very generally, C++ can actually make it easier to write more efficient code, particularly for code that needs to work across multiple types. The qsort vs std::sort benchmarks are a classic example of this and how C++, through templates and inlined function objects, can provide cost-free abstractions. In C one would have to write a separate sorting algorithm for every type by hand or stuff it in a macro to achieve comparable results.

另一方面,我正试图非常笼统地说,c++实际上可以使编写更高效的代码变得更容易,特别是对于需要跨多种类型工作的代码。qsort vs std::sort基准测试就是一个典型的例子,c++是如何通过模板和内联函数对象提供无成本抽象的。在C语言中,我们需要为每种类型编写一个单独的排序算法,或者把它放在一个宏中,以获得类似的结果。

Most C++ programmers who migrated from C never look back. I might be an oddball, but I still find C to be useful for implementing small scale libraries. For a start, it's a bit easier to port and builds super fast. For these kinds of things, I take implicit casting for granted. I would hate to work with any C code on a large scale, however, and have unfortunately have to do this from time to time.

大多数从C迁移过来的c++程序员都不会回头看。我可能是个怪人,但我仍然发现C对于实现小型库很有用。首先,移植和快速构建要容易一些。对于这类事情,我认为是理所当然的。但是,我不喜欢大规模使用任何C代码,不幸的是,我不得不时不时地这么做。

As for specific differences, sepp2k already pointed out a pretty comprehensive list.

至于具体的差异,sepp2k已经列出了一个相当全面的清单。

#7


2  

Other than the upsides that sepp2k noted (and I aggree with) it certainly also has some little downsides that have not directly to do with OO. Come to mind the lack of __VA_ARGS__ for the preprocessor and the context sensitivity. Consider something like:

除了sepp2k指出(我也同意)的好处之外,它当然也有一些与OO没有直接关系的小缺点。首先要考虑到预处理程序和上下文敏感性缺乏__VA_ARGS__。考虑类似:

switch (argc) {
 case 1: /* empty statement */;
         toto T;
 case 2: break;
}

In C, whenever the compiler encounters such a piece of code, and argc and toto are known, this is valid. (Sure we might get a warning for the unitialized T afterwards, whence we use it.)

在C语言中,每当编译器遇到这样一段代码,并且argc和toto是已知的,这是有效的。(当然,我们可能会得到一个警告,让我们使用它。)

In C++ this depends on the type toto. If it is a POD, everything is fine (well, as fine as for C). If it has a constructor the code is not valid: jump to case label crosses initialization of 'toto T'.

在c++中,这取决于类型toto。如果它是一个POD,那么一切都很好(好吧,就像C一样好)。如果它有一个构造函数,那么代码就不是有效的:跳转到case标签,将“toto T”的初始化。

So in some sense, for C++ you must understand the underlying types to see if a control flow is valid.

因此,在某种意义上,对于c++,您必须了解底层类型,以查看控制流是否有效。

#8


2  

One reason to write libraries in C is that it is very easy to use that library across languages since the C ABI is very simple, compared to the name-mangling mess that is C++ ABI. Creating C interfaces to the C++ libs might be a decent solution, but if you can express your API easily with C syntax, why write it in C++ to begin with?

用C编写库的一个原因是,它可以很容易地跨语言使用该库,因为与c++ ABI相比,C ABI非常简单。为c++ libs创建C接口可能是一个不错的解决方案,但是如果您可以用C语法轻松地表达您的API,为什么要以c++开始呢?

Many C99 features are very nice, and are still not in C++.

许多C99特性都很不错,但在c++中还没有。

#9


1  

You can continue to write essentially C code but compile it as C++ and get the benefit of stronger type checking, and therefore more robust code.

您可以继续编写本质上是C的代码,但将其编译为c++,并获得更强的类型检查的好处,从而获得更健壮的代码。

You can then if you wish introduce the useful elements of C++ that have nothing to do with OO, such as a built-in bool, function overloading, and better defined const handling (no need to use macros for literal constant symbols).

然后,如果您希望引入与OO无关的c++的有用元素,例如内置bool、函数重载和更好定义的const处理(不需要对常量符号使用宏),则可以引入。

It is not even too much of a stretch to using some of the easier to understand and use elements of the standard library such as std::string and iostreams, and even std::vector as a "better array"; you do not have to learn much C++ or understand OOP to take advantage of these improved interfaces.

使用一些更容易理解和使用标准库的元素,比如std::string和iostreams,甚至std::vector是“更好的数组”;您不必学习太多c++或理解OOP,就可以利用这些改进的接口。

Between OOP an procedural programming there is an intermediate Object Based Programming, which C++ supports and which is simpler to understand and learn and almost as useful as full OOP. Basically it uses abstract data types rather than full classes and eschews inheritance and polymorphism. To be honest it is what many C++ programmers write in any case.

在OOP的过程编程中,有一个基于中间对象的编程,它支持c++,它更易于理解和学习,并且几乎和full OOP一样有用。基本上,它使用抽象的数据类型而不是完整的类,避免继承和多态性。老实说,这是许多c++程序员在任何情况下写的东西。

#1


10  

Why C++ is better than C? Besides the obvious list of features, in my opinion the real answer is that there's no good reason to still use C instead of C++. Even if you don't use OOP, you can use it as a better C. Even if you use just once a unique feature of C++ in your program, C++ is already a winner.

为什么c++比C好?除了明显的特性列表之外,在我看来,真正的答案是没有好的理由继续使用C而不是c++。即使不使用OOP,也可以将它用作更好的C。

On the other hand, there's no disadvantage in using C++: it retains the performance goals of C and it is a quite low level language, while allowing very powerful things. And you will not miss any C feature using C++!

另一方面,使用c++也没有什么缺点:它保留了C的性能目标,并且是一种非常低级的语言,同时允许使用非常强大的东西。而且你不会错过任何一个C功能使用c++ !

And don't forget the wide user base and the rich libraries and frameworks available.

不要忘记广泛的用户基础和丰富的库和框架。

By the way, C99 has added some interesting features but after a decade there's still very limited compiler support (so you are bound to ANSI C). In the meantime C++ evolved as well and the compiler vendors are committed to providing conforming implementations.

顺便说一下,C99添加了一些有趣的特性,但是在10年之后,仍然有非常有限的编译器支持(所以你被绑定到ANSI C),同时c++也得到了发展,编译器供应商致力于提供一致的实现。

#2


65  

Non-OO features that C++ has that C does not:

C++具有C不具备的非oo特性:

  1. Templates
  2. 模板
  3. Function overloading
  4. 函数重载
  5. References
  6. 参考文献
  7. Namespaces
  8. 名称空间
  9. You can use structs and enums without writing struct or enum before every declaration or using typedefs.
  10. 您可以在每个声明或使用typedefs之前使用struct和enums,而不编写struct或enum。
  11. Even if you don't define your own classes, using C++'s string and container classes is still often more convenient and safe to work with than c-style strings and arrays.
  12. 即使您没有定义自己的类,使用c++的字符串和容器类仍然比使用C风格的字符串和数组更方便和安全。
  13. Type safety (even though some would call it weak)
  14. 类型安全性(尽管有些人会说它很弱)
  15. Exceptions
  16. 异常
  17. Variable declarations in conditionals, C99 only has it in for
  18. 条件语句中的变量声明,C99中只有for

#3


22  

I'm a big fan of C who over time has become a big fan of C++. One of the big reasons for that is the STL ( the Standard Template Library ) and Boost.

我是C的超级粉丝,随着时间的推移,我已经成为c++的超级粉丝了。其中一个重要的原因是STL(标准模板库)和Boost。

Between the two of them it makes it very easy to write powerful portable applications.

在两者之间,编写功能强大的可移植应用程序非常容易。

#4


11  

One "feature" that hasn't been mentioned much (but I think is noteworthy) is that the C++ compiler community seems to be willing to go to a lot more work to produce conforming implementations. Back when the standard that eventually became C89/90 was in work, nearly every compiler vendor worked at conforming with the latest drafts of the standard, and (especially when the standard was close to complete) really put a lot of work into conforming as closely as they could.

一个尚未被提及的“特性”(但我认为值得注意)是,c++编译器社区似乎愿意做更多的工作来生成符合标准的实现。当最终成为C89/90的标准在工作时,几乎所有的编译器供应商都在遵循标准的最新草案,并且(特别是当标准接近完成时)确实尽可能地将大量的工作投入到一致性中。

That's no longer the case. The C99 standard was (obviously enough) completed over a decade ago, but there's still basically only one implementation that makes a serious attempt at conforming with the whole standard (Comeau). A few others (e.g., gcc) have added some C99 features, but are still missing a fair number of others. One (pcc) is in the rather paradoxical position of having added nearly all of the features specific to C99, but doesn't come very close to meeting the requirements of C89/90.

现在已经不是这样了。C99标准(显然已经足够)在十多年前完成了,但是基本上只有一个实现试图与整个标准(comau)保持一致。其他一些(例如,gcc)已经添加了一些C99特性,但是仍然缺少很多其他的特性。一个(pcc)处于一个相当矛盾的位置,添加了几乎所有C99特有的特性,但是并没有非常接近C89/90的要求。

Given the complexity of C++, producing a conforming implementation is a much more difficult task. Despite this, I'd guess there are already more implementations that are at least really close to conforming with C++ 0x (due to be ratified a year or two from now) than with C99 (ratified roughly a decade ago). Just to pick an arbitrary number, I'd expect to see 3 conforming1 implementations of C++0x sooner than 3 conforming implementations of C99 (in fact, I'd almost expect that many the day it's ratified).

考虑到c++的复杂性,生成符合标准的实现要困难得多。尽管如此,我猜想,与C99(大约十年前批准的)相比,已经有更多的实现至少接近于符合c++ 0x(将在一两年后批准)。为了挑选一个任意的数字,我希望看到c++ 0x的3个实现比C99的3个符合要求的实现早(事实上,我几乎期望在它被批准的那天会有这么多)。

  1. Of course, "conforming" in this case means "to a practical degree" -- I'm pretty sure every implementation of C and C++ has at least a few defects that prevents perfect conformance. The same is true for most other languages, the only obvious exceptions being languages that are defined in terms of a particular implementation.
  2. 当然,在这种情况下,“遵从”意味着“在实际的程度上”——我非常确信,C和c++的每个实现都至少有一些缺陷,这些缺陷阻止了完美的一致性。大多数其他语言也是如此,唯一明显的例外是根据特定实现定义的语言。

#5


6  

References are done automatically and much safer compared to pointers, the standard library is far more extensive, templates make code extremely customizable and substantially faster and safer. C++ offers fantastic code use/reuse and organization. Also, if you don't rely much on OOP, then you're doing it wrong. There's times when objects are not appropriate, but they're not the majority of scenarios.

与指针相比,引用是自动完成的,而且更安全,标准库更广泛,模板使代码变得非常可定制,并且大大加快和安全。c++提供了出色的代码使用/重用和组织。此外,如果您不太依赖OOP,那么您就做错了。有时候,对象是不合适的,但它们并不是大多数场景。

#6


3  

[Note: this is a subjective response but the question itself tends to invoke subjective responses by nature].

[注:这是一种主观回答,但问题本身往往会引起主观回答]。

C++ is a multi-paradigm language and there's a lot more to it than OOP. However, to suggest it's simply better than C is a bit... bold. :-D In the hands of an experienced C coder, and for the right purposes, C code can be very elegant and simple. Consider the Lua interpreter which is coded in C; it compiles to a very small binary which would have likely been a lot bigger even in the hands of an equally skilled C++ programmer, and is therefore well-suited for embedded use. C generally won't be as safe (ex: implicit casting, requires manual resource cleanup, etc) which is one thing which C++ strives to do a little better than C, but it also won't burden the programmer with awkward casting syntax (in C++ one shouldn't need to cast often, but in C it's quite common), e.g.

c++是一种多范式语言,它比OOP有更多的含义。然而,说它比C更好就有点……大胆。:-D在一个有经验的C程序员手中,为了正确的目的,C代码可以非常优雅和简单。考虑用C编写的Lua解释器;它编译成一个非常小的二进制文件,即使在同样熟练的c++程序员手中,这个文件也可能要大得多,因此非常适合嵌入式应用。C一般不会像安全(例:隐式铸造、需要人工资源清理,等等),c++是一件事,努力做一个比C,但它也不会负担程序员与尴尬的铸造语法(在c++中通常不需要演员,但在C语言中很常见),例如:

On the other hand, and I'm trying to speak very generally, C++ can actually make it easier to write more efficient code, particularly for code that needs to work across multiple types. The qsort vs std::sort benchmarks are a classic example of this and how C++, through templates and inlined function objects, can provide cost-free abstractions. In C one would have to write a separate sorting algorithm for every type by hand or stuff it in a macro to achieve comparable results.

另一方面,我正试图非常笼统地说,c++实际上可以使编写更高效的代码变得更容易,特别是对于需要跨多种类型工作的代码。qsort vs std::sort基准测试就是一个典型的例子,c++是如何通过模板和内联函数对象提供无成本抽象的。在C语言中,我们需要为每种类型编写一个单独的排序算法,或者把它放在一个宏中,以获得类似的结果。

Most C++ programmers who migrated from C never look back. I might be an oddball, but I still find C to be useful for implementing small scale libraries. For a start, it's a bit easier to port and builds super fast. For these kinds of things, I take implicit casting for granted. I would hate to work with any C code on a large scale, however, and have unfortunately have to do this from time to time.

大多数从C迁移过来的c++程序员都不会回头看。我可能是个怪人,但我仍然发现C对于实现小型库很有用。首先,移植和快速构建要容易一些。对于这类事情,我认为是理所当然的。但是,我不喜欢大规模使用任何C代码,不幸的是,我不得不时不时地这么做。

As for specific differences, sepp2k already pointed out a pretty comprehensive list.

至于具体的差异,sepp2k已经列出了一个相当全面的清单。

#7


2  

Other than the upsides that sepp2k noted (and I aggree with) it certainly also has some little downsides that have not directly to do with OO. Come to mind the lack of __VA_ARGS__ for the preprocessor and the context sensitivity. Consider something like:

除了sepp2k指出(我也同意)的好处之外,它当然也有一些与OO没有直接关系的小缺点。首先要考虑到预处理程序和上下文敏感性缺乏__VA_ARGS__。考虑类似:

switch (argc) {
 case 1: /* empty statement */;
         toto T;
 case 2: break;
}

In C, whenever the compiler encounters such a piece of code, and argc and toto are known, this is valid. (Sure we might get a warning for the unitialized T afterwards, whence we use it.)

在C语言中,每当编译器遇到这样一段代码,并且argc和toto是已知的,这是有效的。(当然,我们可能会得到一个警告,让我们使用它。)

In C++ this depends on the type toto. If it is a POD, everything is fine (well, as fine as for C). If it has a constructor the code is not valid: jump to case label crosses initialization of 'toto T'.

在c++中,这取决于类型toto。如果它是一个POD,那么一切都很好(好吧,就像C一样好)。如果它有一个构造函数,那么代码就不是有效的:跳转到case标签,将“toto T”的初始化。

So in some sense, for C++ you must understand the underlying types to see if a control flow is valid.

因此,在某种意义上,对于c++,您必须了解底层类型,以查看控制流是否有效。

#8


2  

One reason to write libraries in C is that it is very easy to use that library across languages since the C ABI is very simple, compared to the name-mangling mess that is C++ ABI. Creating C interfaces to the C++ libs might be a decent solution, but if you can express your API easily with C syntax, why write it in C++ to begin with?

用C编写库的一个原因是,它可以很容易地跨语言使用该库,因为与c++ ABI相比,C ABI非常简单。为c++ libs创建C接口可能是一个不错的解决方案,但是如果您可以用C语法轻松地表达您的API,为什么要以c++开始呢?

Many C99 features are very nice, and are still not in C++.

许多C99特性都很不错,但在c++中还没有。

#9


1  

You can continue to write essentially C code but compile it as C++ and get the benefit of stronger type checking, and therefore more robust code.

您可以继续编写本质上是C的代码,但将其编译为c++,并获得更强的类型检查的好处,从而获得更健壮的代码。

You can then if you wish introduce the useful elements of C++ that have nothing to do with OO, such as a built-in bool, function overloading, and better defined const handling (no need to use macros for literal constant symbols).

然后,如果您希望引入与OO无关的c++的有用元素,例如内置bool、函数重载和更好定义的const处理(不需要对常量符号使用宏),则可以引入。

It is not even too much of a stretch to using some of the easier to understand and use elements of the standard library such as std::string and iostreams, and even std::vector as a "better array"; you do not have to learn much C++ or understand OOP to take advantage of these improved interfaces.

使用一些更容易理解和使用标准库的元素,比如std::string和iostreams,甚至std::vector是“更好的数组”;您不必学习太多c++或理解OOP,就可以利用这些改进的接口。

Between OOP an procedural programming there is an intermediate Object Based Programming, which C++ supports and which is simpler to understand and learn and almost as useful as full OOP. Basically it uses abstract data types rather than full classes and eschews inheritance and polymorphism. To be honest it is what many C++ programmers write in any case.

在OOP的过程编程中,有一个基于中间对象的编程,它支持c++,它更易于理解和学习,并且几乎和full OOP一样有用。基本上,它使用抽象的数据类型而不是完整的类,避免继承和多态性。老实说,这是许多c++程序员在任何情况下写的东西。