Learning C++ (was Re: [PyKDE] Line numbers in TextEdit box?)

Simon Edwards simon at simonzone.com
Wed Aug 13 21:01:00 BST 2003


Hi all,

On Wednesday 13 August 2003 17:12, Frederick Polgardy Jr wrote:
> To make things even more interesting, there are "paradigm"-differences 
> which are more the result of different levels of programming, than to 
> differences in what a language allows or encourages.  Let me 
> illustrate.  A co-worker recently made the following comment (more or 
> less) while discussing an OO design: "Use a class for this -- actually 
> you can just use a struct, since it's public."  I gasped in horror!  

When it comes to programmers and OO languages that's the real problem. Few 
programmers truly grok the zen of OO (love that phrase). Good OO design is 
actually quite hard to do right. It gets tricky because few programmers 
_realise_ how hard it is. This leads to C programs who code using a 
procedural style and are also smart/capable/talented enough to "get things 
working", moving to C++ but not actually taking the time and effort to learn 
OO design. Hell, all their old C tricks still work, and they can hack and 
hack until something works. Which of course results in a mess, and _then_ say 
that OO is overrated because maintaining and extending their mess is still 
just as hard as before.

That's my opinion on that. ;-)

> That's it?!  The only difference in your mind between a class and a 
> struct is the default access restriction? 

Some people still don't understand the difference (importance!) between an 
interface and an implementation.

Anyway, back on topic. You probably don't need to fully learn C++ to 
understand the Qt and C++ docs, but learning the C++ type system and how its 
OO model/declarations hang together is strongly recommended.

I learnt C and asm originally and now I write KDE stuff in C++, basically C 
with classes. Most of C++ is a waste of space IMHO. Templates are a disaster, 
streams are just overrate syntactic sugar as they say, and I'm still waiting 
to see a good example of operator overloading that doesn't involve complex 
numbers or matrix math. (String concatination is probably the only other 
decent use for o. overloading).

cheers,

-- 
Simon Edwards             | Guarddog Firewall
simon at simonzone.com       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | "ZooTV? You made the right choice."




More information about the PyQt mailing list