Posted: Fri Apr 11, 2008 6:00 pm
I'm really not up to scratch with C++, but I'm writing my kernel using a small subset of the language. As of yet, I have not really used C++, it's just getting compiled with g++ as opposed to gcc heh. I taught myself C several years ago, but have only recently looked into C++ (and I keep forgetting simple things because I've not been using it much, just looking into it).
I chose to go with C++ because I like the idea of objects and I like the idea of namespaces and templates. Templates are just damned sexy.
I'd always been scared of object-orientated languages, but I've had to do a couple of Java units for uni (don't mock me, they're core units, and I'll be doing C++ as an elective later--why Java is core and C++ is elective is beyond me though) and I'm starting to like the object-orientated approach, if not Java itself.
One question I have after this is, since exceptions are out, what do you developers use to signal errors inside a constructor? Seems to me the only option would be to pass a pointer to the constructor, which the constructor would store the success or failure of initialization in. After the constructor has been called, you would then have to check the value stored at specified location for an error. Seems a bit tedious (and unsightly) to me.
Cheers,
Lee
I chose to go with C++ because I like the idea of objects and I like the idea of namespaces and templates. Templates are just damned sexy.
I'd always been scared of object-orientated languages, but I've had to do a couple of Java units for uni (don't mock me, they're core units, and I'll be doing C++ as an elective later--why Java is core and C++ is elective is beyond me though) and I'm starting to like the object-orientated approach, if not Java itself.
One question I have after this is, since exceptions are out, what do you developers use to signal errors inside a constructor? Seems to me the only option would be to pass a pointer to the constructor, which the constructor would store the success or failure of initialization in. After the constructor has been called, you would then have to check the value stored at specified location for an error. Seems a bit tedious (and unsightly) to me.
Cheers,
Lee