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.

Time, text-mode, cold, stuff

This semester I've been kept quite busy. The courses are not harder than last year, but for some reason they seem to eat more time.
The Red Cross also had some chores in store for me.

I have not had much time to work on personal projects, though I've customized my start-up a little with a small script I am planning to extend a bit; right now it's asking me if it should start openbox and/or wicd (I've been recommended to use just wpa_supplicant instead; I'll take a look).
I've been working some more in text-mode. If you know of a good way to view PDF-files in the terminal, leave a comment; I'd appreciate it.
Right now, fbgs seems the only option. I'm looking at a pdf2html tool next; the text-browser of my choice is ELinks.

My preferred text-editor was nano, though I've learned to handle some basic Vim recently. I'm more accustomed to it already than when I tried to get into Emacs.


I've been sick two weeks ago and still had to do a long paramedical shift due to the little numbers of helping hands and then some volleyball matches, where I've heard some people had already jumped the boat so I didn't want to back out as well, the day after.
Since the temperatures outside have been dropping recently I felt very relieved after I got home, drank a hot tea and lied down in my bed.

The cold went mostly away during the week, I cough seldom and need to blow my nose a few times a day, but I'm feeling quite well again.


Next post - soon to come - is a small rant about a course I had.
Until then, keep yourselves out of trouble! Bye~