开发者

I've read The C Programming Language where do I go from here?

I've read 'The C Programming Language', what should I be doing now? Is there anything important in C that's missed out in the book? Specifically interested in the Linux side of development, so is there anything important I should learn about C in Linux? (I already know some of the basics).

I'm sorry if this question seems a bit general, but i'm a little lost as to wha开发者_Python百科t to learn next.


Do the book exercises! Reading it is too little.


I'd start off by actually programming something next. Project Euler has good problems to solve that will help you get a better understanding of the language. From there you can move in to Linux-specific C programming, but definitely get your feet grounded in the C basics first.


The W. Richard Stevens books are the next place to go to, if you're interested in Linux development (they're about general UNIX-alike development, but it's all pretty much applicable to Linux).

Start with Advanced Programming In The UNIX Environment.


Many answers mention actually programming, and I would start by that if you haven't.

I would also recommend reading quality code. Read, say, bzip2's implementation. Do not worry about not understanding everything on the first pass. There are plenty of little things, idioms, ... than one can pick up even without having read about the algorithm that is being implemented beforehand (the algorithm is interesting too, by the way).

If you are interested in program verification, take a look at ACSL, a specification language to write (and verify) contracts for C functions.


Knowing C is cool. How about learning a different aspect than just the language/syntax?

Two things that strike me are:

  • Socket programming. Write a basic chat client/server. Or a small file-transfer program
  • Multi-programming. Either with processes (fork(), etc - and this would fit nicely with sockets) or
  • pthreads. Learn multi-threaded programming, and what makes them different vs processes to get things done in parallel.

Both of these (sockets, multi-programming) are idea for a single project. You could write a networking program (like a shell), and then modify it to handle multiple connections - making use of processes/threads.


If You want deep dive into Linux hacking read already mentioned "Advanced Programming In The UNIX Environment". But IMO this book required some experience before reading it.

I suggest some books about programming tools (used in Linux but not only) like svn, diff, packaging system:

  • Professional Linux Programming - good book step by step tutorial about creating video rental service using only Open Source tools. Unfortunately it's not only about C and required some knowledge of other languages.
  • Linux for Programmers and Users - lot of informations for Linux programmers and users

  • The Linux Programmer's Toolbox - vary good book about Linux tools for programmers.

  • The Art of UNIX Programming IMO every programmer should read this book, there is a little source code, a a lot of philosophy (some one may don't like it) but most important is it show beautifully of Unix design, and show how to follow it in your own programs.

  • Data Crunching: Solve Everyday Problems Using Java, Python, and More Data Crunching: Solve Everyday Problems Using Java, Python, and More] - book not about C nor Linux but it's help to solve data processing task smartly.


Expert C Programming: Deep C Secrets


What's the use in learning things if you're not going to use it. Make a program.

Then when you find you don't know how to do something, look it up or ask here.

The best way to learn is to do.


Understanding Unix/Linux Programming

This book is really good. It basically covers all the OS specific stuff (specific to Unix and Linux) that isn't covered by the C specification.

This book covers things like signals, threads, inter process communication, network programming, and a bunch of other stuff.


In addition to doing the exercises in K&R, I'd start by duplicating a bunch of commonly used linux commands. This is helpful for 2 main reasons.

  1. There are Linux/Unix commands of all levels of complexity. You can start with the easy ones and move on as your skill increases.

  2. You can compare your program's output and running time with the real one to check correctness and efficiency.

Every time I learn a new programming language I duplicate a few linux commands to solidify my ability to solve actual problems in that language.


Reading about programming is a helpful way to get started, but what you read won't really start to come together in that "Aha!" moment until you start to do some programming. Find a task that you need to that could be solved by writing a program (even if that task has already been solved many times) and write a program to do it. The program doesn't have to be composed of pretty or efficient code and the result doesn't have to be attractive. The more you do some programming, the better you'll get and the better your programs will be.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