Chinaunix首页 | 论坛 | 博客
  • 博客访问: 752482
  • 博文数量: 128
  • 博客积分: 7079
  • 博客等级: 少将
  • 技术积分: 1326
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-16 08:53
文章分类

全部博文(128)

文章存档

2011年(3)

2010年(12)

2009年(9)

2008年(23)

2007年(61)

2006年(20)

我的朋友

分类: C/C++

2007-12-13 10:35:34

   Every programmer should learn C during their programming career. Its benefits are too numerous to ignore. Not only will it open many more job opportunities, but it will teach you more about computers as a whole.

  1. C is lower level then other programming languages (C++, Java). Programming at a lower level allows you to further your understanding of computers, as a whole.

  2. Device drivers and operating systems are written exclusively in C. Now, you may never write a device driver or an operating system, but what if you are ever required to modify one?

  3. What if you ever want to get a job programming microcontrollers? They are programmed in C. Are you going to limit your possible list of jobs because you didn't want to learn a new language?

  4. C programs are smaller and faster then any other program created in a different language. Sometimes your program needs that speed boost that only C can give it.

  5. If you have learned C, you can learn any modern programming language. The reason behind this is that all modern programming languages are based on C (Java, C++, C#, etc).

  6. Because C has been around for many years, it has a large community and collective code base. This allows you to quickly and efficiently implement new algorithms or functions that have been programmed before.

  7. C is the language of the Open Source community. The Open Source poster child, Linux, was coded in C. If you know C, you can participate in and contribute to numerous Open Source communities like .

  8. C is the only language that teaches you what pointers really are. C# and Java skip the subject completely. It is pointers that give C its power.

  9. C is still the most commonly required language for programming jobs. It is well worth your time to get C under your belt.

  10. Anything that has a microprocessor in it has support for C. From your microwave to your cell phone, C powers technology.
Five more reasons why every programmer should learn
 
   C is not an object oriented language. Because of this, anyone who learns C has to learn to think functionally. When you do learn object oriented programming, you will have the base of C functional programming to go by. This will make learning object oriented programming easier and more enjoyable.

    1. C is not an object oriented language. Because of this, anyone who learns C has to learn to think functionally. When you do learn object oriented programming, you will have the base of C functional programming to go by. This will make learning object oriented programming easier and more enjoyable.

    2. Writing programs in C is like a mental exercise. You must take care of everything that many other languages take care of for you. You must manage your pointers, your memory allocation, and your memory deallocation. You have to figure out how you will to handle strings, and dynamic data. In other languages, all these things are hidden from you. You don't know how they work, nor can you change how they work. You trade in control and speed, for ease of use. In many cases, this is a valuable tradeoff. In other cases it is not.

    3. For different situations you will use different languages. Some situations will call for Lisp, others for Java, and still others for C++. But your solid foundation will be C. You may not use it to program certain projects, but it will assist your ability to skillfully program in other languages.

    4. Programs generated with C code are smaller and faster then programs generated from any other type of language besides Assembly. Why not learn Assembly then? Assembly is a beautiful language that can be very useful to learn, but it is not as portable as C, and popular languages like Java are based on C syntax, not Assembly. You should still learn Assembly at one point, but it will not prove as useful to you as C will.

    5. If you ever want to write a video game engine or an operating system you will need C. You can't use C#, Java, or Basic for these type of programming tasks.

How to learn C

  So you want to learn the C programming language? Good for you! Learning C will be well worth your time. Here are five steps that you can follow to learn C.

  1. Buy a C programming book. You could also use an online C programming tutorial, but from my experience, books are better. The two books I would recommend are "C Primer Plus" by Prata and "The C Programming Language" by Kernighan and Ritchie. They are both quality books.

  2. Get a compiler. A compiler will allow you to turn your C code into a program that you can run on your computer. Windows users can download or . If you are using Linux you can use GCC, which most likely came with your distribution. If you are using OSX you can use Macintosh Programmer's Workshop. All of the compilers listed above are either free or Open Source.

  3. Write your first "Hello World" program. Many people decide to quit learning C at this point. All you have to do is get over the hump of your first program, and everything follows naturally from there.

  4. Join the Open Source community and contribute to projects. You can find and join these projects at . Helping out an Open source project can teach you much about programming and professional program structure.

  5. Continue learning. With every programming language, you are never finished learning. Buy more advanced C programming books on algorithms, and data structures.

 

阅读(1064) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~