Archive for the ‘Programming’ Category

The downside to “dogfooding”

Wednesday, January 13th, 2010

A term that’s become very pop­u­lar, and which espe­cially Microsoft’s devel­op­ers seem to cham­pion, is “dog­food­ing”. The idea that as a devel­oper, you should use your own prod­ucts on a daily basis, even dur­ing devel­op­ment. This exposes you to all the weak­nesses and flaws of the prod­uct, and makes you much bet­ter equipped to deliver a prod­uct that’s actu­ally worth using. (more…)

The meaning of RAII — or why you never need to worry about resource management again

Saturday, January 2nd, 2010

I tried really hard to come up with some witty title or pun to weave into the title of this post. I couldn’t. RAII is just a ter­ri­ble name, and it isn’t really clever or funny. Unfor­tu­nately, it is also the sin­gle most impor­tant key to C++. It is not just an idiom but a fun­da­men­tal phi­los­o­phy used to solve almost any prob­lem in the lan­guage. So we can’t really avoid it.

If I had to pin­point one thing that marked the dif­fer­ence between a skilled and an unskilled C++ pro­gram­mer, it would be “do they under­stand RAII”. Many peo­ple don’t, hence this post. (more…)

Hopes for 2010: Microsoft Visual C++

Wednesday, December 30th, 2009

As I men­tioned ear­lier, I’d like to cel­e­brate the new year by call­ing out a few prod­ucts I’d like to see improved in the new year.

First in line is Microsoft’s C++ com­piler and IDE. (more…)

Adventures in Microoptimizations

Sunday, December 20th, 2009

A friend recently asked me for “the sim­plest opti­miza­tion prob­lem I could think of”. This led to a fun dis­cus­sion of low-level opti­miza­tion and how the CPU exe­cutes your code. And so I decided to share it here. (more…)

Houston, we have a (performance) problem

Tuesday, December 15th, 2009

Ouch. These last few days, I’ve been fix­ing a few lin­ger­ing bugs in my STM sys­tem, and last night, I finally nailed them. Specif­i­cally, it is now pos­si­ble to open vari­ables within a trans­ac­tion as read-only. An obvi­ous opti­miza­tion, right? At least that’s the idea. Less work is required by the STM sys­tem if we can trust that the vari­able isn’t mod­i­fied by this trans­ac­tion. (more…)

Using My STM Library

Monday, November 30th, 2009

As promised yes­ter­day, I’d like to show off a few bits of my STM library. Of course it’s far from done, and is still miss­ing sev­eral key fea­tures, but the core library is in pretty good shape. So as they say on the inter­nets, “my STM library, let me show you it” (more…)

Getting back on track

Sunday, November 29th, 2009

We’ve more or less set­tled in our new apart­ment, and we’ve got inter­net… sort of! (more…)

Being functional in an imperative language

Saturday, October 3rd, 2009

By now, I’ve read an awful lot of papers about STM sys­tems, and cer­tain trends are really start­ing to stand out, not so much in terms of the algo­rithms used or the clever schemes invented to make trans­ac­tions appear atomic, but in how they inter­face with the actual language.

It has really under­lined to me just how deeply entrenched most Java, C and C++ pro­gram­mers are in the imper­a­tive mind­set. (more…)

A .NET Developers Guide to C++ (part III)

Thursday, October 1st, 2009

We’re near­ing the end!

Part I focused on the very fun­da­men­tals of C and C++, mak­ing sure that you under­stand the build sys­tem and the very basics of the syntax.

Part II expanded on this to teach you all the C++ you’ll need to do basic work in the lan­guage, includ­ing a few use­ful parts of the stan­dard library, such as vec­tors and strings.

You now know all the basics we need, and the actual Win32 API should now be very sim­ple to deal with. Not ele­gant or con­sis­tent, but com­pre­hen­si­ble as long as you keep a close eye on the doc­u­men­ta­tion and take noth­ing for granted.

(more…)

Software Transactional Memory

Saturday, September 26th, 2009

As I men­tioned a few weeks ago, I’m writ­ing my master’s the­sis on soft­ware trans­ac­tional mem­ory (STM).

Of course it is still early in the process, and while I’ve got some ideas for my imple­men­ta­tion, and have started pro­to­typ­ing parts of it, most of the time has been spent catch­ing up on all the exist­ing work in the field.

Lit­tle did I know when I accepted the sub­ject that there’d been writ­ten that many papers about it over the last decade. Phew… A com­menter asked me for the ref­er­ences I found use­ful, so here’s an incom­plete list: (more…)