POV-Ray : Newsgroups : povray.off-topic : Games programmers : Re: Games programmers Server Time
10 Oct 2024 11:18:19 EDT (-0400)
  Re: Games programmers  
From: Orchid XP v8
Date: 11 Sep 2008 15:41:27
Message: <48c97467$1@news.povray.org>
>> The macro preprocessor?
> 
>   You usually don't need it in C++.

Well, from what little I've seen, you "usually" don't need it in C 
either. Unless you want symbolic constants...

>> Method overrides that don't actually override unless you insert
>> special code?
> 
>   What do you mean?

Recall that I've never actually programmed in C++. I just read a book 
about it to see if it was any good.

Anyway, according to this book, by default all class methods have static 
binding. If you want real OO-style dynamic binding, that's an extra 
feature that you have to remember to turn on. (Presumably because it 
incurs a small performance hit, and C++ is targetted at speed, not 
flexibility.)

This also suggests that if somebody else wrote some code and you only 
have a binary copy, and they decided to not make some method 
overridable... too bad. (But then, frankly, trying to extend classes 
that somebody else wrote is usually pretty hard in any OO language.)

>> Templates?
> 
>   One of the coolest, most powerful and most useful things around.

And also one of the hardest parts to learn, no doubt.

>> Untrapped numeric overflows?
> 
>   You want the compiler to automatically insert a conditional after each
> single arithmetic operation you perform? Maybe you should use some other
> language.

The "maybe you should use some other language" part pretty much hits the 
mark, IMHO.

The long and short of it is that C++ is designed to be used by experts, 
and if you're not one, the langauge will make no attempt to prevent you 
hurting yourself. Now I don't know about you, but when *I* code things, 
I make mistakes. And I appreciate having systems in place to help me 
find and fix those mistakes. Clearly this is not C's design goal, and it 
appears not to be the goal of C++ either. These languages are designed 
to be efficient, not safe.

>   It's complicated only if you make it so.

Well, there sure seems to be a lot to learn there, that's all I'm saying...

(It's not even a complete list. Isn't there a special syntax for bit 
fields or something? And then there's the fun of destructors. And all 
kinds of interesting edge cases where that's "meant" to happen becomes 
slightly grey. And...)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.