Empty statement of intent

I just want it on record that I intend to actu­ally bring my STM library into a feature-complete, robust and well-documented state, and then release it to the world. Con­tinue read­ing Empty state­ment of intent

C++ 2.0

Yes­ter­day, on March 25, 2011, the C++ stan­dards com­mit­tee signed off on the final draft of C++0x, the upcom­ing major revi­sion to C++.

After a month or so of edi­to­r­ial changes, proof­read­ing and inte­gra­tion of the last changes into the draft, it will be sent off for all the national bod­ies of ISO to vote on, and then we will offi­cially have a much-needed refresh of C++. Bar­ring any major sur­prises, the process should fin­ish later this year, offi­cially turn­ing C++0x into C++11.

Of course, many new fea­tures of C++0x are already avail­able in var­i­ous com­pil­ers, but later this year, all of them will become official.

A few reports from com­mit­tee mem­bers are already trick­ling out, and no doubt, there will be many more to follow:

I don’t have much more to add, other than to say a big thank you to the bril­liant peo­ple who have spent an awful lot of their time over the last 11 – 12 years to make this hap­pen. Of course, there have been a lot of casu­al­ties along the way (three “core” fea­tures were orig­i­nally envi­sioned for C++0x: an optional garbage col­lec­tor, con­cepts, and language-level sup­port for thread­ing. Of those, only the third sur­vived, although the two oth­ers may still make it into future revi­sions), but over­all, C++0x is a huge improve­ment to the lan­guage. Just a few of the fea­tures I am excited about:

  • lambda expres­sions
  • thread­ing support
  • rvalue references/move semantics
  • vari­adic templates
  • nullptr
  • sta­tic assertions
  • and of course, all the library addi­tions: hash tables, reg­u­lar expres­sions, type traits, tuples and many others.

Hating that which you don’t understand

A few days ago, I came across an inter­est­ing rant about “Why C++ Tem­plates (and STL) Are Bad”.

As any C++ pro­gram­mer who reads my blog likely knows, I’m quite fond of both tem­plates and the STL — I feel those are largely what trans­forms C++ from a clumsy and out­moded lan­guage that should’ve died 10 years ago, into a mod­ern, expres­sive, high-performance and yes, even ele­gant lan­guage that I enjoy using. Con­tinue read­ing Hat­ing that which you don’t understand

GfWL: are they trying, I wonder?

Two weeks ago, I wrote a post that you might con­sider “mildly crit­i­cal”, dis­cussing the brand new Games for Win­dows Live web-based store, and the count­less ways in which it fell apart as soon as you looked at it.

Today, I went to look at their site again, as they have Deus Ex on sale, and, while it is a 10 year old game, and I already have it, I was inter­ested in see­ing if they’d opened up the store for peo­ple out­side Amer­ica and the UK yet. Con­tinue read­ing GfWL: are they try­ing, I wonder?

GFWL: Malice or Incompetence?

Once again, Microsoft “relaunched” Games for Win­dows Live, either gam­bling that if they keep relaunch­ing the same thing, even­tu­ally every­one will just give up and start using it, or per­haps that if they keep relaunch­ing the same thing, even­tu­ally every­one will just give up and buy an XBox 360 instead. I don’t know. But it is really get­ting ridiculous.

Unlike the last time it “relaunched”, how­ever, this time it actu­ally has a new fea­ture as well: it is now pos­si­ble to view (and use) their store from a browser, or so they claim. And what’s more, games can now, appar­ently, be bought using money, actual human cur­rency, rather than imag­i­nary Microsoft Points.

In prac­tice? Not so much. Con­tinue read­ing GFWL: Mal­ice or Incompetence?

TexOverflow — it’s live!

A while ago, I made a post about the pro­posed TeX Stack­Ex­change site. Now it’s out of beta, and it’s got a brand new, and pretty sweet-looking, design. Go check it out: http://tex.stackexchange.com/

“Good design”, and why OOP isn’t going to get us there

  • in which I prob­a­bly get stran­gled by a horde of angry OOP programmers…

