0

I am a PHP developer, and now I want to learn C for a couple of reasons.

  1. I lack knowledge in Java, as well as data structures and algorithms.
  2. PHP is written in C.

The most important thing is the first reason. I don't want to get deep into C, but at least I could understand what C programs are doing. Does anyone have any good idea how I should proceed? Thanks!

Michael
  • 2,075
  • 7
  • 32
  • 46
  • 4
    You lack knowledge in Java and thus you're trying to learn C ? – cnicutar Aug 27 '12 at 12:43
  • 1
    @cnicutar, No, I am just saying C could facilitate understanding data structure, nothing to do with Java since they are two different styles of languages. – Michael Aug 27 '12 at 12:45
  • 1
    [The Definitive C Book Guide and List](http://stackoverflow.com/questions/562303/the-definitive-c-book-guide-and-list) – Bart Aug 27 '12 at 12:46
  • +1. I don't know about PHP, but reading a bit about how Python is put together was beneficial to my Python. Scripting languages like Python and PHP are largely ways of plumbing together blocks of C code. – Joe Aug 27 '12 at 12:46

1 Answers1

3

That's probably the wrong approach. First learn the basic theory behind programming which is algorithms and datastructures. These are language neutral.

Than try to learn a language and its syntax to write your algorithms. To answer your question, a good book for C is C in a Nutshell but it DOES NOT teach you the basics of programming.

And then there is still the book The C Programming Language by Kernighan&Ritchie, who invented C.

Tobias N. Sasse
  • 2,457
  • 1
  • 19
  • 14
  • I tried to find a book which is language neutral for these topics, but I failed to find one. I just have to go to wikipedia to learn some theory of algorithms I find interesting. – Michael Aug 27 '12 at 12:49
  • Sure, I learned by fiddling around in one language until I hardly knew what I was doing and continued from there. I think it's always a combination of practical examples in a language and theory like in university classes on datastructures and algorithms. – Tobias N. Sasse Aug 27 '12 at 12:54