[ale] starting programming

Benjamin Scherrey scherrey at gte.net
Tue Dec 15 01:10:18 EST 1998


Tri,

    You've stumbled on a religious issue here so watch out that you don't
get splashed by any flames! I've looked at people make recommendations that
I both agree and disagree with. I'll give you my ideas and why I make those
recommendations. If my reasoning fits with yours then you should feel pretty
safe following them. If not, please ignore them.

    First, I recommend that you don't learn C.... or, rather, not plain C.
Unfortunately, the K&R book (which was recommended earlier), while clearly
the bible for a vast number of extremely successful C programmers (I like to
include myself in there...), is obsolete for people who want to learn a
language for the first time. K&R C precedes ANSI C which precedes C++. C++
is type safe (meaning the compiler will catch more errors for you before
your program mysteriously dies- this is a good thing) and is able to more
easily model abstractions that resemble their real-world counterparts. I
personally started with C in the mid 80's and have been almost exclusively
C++ since 1989. Now - the full C++ language and its standard libraries is
quite huge so people telling you its large and complex are correct. However,
it is also simpler than plain C at the same time. One of the primary goals
of the design of C++ is that you don't pay the cost of features you don't
need to use. This means you have a language that is easier and more
expressive than C and really no larger or unwieldy. When you need to take
advantage of a new language feature, that will be when you learn it - not
everything at once (the same argument might apply to the earlier critique of
Perl as well).

    The only caveat I have here is that, like C, C++ by itself, is a pretty
low level language until you start bringing in these more advanced libraries
and features. Even then, you really have to have a pretty complete
understanding of your operating system and other environmental factors to
get the best use of the language and this information comes from many
different sources. In other words, there are many things outside of the
language itself that you must master as well before fully utilizing it. This
knowledge is obtained only through experience (which can be led more
efficiently with the help of an experienced teacher). Once acquired, you'll
be able to easily get more out of the C++ language than is even possible in
most other languages. That said, there is another approach that you might
want to consider...

    Interpreted languages (sometimes aka as scripting languages) assume a
basic set of features in your environment. In other words, the language
imposes a context which you view your problem from. As long as the context
can efficiently model your problem then you'll likely be able to develop
your solution with that language. Recently, languages like Perl and Java
(Java more so than Perl, IMHO) have greatly expanded the expressive
potential of the environments in which interpreted languages operate.
Another advantage of Java is that its syntax is *very* similar to C++ so
when you decide to code "closer to the metal", the learning curve will be
significantly reduced.

    Upon learning Java and its standard features you'll have a full
development system that is capable of accessing standard SQL databases, a
full GUI development environment, and many other capabilities that are only
provided by non-standard libraries in other development environments.
Additionally, Java is becoming the "language of the internet" where a lot of
interesting development opportunities exist for upstart programmers who
don't have large resources available on hand.

    The downside of Java is that it is, unfortunately, not as inherently
supported by Linux as C, Perl, and C++ are. Fortunately, this is changing
rapidly and getting an operational Java development environment under Linux
gets easier each month. As with nearly all things worth having under Linux,
the free stuff is easily obtained and extremely competitive with the
commercial offerings. Java environments under Windows and Solaris still
outperform the Linux ones but I see this changing within the next 24 months.
The other nice thing about Java is that not only is the code portable from
one OS/machine combination to another but even the compiled programs are.
This simply isn't an option with any other major language to date although I
have achieve very significant platform independence with C++ when used with
some specialized commercial 3rd party libraries. This quickly becomes an
important feature when you want someone else to be able to use (and,
perhaps, even purchase) your software.

    So... my recommendation is learning C++ and/or Java. There are a very
large number of good books for beginning programmers for both languages. Do
be careful, however, that the C++ books don't assume a C background (as many
do). Head over to http://www.amazon.com and start reading reviews by other
people who were in a similar situation as you.

    Good luck!

        Ben Scherrey

Tri wrote:

> I want to learn to program in C, but don't know where to get started. I
> know basically nothing about programming so I'm a newbie. I was
> wondering if anyone here could give me some pointers on what I should
> do. Like if there were any classes I can take (I'm a freshman in
> highschool) right now or if there you have any recommendations for books
> and other things. When I do learn to program linux, of course, would be
> my main programming, developing platform, so I don't think this e-mail
> is too off subject.
> Tri






More information about the Ale mailing list