I find OOP tech­ni­cally unsound. It attempts to decom­pose the world in terms of inter­faces that vary on a sin­gle type. To deal with the real prob­lems you need mul­ti­sorted alge­bras — fam­i­lies of inter­faces that span mul­ti­ple types.
I find OOP philo­soph­i­cally unsound. It claims that every­thing is an object. Even if it is true it is not very inter­est­ing — say­ing that every­thing is an object is say­ing noth­ing at all. I find OOP method­olog­i­cally wrong. It starts with classes. It is as if math­e­mati­cians would start with axioms. You do not start with axioms — you start with proofs. Only when you have found a bunch of related proofs, can you come up with axioms. You end with axioms. The same thing is true in pro­gram­ming: you have to start with inter­est­ing algo­rithms. Only when you under­stand them well, can you come up with an inter­face that will let them work.  — Alexan­der Stepanov

This post is an attempt at extract­ing some­thing coher­ent from a series of com­ments I recently left on a Stack­Over­flow ques­tion about “good design” (in what’s quite clearly an object-oriented con­text). The per­son ask­ing the ques­tion has been gra­cious and patient enough to deal with my count­less com­ments repeat­edly point­ing out that he’s doing it wrong, which would prob­a­bly have dri­ven a lot of peo­ple mad.

Many peo­ple have come up with many var­ied crit­i­cisms of the object-oriented pro­gram­ming par­a­digm. My prob­lem with it is not new — in fact it is pretty much exactly what Stepanov pointed out in the inter­view I quoted above (and which is def­i­nitely worth read­ing in its full length). The only real dif­fer­ence is that he is an extremely intel­li­gent math­e­mati­cian, and I’m… not. So I’m not able to express it as con­cisely. But then, on the other hand, maybe my take on it will be eas­ier to swal­low for oth­ers who also aren’t hyper-intelligent math­e­mati­cians. Con­tinue read­ing “Good design”, and why OOP isn’t going to get us there

Yes, you’re going to have to tell me what your question is before I can answer it

It some­times amazes me how many peo­ple, pro­gram­mers as well as non-programmers seem to take offense at my lack of psy­chic abilities.

Either that, or at my ten­dency to try to answer ques­tions with a use­ful answer.

Or maybe they’re just bad at ask­ing ques­tions. Con­tinue read­ing Yes, you’re going to have to tell me what your ques­tion is before I can answer it

STL, language lawyers and pedantry

Any­one who’s been around a C++ pro­gram­mer for any length of time has prob­a­bly real­ized that we tend to be hor­ri­ble lan­guage lawyers: we only trust the ISO stan­dard describ­ing the lan­guage. We cer­tainly would never assume some­thing to work just because the com­piler hap­pens to gen­er­ate code that works right now. If it’s not in the stan­dard, we can’t count on it.

I’m fine with that. It’s often annoy­ing that we have to be so para­noid, that we so often have to double-check that our code not only com­piles, not only passes our tests, but also avoids the dreaded Unde­fined Behav­ior (where the behav­ior is not con­strained by the stan­dard), but you get used to it. And all in all, being pre­cise and spe­cific when talk­ing to a com­piler is prob­a­bly not a bad habit to get into, regard­less of which lan­guage you pro­gram in.

How­ever, every once in a while, peo­ple try to carry the same level of pedantry over into dis­cus­sions about C++. Con­tinue read­ing STL, lan­guage lawyers and pedantry

Psychic Octopuses

So the big news these days is obvi­ously Paul the Psy­chic Octo­pus. Def­i­nitely inter­est­ing. It was able to main­tain a 100% suc­cess rate in this year’s World Cup (and a much higher suc­cess rate than it had in 2008 where it mis­pre­dicted a whop­ping two matches).

So what’s going on here? Freak coin­ci­dence? Super­nat­ural pow­ers? At a first glance, both sound ridicu­lous to me.

But I want to think about the more “inter­est­ing” expla­na­tion a bit: per­haps Paul really is psy­chic. Per­haps Paul can tell the future. Con­tinue read­ing Psy­chic Octopuses