Wednesday, November 16, 2011

C and C++ introductory lecture rant

Alright, as announced a small rant about the course I had.

These were two lectures as part of a larger course. One a small C introduction and a follow up for a small C++ introduction, 90 minutes each.
It was annoying for me to listen to it. If my brain had the capability of throwing up, it would have.


To start out, I'm (usually) not an elitist, though I am a standard fetishist. I'm okay with using system-libraries, but I try to keep that to a minimum if reasonable.
I'm not a fan of libraries that are not cross-platform either, but each to their own.

First up, they've announced the C introduction would use some C++ elements, so we should use the cpp extension and compile with g++ (they were also kinda mixing up gcc with g++ and saying that modern C compilers would gladly compile some C++ elements).
The reason for this turned out to be just the bool type (which would be available as _Bool (or typedef'd in stdbool.h) in c99), references (C++-style, not pointers - though they've of course been mentioned as well) and function overloading.
Completely unnecessary.

There were some errors concerning the the sizeof operator (called a function) applied to arrays. Arrays decaying to pointers are ugly, though it was never clearly mentioned.
I would have mentioned that there's some ugly stuff where arrays may decay into pointers, though would have advised to look on the internet for self study if there was further curiosity.

The lecturer did not seem to know much about this himself, so the questions asked by the audience were not answered satisfactorily.


So let's go on to the C++ introduction. There were mistakes concerning the OOP and it was apparent that they've bitten of a byte (ha-ha) more than they can chew. I did not understand why there's the need of introducing TMP or some new C++11 features.
Yes, they're very sweet, but for a 90 minute introduction they should have taken a bit more time on making a conscious choice about the subset to show, since this one was really lacking.
They've also showed the std::vector as an example of the usefulness of the STL (a very fitting example with a vector of vectors °_^).

I didn't listen to the lecture too well, so I don't have as much to tell about it.


I've also had an apparently decent introduction to assembly in this same course (spanned over a (much) longer time than 90 minutes, dunno how much though) - the only 'mistake' was using AT&T/GAS syntax (<- that's a link to a comparison table) instead of Intel (which I've learned a bit before - but that's just my opinion). The reason might be for using inline assembler in gcc, although I'm pretty sure you can toggle that behavior.

We've been instructed on how to use the FPU and SSE instructions, which I did not know how to do before, so I'm happy about it. I've also gotten some more practice using assembly; I'm happy with that too.


So let's move on with our continuing mission: To explore strange new worlds, to seek out new life and new civilizations, to boldly go where no man has gone before.

No comments: