Advertisement

c++ book that will teach structural programing

Started by July 02, 2002 10:52 AM
4 comments, last by dealer 22 years, 5 months ago
and not jump right into classes and oop. hi i am new to programming and been told that i should avoid learning about classes etc until i have a good understanding of structural programming. problem is every book i have looked at so far (especially those learn c++ in 21 days books) seems to start teaching about classes after a few days. if anyone can recommend a book i should try i would be greatfull.
You don''t need to study one before the other, but you do need to understand both approaches and know when to use which one.

With function progarming you have data structures and functions that operate on those date structures. When faced with a complex problem you try to break it down into a series of smaller problems. Each step becomes a function. If a function is too complex it is broken into smaller steps.

With object oriented programming you treat the data and the functions that operate on that data as a single entity. When faced with a complex problem you break the problem into separate (hopefully resuseable) components. Once you finish a component you don''t have to worry about how it works, you just need to know its interface.

OOP is great for complex projects, but all those interfaces, constructors an destructors result in a lot of extra code being executed. Functional programming might drive you insane, but it can be dam efficient.

The win 32 api programing is functional programming, so if you read a book that teaches C++, then read a book on Windows Programming you will be exposed to both techniques.



Advertisement
who cares what you''ve been told? Seriously, if your friend is so smart have him teach you. That would be better than any book. If you want a book then just find a book that is considered good and it read, if it goes against your friend''s advice that''s just too damn bad. I''ve heard that Accelerated C++ is very good.
There is nothing wrong with learning OO as a newbie(You might want to consider learning it in another language than C++ though. Python[1] is always a good choice).. Some people believe that OO idioms are easier to learn if you start from scratch, than if you have a lot of ingrained habits from procedural programming.

Note: There seems to be some confusion about the term "functional programming" here. From the FAQ[2] for comp.lang.functional:

Functional programming is a style of programming that emphasizes the evaluation of expressions, rather than execution of commands. The expressions in these language are formed by using functions to combine basic values. A functional language is a language that supports and encourages programming in a functional style.

Some of the more common functional languages are Lisp, Haskell Caml and Scheme. C++(and C) is generally not considered a functional language, although parts of the standard library and the boost libraries have functional aspects.


[1]www.python.org
[2]http://www.cs.nott.ac.uk/~gmh//faq.html



[edited by - Arild Fines on July 3, 2002 2:38:51 AM]
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
My mistake, I meant structured programming. I should know better! I have actually used Lisp quite a bit when I was studing AI/Knowledge Based Systems.

My recommendations lie with C++ for dummies, that was the first book ive read all the way through on C++, its a bit patronising and the jokes are not at all funny but it teaches good structural programming. The best language to start off with is pascal for structured programming as it forces you to write in it. Get yourself a MAC emulator and a copy of pascal (if you a no money student like myself) and start from there.

This topic is closed to new replies.

Advertisement