C++ and programming

Steve Jovanovic plug-discuss@lists.plug.phoenix.az.us
Fri, 3 Jan 2003 06:08:31 -0600


Hi Aaron,

I've been developing in C++ since 1991, and boy, has the language gotten
a lot bigger since then! :) I understand how you feel about going over
the same thing again and again, and wanting to do real application
development.

C++ is a complicated language, but I hope that some of my comments may
help. I think that learning to develop apps in C++ has more to do with
understanding a little about a great number of things rather than being
an expert in the syntax of C++. I think a lot of people strive for that
level of mastery and memorize a lot of things that longtime C++
developers don't even know, yet the longtime developers can write
real-world C++ apps but the "syntax tax collectors" can't. 

Learning to develop apps is a lot like learning to become a really good
chess player. You have to learn the basic rules of the game (the syntax)
to be able to play, but a beginner can play chess without necessarily
understanding how to castle (or in C++, instantiate a template class or
use RTTI).

Once you learn the basics and can get around, I think the next step is
to learn basic move combinations. I'm stretching the metaphor, but in
programming, I mean data structures: stacks, queues, linked lists,
trees, hash tables, etc., and why you'd want to use them. 

When you're programming, you're taking something from the problem domain
and trying to translate it, through code, into the solution domain. To
attack various problems, you need to be able to represent the things
you're dealing with in a way that facilitates their solution, and data
structures are the key.

Then, you need to know something about the architecture (hardware and
operating system) of the platform you're developing on. C++ largely
insulates you, as any good high-level language should, from having to
know much about the details, but it's helpful to avoid assumptions like
relying on a certain word size, etc. 

And speaking of architecture, there are all sorts of things to learn
about the graphical framework of your platform (if you're using one). If
you were using Windows, you'd want to learn something about MFC. Under
Linux, GTK (or any number of others). 

If you want to create an application that uses networking, you'll want
to learn something about the TCP/IP protocols. And on and on. It's
endless.

If you're interested in large and complex applications, you'll also
probably want to learn something about how to model them in UML, and
then translate the diagrams into code. You'll also want to investigate
patterns to help you solve certain general classes of problems that keep
cropping up. 

All of this stuff takes a long, long time to do well. I think it takes
being exposed to a lot of different projects over the course of many
years, but picking up the basics, while it's demanding, isn't hard. It
does take a lot of work, though. I think to be good you really have to
have a love for it, and find programming its own reward.

The problem with trying to figure out someone's code, especially if it's
commercial grade, is that that person is an expert in his domain, and
you're not. Don't feel discouraged. It's always easier to write new code
than to understand what someone else did. Also, remember that code
doesn't need to be complex; it just needs to work and satisfy the
requirements of the software system. 

What types of applications are you interested in writing? 

Paging through countless books does get boring, fast, and I don't think
that it helps terribly much, either, because of the forgetting curve.
(If you don't review something often, the knowledge decays quickly. 50%
is gone within 24 hours.) The best way to learn how to develop is to
plunge in, and not be afraid.

Code, code, code, code, code! :) Code all the time, and eventually
you'll get to be really good. I've never known anyone to become an
accomplished developer quickly. It really does take a lot of time, the
ability to persevere, and a passion for constant learning. 

The one good thing about the slow and steady approach is that picking up
other languages gets easier. It's not ever really the language that's
the problem, but the GUI framework, that I've always found challenging. 

All of that said, if you're looking for an advanced book with some
exercises, I suggest Stanley Lippman's C++ Primer (an incredibly
misnamed book!). I also suggest finding a project to work on that
interests you and recruiting someone else with the same interest to work
with. It takes a lot of motivation and coordination, but team
programming can teach you a lot and be a lot of fun when it works. 

Please don't feel too frustrated. No matter what anyone says (and I've
worked with a lot of developers), real-world programming is very
challenging: there's a lot to know and it really is a lot of work. A
little study, a little memorization, a lot of insight that develops over
time, and curiosity and perseverance will get you where you want to go.

I've never really done any Linux development except for one minor
low-level project six years ago, so I don't have any specific
suggestions for Linux, but in defense of M$, I have to say that I really
like Visual Studio. If you're committed to C++, and can use any
environment you like for learning purposes, it's a really good bet.
Otherwise, if you're more flexible and want to learn to develop
applications in a platform-agnostic way that's not tied to C++, I
strongly recommend Java.

Best of luck, and if there's anything I can do to help, feel free to
give me a holler anytime!

Steve Jovanovic

-----Original Message-----
From: plug-discuss-admin@lists.plug.phoenix.az.us
[mailto:plug-discuss-admin@lists.plug.phoenix.az.us] On Behalf Of Aaron
Cordova
Sent: Friday, January 03, 2003 5:18 AM
To: plug-discuss@lists.plug.phoenix.az.us
Subject: C++ and programming



I switched from M$ Windows to linux thinking I would sorta be forced to 
learn more programming. I have had two college classed in C++ but I have
yet 
to learn how to really "Code" not once in either classes was any serious

application programming taught. I need to learn to program desperately.
But 
trying to sit down and page through code is very very boring. When I'm 
debugging I can spend hours in front of the terminal, same with trying
to 
hack one of my friends programs. But whenever I try to hack/figure out,
a 
complex app I get frustrated because right off the bat the code gets
very 
advanced or is commented in a way only a guru would understand. I have
read a few c++ books but they are almost all the same, covering the 
same thing over and over. Can someone recomend a book or a method to
help me 
to break out of newbie code? I would greatly appreciate it.

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change  you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss