Bjarne Stroustrup: Full of crap Very nice fellow

I was reading through Bjarne Stroustrup’s The C++ Programming Language, supposedly the definitive book on the C++ language by the man who invented it, when I found a mistake in it.

In Section 7.2.2 (in the chapter on operator overloading), he says:

In particular, operator=, operator[], operator(), and operator-> must be non-static member functions; this ensures that their first operands will be lvalues.

That’s not true at all. Being member functions won’t ensure that their first operands are lvalues. And nor do the first operands even need to be lvalues. (I’m sure we’ve all written code like get_smart_pointer()->foo(), where get_smart_pointer returns an object of class type. In that situation, the first operand of the -> operator is not an lvalue.)

I suspect the real reason that operator[], operator(), and operator-> must be member functions is to prevent the first operands from being built-in types, and the reason operator= must be a member function is because the compiler needs to know at the time of the class’s definition whether or not to generate a default operator= function.

Apparently there are parts of the C++ language that Bjarne doesn’t actually understand.

(By the way, I checked two different editions of the book — an older one and a more recent one — and they both contain this error. So it wasn’t just a one-off misprint.)

Cheryl Cole is not a fashionable woman

It seems to be a standard trope in celebrity journalism to talk about what a fashionable woman Cheryl Cole is.

They’ve obviously never seen this photo:

Cheryl Chav Cole

Read the rest of this entry »

Dannii vs Cheryl (a.k.a. Goddess vs Chav)

It’s funny how quickly the public can turn on you.

This time last year, Cheryl Cole could do no wrong. She was on the cover of Vogue Magazine. She was voted sexiest woman in the world by FHM. Women liked her, men liked her, and who cares about that pesky criminal conviction for assault. I’m sure it was just a misunderstanding.

But now the headlines have changed. “Cheryl’s too thin”, “Cheryl’s showing too much skin”, “Dannii outdresses Cheryl again”.

And on top of that all: Her debut solo single is crap.

Where did it all go wrong for Cheryl? Well, I can tell you. It went wrong for her when she crossed paths with Dannii Minogue.

Dannii Minogue with motorcycle

Read the rest of this entry »

The unintentional homoeroticism of “O Canada”

The English-language version of O Canada has come under attack for a lot of reasons. People complain that it’s sexist, or dislike the reference to God, or the use of the word “native”.

But there’s a more embarrassing problem with the anthem, if you ask me: The cryptic line “True patriot love in all thy sons command”. It doesn’t make any sense.

I think a lot of people mishear the line as “True patriot love in all thy sons’ command” (i.e. in the command of all thy sons), but have another look. There is no apostrophe.

Read the rest of this entry »

Thanks a lot, C++ committee.

Hey, has anyone noticed that the function strtod, declared in the standard header file <cstdlib>, has the wrong signature?

The signature is:

double strtod(const char *str, char **endptr)

but it ought to be:

double strtod(const char *str, const char **endptr)

This means you have to use a const_cast just to use this function correctly. Gah. (This also applies to related functions strtol, stroul, and strtoll.)

This one is for all you Canadian politics geeks

Have a read of my petition regarding the appointment of the Governor General. If you like it, sign it.

Feel free to correct me on my French too.

Murder and Misogyny

On the 4th of August this year, in a quiet suburb of Pittsburgh, an armed man walked into an aerobics class full of women and opened fire. He killed three women, wounding another nine. The names of the dead were Elizabeth Gannon, Jody Billingsley, and Heidi Overmier.

memorial_door

Read the rest of this entry »

Rebel Without a Cause: More proof that people once had no gaydar

Let’s get this out of the way now: Rebel Without a Cause is not a very good movie. Despite being a part of pop culture consciousness since its release in 1955, it’s pretty… dull.

Read the rest of this entry »

“The information superhighway showed the average person what some nerd thinks about Star Trek.”

I would be remiss in my duty as a nerd if I didn’t express an opinion on the most recent Star Trek movie.

Read the rest of this entry »

Dating tips for straight men: Interacting with women

First dates

When you finally land a first date, it will not be like in the movies. Having a first date doesn’t mean the girl actually likes you. It just means she’s willing to see if you’re not a serial killer.

Do not make any grand romantic gestures. Do not plan a picnic on the beach. Do not plan a candlelit dinner. Save that stuff for when you’re sure a girl actually likes you. Otherwise it comes off as creepy.

A suitable first date is grabbing coffee at Starbucks. It should be asked casually. It might be unclear whether or not you’re actually even on a date or not. That doesn’t matter.

Read the rest of this entry »