📜  C++ 和 Objective C 的区别

📅  最后修改于: 2021-09-15 01:36:13             🧑  作者: Mango

1. C++
C++ 或 CPP 是一种通用的静态类型面向对象的编程语言。 1979 年,一位名叫 Bjarne Stroustrup 的丹麦计算机科学家想要对 C 进行扩展,使其能够使用类。从那时起,这种种子不断扩大,并已成为全世界最常用和最知名的语言之一。它几乎适用于除网络之外的所有内容。此外,C++具有命名空间、引用、模板、隐式方法重载等特性,被印象笔记、LinkedIn、微软、opera、NASA、Facebook等成功使用。

C++的优点:

  • C++具有多态、数据封装等特性。
  • 它是一种面向对象的编程语言。
  • 低级语言同时也更容易学习。
  • 有工会和结构
  • 更便携
  • 授予用户对内存的完全访问权限
  • 可扩展性

C++的缺点:

  • 对内存的控制使代码容易出错。
  • 内存泄漏
  • 没有垃圾内存收集器
  • 不支持内置线程功能
  • 在网络中,很难调试

2.目标 C
Objective-C 是一种通用的、面向对象的编程语言,它增加了面向对象语言的语法和语义,它的行为类似于 C 编程语言的超集。它还支持跨平台应用,最近受到闲聊和C编程语言的影响。 Objective-C 是反射性的,更侧重于类,由 Brad Cox 和 Tom Love 在一家名为 Stepstone 的公司设计,并于 1984 年首次出现。现在被 Apple 用作通用的面向对象编程语言,用于其操作系统和 API。

目标 C 的优点:

  • 它是一种经过批准且经过良好测试的语言
  • 高度稳定
  • 提供对以前版本的支持
  • 更容易与私有 API 的集成
  • 与 C++ 兼容

目标 C 的缺点:

  • 更难学
  • 小社区和少数开发人员
  • 显式指针

C++ 和 Objective C 的区别:

S.NO.

C++

OBJECTIVE C

01. C++ is a general purpose, middle level, object-oriented and procedural programming language. It was also known as “C with Classes”. It is an extension of C programming language. Objective-C is a general purpose, object-oriented programming language which adds  syntax and semantics that allows for an object-oriented language and behaves like a superset of C programming language. 
02. In 1980, it was developed by Bjarne Stroustrup at bell laboratories. In 1980, it was developed by  Brad Cox and Tom Love at company Productivity Products International (PPI).
03. It supports multiple inheritance. It does not support multiple inheritance.
04. In C++, Structs and classes are treated as same. In Objective C, Structs and classes are not treated as same.
05. In C++, to call the implemented functionalities, methods are used. In Objective C, to call the implemented functionalities, messaging are used.
06. It is static typed language. It is dynamic typed language.
07. It uses true, false and bool. It uses YES and NO and BOOL.
08. It has Standard Template Library. It lacks template libraries.
09. Companies using C++ are Evernote, LinkedIn, Opera, Microsoft, NASA, and Facebook etc. Companies using Objective C are Uber, Pinterest, Instagram, Slack, Instacart etc.