Tuesday 21 April 2009

C++

It isn't as easy as I remember...

Got to do a whole bunch of swatting. I have not done C++ for a while now, but the really difficult thing is that we are all spoilt!.
Java, C#, even C and C++ has so many helpers, things like containers etc. that you forget about the underlying stuff.

I mean I read Bjarne Soustroup's (The creator of C++) book today and even he tells us to use the STL libraries as they are fast and reliable.

I remember at my phone interview, Gordon asked me what I thought of the STL, and what are the advantages, disadvantages. I thought it was a trick question.. I mean, the STL is great - the vector class RoXXors. Why would he ask for disadvantages?
Well it seems I answered correctly, in that it's all good, and very fast - however the main problem is that not all compilers or platforms support it. So it makes it difficult for any sort of cross platform portability. It also may not offer the complexity or flexability that you want.
Of course, guess what? - in the games industry most games you write, you want to be cross platform... so... guess what? Stay away from the STL where possible.

This means that all those lovely containers and libraries that make life and programming easy are out the window and all those issues with pointers and memory management and knowing the underlying complexity returns. 10 years after I've forgotten it!

So, back to basics and get my old C++ book out and write some core classes and fundamental stuff. LOL, I struggled with an Array today... how sad! :)

5 comments:

Jo said...

geek ;)

Doucha said...

But isn't tha tthe point.. I'm not geek enough - otherwise I'd know this stuff and wouldn't be posting about my troubles with it...
so I'm not a geek ;)

How I wish I was... LOL

Anonymous said...

Don't be afraid of using the STL. Right tools for the right job. I'm using it well in my current project.

Doucha said...

Ha, cheers Bob.
Not sfraid of using it, it - and things like it, though have spoilt me over the years.
I remember I used to love pointers when everybody said they were difficult to use...
That said, having spent only a week on this new stuff, I'm not making half as many mistakes as I was on Monday this week :)
Maybe I can be a geek after all..??
;)

Chriss Barnard said...

Hey Raj, don't worry I feel ya pain coming back from the land of c# I wanna smack someone in the head everytime I touch Objective C.