知识屋:更实用的电脑技术知识网站
所在位置:首页 > 教育

应该先学c还是c++?

发表时间:2022-03-24来源:网络

首先晒出答案:先学C语言,有兴趣再学C++.

首先看programming language ranking,https://www.geeksforgeeks.org/top-10-programming-languages-of-the-world-2019-to-begin-with/ 网站上最新排行 C/C++排列第四。

4. C/CPP

“Old is gold” – C has proved this quote in different ways. Being introduced in the late 1970s, C has made a strong contribution to the world of programming.

C has been the parent language of a handful; some are either derived from C or inspired by its syntax, constructs, and paradigms, including Java, Objective-C, and C#.

Even, nowadays, it is seen, whenever there is a need to build high-performance applications, C remains the most popular choice.

Linux OS is C based. And CPP is the hybrid version of C. C++ is an object-oriented programming language and which is built on C; therefore it is preferred over others for designing higher-level applications.

C++ is seeing as more performing than dynamically typed languages because the code is type-checked before it is executed on real grounds. Core areas of developments are Virtual Reality, gaming, computer graphics etc.

C语言从上个世纪70年代开始至今,长盛不衰,常年高居排行榜前列,足以说明该语言的生命力。

C语言足以称为众多语言之父,许多编程语言要么语法由C语言演变而来要么是受其启发。比如Java, Objective-C, C#。

C++是面向对象编程语言,可以说它是建立在C语言之上的。语法兼容,有些许差异。

我本人在上大学时,第一门高级编程语言在C和C++中选择了C,对于初次接触编程,如果你不是足够有天赋,C语言已经是足以挑战你。如果你很理解C语言的指针,灵活运用它,需要足够多的锤炼和编程代码的洗礼。很多经验只有在犯错之后才恍然大悟。

C语言对变量的定义, 类型转换,赋值操作等语法要求严格,强类型检查。上手自然没有如今广受欢迎的python,java那么容易。但是试想一下,学会了C语言的语法,其它编程语言反而容易触类旁通。

C语言也是底层编程的首选语言,linux kernel,驱动开发,firmware开发,嵌入式系统底层,大多是C语言编写。如果你日后有兴趣向底层高手发展,熟练掌握C语言是基础。

回到C++来说几句。

如果熟练掌握了C语言,再学习C++,一些基本语法如变量定义,赋值,表达式,循环控制,如do while/for, array,struct,pointer,都是一致的。后面进阶学习C++的class,面向对象编程的概念,比如构造函数,析构函数,继承等,还有STL等,你感觉又是面向了一片大海,足以你放飞自我,让编程的梦想驰骋,面向对象,你发现可以写出更加优雅的代码,标准模板库,让你发现有更多的工具来构架你的大厦了,只是你付出更多的努力和汗水.

收藏
  • 人气文章
  • 最新文章
  • 下载排行榜
  • 热门排行榜