views:

778

answers:

20

For the last, hmm, 6 months I've been reading into Programming in C, I got myself K&Rv2, BEEJ's socket guide, Expert C programming, Linux Systems Programming, the ISO/IEC 9899:1999 specification (real, and not draft). After receiving them from Amazon, I got Linux installed, and got to it.

I'm done with K&R, about halfway through Expert C Programming, but still feel weak as a programmer, I'm sure it takes much more than 6 months of reading to become truly skilled, but my question is this:

I've done all the exercises in K&Rv2 (in chapter 1) and some in other chapters, most of which are generally really boring. How do I lift my skills, and become truly great? I've invested money, time and a general lifestyle for something I truly desire, but I'm not sure how exactly to achieve it.

Could someone explain to me, perhaps if I need to continuously code, what exactly I'm to code? I'm pretty sure, coding up hello world programs isn't going to teach me any more than I already know about anything.

A friend of mine said "read" (with emphasis on read) a man page a day, but reading is all I do, I want to do, but I'm not sure what! I'm interested in security, but I'm not sure as a novice what to code that would be considered enough.

Ah, I hope you don't delete this question :)

Thanks

+2  A: 

"read" and practice what you read which is the best way.

Sarfraz
+7  A: 

Peter Norvig has some ideas about that

David V.
I don't think that this is what he's really asking, whatsoever. More about how to become better, and not how long it takes.
Mustapha Isyaku-Rabiu
+1 for the link though.
Mustapha Isyaku-Rabiu
@rogue: Norvig gives an excellent recipe for getting there as well, read again. ;)
Mladen Jablanović
+5  A: 

Try to implement a few non-trivial algorithms. I do not know what examples are included in the books, but you might try to write

  • An algebratic calculator. Input "sin(2) + 5! * 3^(1/2)" and you get 208.755394335 as an output.
  • A syntax-highliting text editor from scratch.
  • Write a PNG (or any other image or sound format) encoder/decoder from scratch.
  • Write an image editor (for instance flood fill is not entirely trivial)
  • ...
Andreas Rejbrand
Haha, yeah I made a monochrome BMP reader with a hex editor and by flipping pixels in MS Paint :)
Jacob
+11  A: 

most of which are generally really boring

Learn something you find interesting, then the rest will fall into place.

James
+16  A: 

What would really help you learn is to start a project. It could be anything, implementing a chat client/server, a unix shell, a simple program to store grocery lists, whatever. The point is by picking something that you are interested in and working to implement it, you will be surprised how much you learn along the way, and you won't want to quit because you are working on something meaningful to you.

Basically, you will only learn so much by reading. To gain true knowledge you will need to work through real problems.

Justin Ethier
Seconded - you'll learn more working on a pet project that motivates you than you will from generic exercises from a book or website. *Doing* also help you remember the theory...
CJM
+1 - This is really the only answer that makes sense to me. You cannot really understand what you *don't know* until you are up against real-world problems that stretch you over the boundaries of what you *do know.*
Mark Brittingham
+1- I agree, this is the only way. Learn from projects that you can't make because they are beyond you, and incorporate something new (use classes, inheritance, interfaces, etc) every new project. Sometimes making a game can be a fun solution.
DMan
A: 

I find practicing much more useful at learning concepts than reading about them. Often what I'll do is determine a problem I want to solve with software, then go about it by attempting the problem. I will utilize resources along the way, but its really more useful to try what you read, rather than read every book on the subject.

Also, Code Golf is a good way to find fun programs to attempt.

Kevin
A programmer doing Code Golf is like a mathematician doing Soduku... a bit of a distraction from real work.
John
A: 

You need to challenge yourself with a bigger, more complex project. Working through code snippets as most book examples tend to be will not get you far.

You're working on being a booksmart developer. Do something real world and become street smart!

Paul Sasik
+1  A: 

Code Hello World, then code Hello World distributed over a network, or in 3d, or using a database. Don't think things are too trivial until you've done them. Implement algorithms to make sure you know how. Do code you think is fun.

Simon D
printf("Hello world in 3D");
John
A: 

Do it. There isn't a shortcut to being a "great" developer - like any other craft, it takes lots of time and practice and patience. Just do it.

Chris
+15  A: 

Learn to Program in 21 days http://davidbarneswork.posterous.com/can-you-really-teach-yourself-programming-in

James Kolpack
+1 I think the third panel is the most important step, followed by the fourth.
Grant Palin
+1  A: 

Code Golf and Project Euler are good - but they are more about problem solving and maths than programming.

Find an Opensource project (probably not the Linux kernel) that you are interested in, download the source and try and use it. Ideally something that is a library rather than an application so you have to learn how to read it to use it with your own stuff.

