From: Lucas on
How do I become good at programming? What C/C++ books would you recommend?

For starters, I'm looking for information on the programming process. I
want to know how to plan and design a program. So far, when I write a very
small program I just hop on my computer and start typing. I know that's
not how it's done in the real world, so how do real-world programmers
design a huge program? Do they use psuedo code, or flow charts? (Perhaps
both?)

My last question involves the problem-solving process. How do you think
out a problem? If I was "decent" at solving word problems in math does
that mean I'll be "decent" at programming?

One more question: Where do you get your programming ideas from?

Thanks
From: Ulrich Eckhardt on
Lucas wrote:
> How do I become good at programming? What C/C++ books would you
> recommend?

Firstly, I would recommend settling for one language, either C or C++.
Seriously, they are different. OTOH, I wouldn't recommend either language
for a beginner, I'd use Python there.

> For starters, I'm looking for information on the programming process. I
> want to know how to plan and design a program. So far, when I write a
> very small program I just hop on my computer and start typing. I know
> that's not how it's done in the real world, so how do real-world
> programmers design a huge program?

You have an idea, and write a small prototype. Why shouldn't the real world
work like this? Not every program is designed from scratch, most rather
evolve.

> Do they use psuedo code, or flow charts? (Perhaps both?)

How about a description in plain prose? Using flow charts, pseudo code or
UML or whatnot is already the second step. Also, you often have a set of
requirements or use-cases, which are written down in a way that they can
later be transformed into tests.

> My last question involves the problem-solving process. How do you think
> out a problem? If I was "decent" at solving word problems in math does
> that mean I'll be "decent" at programming?

Actually I think that math skills are overrated for programming. One thing
though is that math also requires a certain strictness and discipline. There
no gray zone, things are either wrong or right. Computers are similarly
unforgiving, they do exactly what you tell them to, which may not be what
you want them to. That said, I would put linguistic skills up front, because
it involves translating from a human language to one that the computer can
understand.

> One more question: Where do you get your programming ideas from?

There are various idea-finding methods, like e.g. the most well-known
brainstorming. Other influences are simply the requirements for the program,
as given by the users.

Uli

From: Ulrich Eckhardt on
me(a)privacy.net wrote:
> Ulrich Eckhardt <doomster(a)knuut.de> wrote:
>
>> I wouldn't recommend either language
>>for a beginner, I'd use Python there.
>
> why python?

It's relatively clean and modern. It supports many programming paradigms
(object-oriented, functional, procedural..). It is widely used, so you have
a large community and many add-on libraries for pretty much anything. It is
interpreted/byte-compiled, so no long compile and link times. OTOH you can
easily extend it with modules written in C or C++ for increased performance.

One of the most important things IMHO: It doesn't have things like undefined
behavior, as C and C++ do. In those two, there are programming errors (like
reading an invalid pointer) that may or may not cause a an error or even
clean termination of the program. In Python, but also e.g. Java, both of
which are newer languages, every programming error will raise an exception
which can be handled. In short, you can care more about learning programming
and need less care for the intricacies of the language.

Uli

From: Francis Glassborow on
Ulrich Eckhardt wrote:
> me(a)privacy.net wrote:
>> Ulrich Eckhardt <doomster(a)knuut.de> wrote:
>>
>>> I wouldn't recommend either language
>>> for a beginner, I'd use Python there.
>> why python?
>
> It's relatively clean and modern. It supports many programming paradigms
> (object-oriented, functional, procedural..). It is widely used, so you have
> a large community and many add-on libraries for pretty much anything. It is
> interpreted/byte-compiled, so no long compile and link times. OTOH you can
> easily extend it with modules written in C or C++ for increased performance.
>
> One of the most important things IMHO: It doesn't have things like undefined
> behavior, as C and C++ do. In those two, there are programming errors (like
> reading an invalid pointer) that may or may not cause a an error or even
> clean termination of the program. In Python, but also e.g. Java, both of
> which are newer languages, every programming error will raise an exception
> which can be handled. In short, you can care more about learning programming
> and need less care for the intricacies of the language.
>
> Uli
>

I think that is an over-statement. Java certainly has undefined
behaviour just much less of it and I am pretty certain Python does as well.
From: Ulrich Eckhardt on
Francis Glassborow wrote:
> Ulrich Eckhardt wrote:
>> One of the most important things IMHO: It [Python, Java] doesn't
>> have things like undefined behavior, as C and C++ do.
[...]
> I think that is an over-statement. Java certainly has undefined
> behaviour just much less of it and I am pretty certain Python does as
> well.

The "much less" is exactly the point. I at least haven't crashed either VM
yet, though my main work involves C++, not one of those two.

Uli

 |  Next  |  Last
Pages: 1 2
Prev: Learning try throw catch.
Next: redirect std::cout