Ask YC: Python or C ?
I have just got out of high school and now into my first year of bachelors in computer science. I have been interested in programming since long. I started with a python about 2 months back, as I had read at a lot of places that it's best recommended for beginners. I've read a book on it and now have learnt all the basics of it. I have written a few handy scripts here and there. I have a basic idea of OOP as well. And now I was about to explore various modules in python.
But my first semester exams in college are approaching and I have an exam on C. Its just basic stuff like declarations, bits about data structures, looping, functions etc. The curriculum is really introductory. I am quite sure that I will manage by giving it a week or so.
The problem is that I don't think it is a wise idea to just study introductory C (btw it was the language I wanted to learn after python). Mainly its a personal thing, if i begin C, I would rather get deep in it than study just basics. I don't see a point in just teasing my curiosity and then moving away from it. My major area of interest is in network protocols such as TCP UDP STP and SIP.
Please give your opinions on whether I should pick up K&R and then go forward from there into C or do the bits to clear my exam and get back on python. I am aware of the fact that I can always embed C into python code.
Thanks in advance
[+] [-] SwellJoe|17 years ago|reply
C is a fine systems language, and K&R is one of the best programming texts I've ever read. I haven't used C seriously in several years, but I don't regret the time spent learning it (Pascal, maybe, I feel like was a waste of time...but definitely not C).
Learn both. Even better, learn how to use one with the other, via ctypes, SWIG, etc. That'll put you head and shoulders above a large percentage "Python developers" on the type of projects you can tackle, and make you more productive than a large percentage of "C developers".
[+] [-] rw|17 years ago|reply
In the tower of abstraction, I've found it more useful to learn the bottom and the top, and leave the middle to be figured out on a per-project basis; e.g. learn assembly/C, Scheme/Common Lisp, then Python to make implementation details easier.
Also, you could learn 2-4 languages concurrently. This makes for a challenging ride but it is also empowering, because you can compare them so easily.
[+] [-] noodle|17 years ago|reply
[+] [-] qhoxie|17 years ago|reply
K&R will be what you need to get started, and past that, you could pick up some protocol specific information. Implementing protocols in C is common practice, and there are plenty of good ways to exercise those skills such as implementing sliding window atop UDP or the like.
[+] [-] g__g|17 years ago|reply
[+] [-] noodle|17 years ago|reply
learn the basics of C. even better, learn how languages work and learn how to learn them, because there will always be new, better languages and methodologies. the C experts of yesteryear that put all their stock into one language are now the stodgy dinosaurs stuck in their jobs today.
learn the basics of C. ESPECIALLY if its for a grade. i learned so much garbage at college that i've totally forgotten, as well as so much stuff that i didn't really need to know but that i am better for having learned it, anyways.
thats my $0.02.