[LCP]Larger programming tasks?

Jack Lloyd lloyd at acm.jhu.edu
Sat Jun 29 00:26:06 UTC 2002


On Fri, 28 Jun 2002, Greg Black wrote:

> Marcin Jendrzejewski wrote:
>
> | I'm just curious what suggestions people have for a larger programming
> | task in C/C++.  I guess I'm aiming here for about 1000-2000 lines of
> | code.
>
> That's still a pretty small program.
>
> If it's just for an exercise, browse the Unix man pages and
> select some program that you think you understand and write it
> from scratch, using the man page as your specification and the
> Unix program as your verification -- the same inputs should get
> the same results in the same time.  Naturally, you lose if you
> read the Unix source first.
>
> I'd try cat first -- it's astonishing just how many people who
> claim to be C programmers just can't manage that.  When you've
> mastered cat, move on to ed.  Those two programs cover a large
> subset of the stuff you need to be proficient in.  Then write a
> couple of network programs using sockets -- a client and a
> server to implement a simple protocol such as a stripped down
> SMTP server would be a good thing to try.
>
> And then start thinking about things you actually want to work
> on.  The Linux and BSD and GNU developers are all crying out for
> volunteers to do a bit of coding in their free time.
>
> Greg

I would second this. If you're a fan of C++, try writing your Unix
replacement applications in well-styled C++ (using iostreams, the STL if
needed, etc). Then compare the two for speed, object size, memory usage,
etc. Could be interesting. After you've done this, look at the original
sources, and see what it did differently from you. Figure out why. In many
ways, being able to figure out what someone else's code is doing is just as
important as writing code yourself.

Later on, you really should consider learning at least one GUI library.
I've done a fair bit 'o coding (a 30K line project from scratch, and done
extensive work on a 100K line project), but I have never managed to learn a
single GUI library, and I consider it the single biggest hole in my skills.

-Jack





More information about the linuxCprogramming mailing list