How to Learn C Language

Source: Internet
Author: User

Original article: http://coolshell.cn/articles/4102.html
Author: Chen Hao

Someone asked the following questions on the message board of cool shell.

Keep_walker:
I saw this article this evening.
Http://programmers.stackexchange.com/questions/62502/small-c-projects

I also encountered the same problem as a foreigner who asked questions .. Can you give me some suggestions for programmers who have such troubles? Thank you!

I believe that this may be a problem for many of my friends. I used to feel like this. When programming was reached, I found that the capability reached the bottleneck, which was neither deep nor solid. For example, if you have been using Java and. Net for a long time, these virtual machine languages are convenient for development, but may not be very good for programmers for two reasons:

  1. The Virtual Machine shields system calls from the operating system and many underlying mechanisms.
  2. A large number of encapsulated class libraries also shield a lot of implementation details.

After a while, you will find that you know and do not know why .. I used to write an article on csdn 《Analysis of the selector mechanism of the Java NiO class library (Up, down, continued)", I mentioned in that article that Java programmers do not understand the underlying implementation, so it is difficult to learn the technology more solidly. At this time, some programmers will naturally want to learn the underlying technology. Naturally, the C language will be mentioned.

The following are some suggestions for this friend:

  • Encourage and applaud you. I encourage you to learn the idea and spirit of the C language. Many people think that the C language is actually not good. (You can check out the questions about C language.) today, this society pays more attention to those fashionable technologies than the C language that has been popular for more than 40 years.If a technology is popular for more than 40 years, this is the technology you need to pay attention to and learn.Instead of the new technologies (over-hyped technologies, Windows Programming history ). This is a solid spirit.
  • Do not make excuses. It is not easy to go down this road. Don't make excuses for yourself. What I do not like most is"Busy, no time. I used to work on projects in a bank. From AM to AM. From Monday to Saturday, I can take one hour to read books and research every day. I can read five or six books in a year. My current work project and recruitment tasks are very tight. I just gave birth to a child with only me and my wife. I still need to prepare for the lecture, but I still can find time to read articles and write articles to maintain the cool shell. So, I can tell you,"Time is like a cleavage, as long as you are willing to squeeze, there will be".
  • Learn C language and System Programming. I think learning programming well has four aspects:Language, Algorithm and data structure, system call and Design.

    • Language. I can tell you that the C language has two theme values: Memory Management and pointer! More than 90% of C/C ++ serious errors in the world are related to these two errors. Don't read tan haoqiang's book. It's a bad book. We recommend this book to you: C programming language (version 2nd · New Version)
    • Algorithm and Data Structure. In my opinion, using C language to implement algorithms and data structures is the best thing. We recommend you read this book-algorithm: C language implementation (1st ~ 4) basic knowledge, data structure, sorting and search (3rd of the original book), and the classic introduction to Algorithms
    • System Programming. Two books are recommended for Windows: Windows
      Programming and Windows core programming. We recommend two books under Unix/Linux: "UNIX advanced environment programming" and "UNIX Network Programming volume 1, socket, UNIX Network Programming volume 2, inter-process communication, especially UNIX network programming, is the same for both Windows and Unix/Linux.
    • System Design. In terms of design, I fully recommend "Unix programming art". After reading it, you will understand what a true programming culture is. Then, when you see some comments from Windows fans, you will know what a smile is.

If you can finish reading these books within 2-3 years and fully understand them, then you will understand what it feels like! It took me five years to complete these books. Good luck! Effort!

--- Update ---

I think this article is mainly intended to tell you a few things:

  • When programming, you need to understand the underlying system mechanism. Otherwise, you do not know why.
  • I did not deny the logic of non-C programmers. The true logic is-if you want to understand the underlying mechanism, please learn C language and operating system.
  • More than 40 years of UNIX/C experience is far-reaching. Including windows. If you want to get familiar with Unix, you must understand UNIX. That is the true root of computer culture.
  • Do not think over questions. For example, do not think that a DBA will not consider the Memory Page of the database engine. Do not assume that web programmers do not need to understand the running performance and TCP/IP of backend servers and scripts.

Masters often have strong basic system knowledge, and superficial things are always superficial.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.