[Tutor] Children of all ages
Mon, 08 Mar 1999 20:45:07 -0500
I agree with your comments on learning OOP by writing graphics apps.
I'm not familiar with OpenGL, but I know that learning with something
like the Tk Canvas would be a good way to break into OOP and event based programming.
As far as your project with sockets, I'd suggest starting out with a
simple client/server setup. The first program I wrote with sockets had
a server that would just print out whatever text the client sent. Once
you can do that, you have the basics down for reading from the socket
without hanging using select(). If you are sending plain text back and
forth, you might send something that you have to parse (like a command
with parameters). That means you have to accumulate enough data to make
the parsing work.
When you are comfortable with plain text, you can move on to something
like reading a fixed amount of data from the socket. That lets you send
records or data structures. Then you get into things like sending
binary data, which brings up topics like byte order.
If you want to play with select(), you could also start with the httplib
that comes with Python. Using that, you can connect to any web server
and grab web pages. The benefit of using HTTP is that you can check
your results against what your web browser gets. Of course, httplib
hides the really interesting part of openning the socket, etc., but it
would be a good way to break into the client side.