Don't worry - It only takes about 10 years to become a good programmer.

Martin Beckett
+1  A: 

If you're interested in security, try coding a web application with security in mind. If you create something like a forum you'll not only learn about a number of security concerns, but also how to use multiple technologies like databases, web servers, and a new language and potentially new style besides C. And then when you're done with your project, compare the code to other similar software. If you get stuck on your project you can also look at similar projects to see what they do. And it can be as simple or as complicated as you want it to be.

Web programming may be different from systems programming in a lot of ways, but both share many security concerns.

JamesH
A: 

Learning to program is like learning to speak a foreign language. Initially it is very frustrating and often boring. It is only after you gain a degree of fluency in a given language that you find your productivity increases. Along the same vein, just learning the rules is not enough. As with language learning, if you don't use it, and use it often, it will be hard to retain and keep your interest up.

What works for one person doesn't always work for another. Code golf may work for you, or you may find it tedious for example. Personally I like doing something that has genuine value, but that is me. Experiment a little with different types of coding projects, perhaps code golf, perhaps open source projects, producing a game, etc. Sometimes just trying to figure out how to answer other people's questions helps. Eventually you'll find what works for you. Just remember, studying is not enough, you have to apply those studies.

Bill
A: 

Some project ideas:

  • Small database projects: contact list, DVD collection, etc. Emphasizes file I/O, searchable data structures, etc.
  • Simple calculator: Emphasizes interactive I/O, parsing, tree-like structures, etc.
  • Simple NNTP (Usenet) or chat client: Networking and protocols
John Bode
A: 

You can only learn the language, when you are using it. Simple examples or exercises will never give you the deep insight into the language. I personally also found the exercises at the end of a chapter boring and unworldly, so I didn't do them. As other state find a project you are interested in. This can be anything, starting from a simple board game up to a video cutting system. If you found out what would be interesting for you, take a look on how you can accomplish it. You will need to use some helping libraries, for the UI and also for the backend. And then start to work! (Of course the project should be doable for you, hence don't take an aim like 'writing a better word processor than Winword'.)

Another way is to dig for an OSS project that you are interested in and where you are missing some features. Implement those! The great benefit is that you get a source review that is probably tougher then from any teacher. Once you learned those coding styles, you probably already forgot about the language itself.

quinmars
+2  A: 

You say you're interested in security. Go look up some exploits and try to understand them. Better yet, try to find an exploit yourself, for a known (better: unknown) vulnerability.

Write an NNTP client, or an SMTP server, or client, and use it to send your mail. Many of these internet protocols are simple enough to not be very difficuly to implement (most of the text-based protocols), yet nuanced enough to be interesting, and they have the connection to the real world that makes it more satisfying than a "hello world" program.

Or how about writing a linux kernel module? They're not that hard to write, there's just a bit of a barrier to entry (lots to learn before you can have your "black triangle"). Make a character device that returns an endless stream of the last byte you wrote to it (call it /dev/fortytwo if you like). Then make sure it will work when two processes use it simultaneously.

Look for some project with crappy code but friendly community, and clean some of it up. GCC and the kernel would be bad choices here :)

Bernd Jendrissek
Because the code's great, or because the community isn't?
John
LOL, I meant GCC and the kernel don't have crappy code. Or what you might think is crappy is there for some good reason you just haven't discovered yet, etc. Also these projects are very big, and all the low-hanging fruit are in a chronic stated of pickedness, so it's hard to find something to sink your teeth into as a non-insider.
Bernd Jendrissek
A: 

Start a project and finish it. Put it online, make it open source, get feedback.

Mel Gerats
,... ???, profit
John
A: 

Read

Code Complete 2

.

Benny
A: 

Go to work. Seriously, find a job for a beginner and let someone with a bigger knowledge guide You (if You have luck) or check the codebase for a useful hints (if You have smaller luck).

In other way, You can start a project for Yourself as some of folks suggested and improve Your knowledge as the opportunity arises.

However, I wouldn't mix both of these worlds - don't start by agreeing a deal for a money - You will probably be prone to under/over-estimating time cost, won't have a good knowledge of bigger solutions, etc. It's better to have someone to guide You or have more time to learn things.

Ah, and btw. - read books (CC2, some design patterns books, "Clean code" are a good place to start with and great reference-books for the whole career) and blogs (You'll know it when You see it).

cand
A: 

Consider reading more content on the "concepts" of programming than purely syntax:

Join a mailing list/newsletter/magazine/podcasts for programmers in your area of expertise: http://www.drdobbs.com/cpp/;jsessionid=XVZEO0SKOCRRBQE1GHPCKH4ATMY32JVN

Visit StackOverflow.com and try to solve issues periodically to give yourself a mental challenge and help others.

jasonk