C, C++, and Java; and, learning how to program

Tue, 22 Mar 2016 00:26:44 +0100

> [C++ programs are shorter than C dito]

In general the OO model makes for long programs, but
on the other hand programs that are easily read,
unless of course too much OO overspin is put into it.

C is more old-school, "stupid" but straightforward
computing. You don't need to solve the problem by
making a model of the problem first. If you know the
problem, you know the solution, and the solution isn't
expressed as a model of the problem, it is just
a solution that hangs completely in the air, fine, but
if you implement it it'll solve your
problem nonetheless.

> [C is not a language for beginners.]

C can absolutely be learned as a first language.
The syntax is clear (and has influenced many other
languages) and in terms of concepts the language has
a scope that is manageable to anyone.

If you study a beginner's book on C cover-to-cover and
do all the exercises, I'd say you have a fairly good
understanding of both C and programming in general.

The next step (which is more difficult) is to stop
doing bubblesorts and the like and instead write
programs that do meaningful things, with your files,
system, or even the outside world (as in analyzing
data or whatever).

But just programming as in function calls and return
values and data types and branching (if) and iterating
(for loop and arrays), and looping in general ([do]
while), etc., for all that stuff C is a great
language, for beginners as well as veterans...

> Java is supposed to be beginner friendly...

Java shouldn't be used by beginners as it is too
confusing and too aesthetically unappealing it might
turn people away from programming forever.

Back to Blogomatic.