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

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.

Con­tinue read­ing A .NET Devel­op­ers Guide to C++ (part III)

Software Transactional Memory

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: Con­tinue read­ing Soft­ware Trans­ac­tional Memory

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

Wel­come to the sec­ond install­ment in my guide of “what you need to know if you’re a .NET pro­gram­mer who wants to be able to write C++ code and call native APIs”. It took me much longer to get this posted than I’d hoped. My work on my the­sis has kept me more busy than I’d orig­i­nally expected. Sorry for the delay!

In part I, I went through a min­i­mal “Hello World” pro­gram in some detail, and attempted to explain the arcane work­ings of the C/C++ com­pi­la­tion model. Some may argue that this had no rel­e­vance to my tar­get audi­ence, but I think it is a nec­es­sary evil. Almost all C++ pro­gram­mers get tripped up at some point by the the dif­fer­ence between com­piler and linker errors, and what exactly the #include direc­tive actu­ally does. Hope­fully, by read­ing part I, you’ll be able to avoid this.

With that out of the way, we can get started on the inter­est­ing part, though. Part II will focus on actual C++ code. We won’t con­sider man­aged interop or even the Win32 API yet, though. This part will still take place in native C++-land only. In short, the pur­pose of this part is to enable you to write sim­ple C++ pro­grams, and more impor­tantly, to under­stand the C++ sam­ple code you prob­a­bly run into from time to time.

Con­tinue read­ing A .NET Devel­op­ers Guide to C++ (part II)

Thesis, yay!

Been a bit quiet on the blog front lately. I’ve been busy get­ting my master’s the­sis off the ground.

But now it is offi­cial. Con­tinue read­ing The­sis, yay!

A .NET Developers Guide to C++

One of my cowork­ers is essen­tially a self-taught pro­gram­mer, but he is inter­ested in, and wants to learn, absolutely every­thing. A year or two back, he asked me to give him a crash course in C++, because he felt it was a prob­lem that when­ever he needed to do some­thing that required func­tion­al­ity not exposed by the .NET frame­work, he essen­tially hit a wall.

So we took an after­noon out to run through some basic C++ code, and while we had fun doing it, and I’m pretty sure he found it inter­est­ing, it didn’t really achieve the goal of mak­ing him com­fort­able with writ­ing small C++ pro­grams to com­mu­ni­cate with native APIs such as the Win­dows one.

Con­tinue read­ing A .NET Devel­op­ers Guide to C++

Spam spam spam spam spam spam

Looks like the spam­mers found me. Just had to delete 10 spam com­ments that appeared overnight. What a shame. I’m going to try enabling the Akismet anti­spam plu­gin. Hope­fully it doesn’t mark real com­ments as spam. If it does, my apolo­gies. Let me know and I’ll beat it into submission.

The Great Pointer Conspiracy

One of the great tragedies of C and C++ is that they are taught wrong — that a num­ber of per­fectly straight­for­ward fea­tures are taught and described as if they were myth­i­cal and super­nat­ural enti­ties that no mor­tal can truly under­stand. Mem­ory man­age­ment in C++ is one such fea­ture (it is actu­ally very sim­ple, once you know the trick), but the biggest of all is prob­a­bly pointers.

Every­one who learns C++ fears point­ers. Every­one who is new to the lan­guage, or who has merely heard of the lan­guage con­sider point­ers to be some kind of magic — arcane con­structs that give the pro­gram­mer access to Real Ulti­mate Power — a fea­ture that both mark C/C++ as supe­rior and more pow­er­ful than other lan­guages, but is also feared as dan­ger­ous or unsafe*.

None of this is true.

Point­ers are simple.

Point­ers are not magical.

Point­ers are safe (as long as you use them only as allowed by the language)

Con­tinue read­ing The Great Pointer Conspiracy

Thesis

Finally, after too many years study­ing at DIKU, I’m about to start on my master’s the­sis. That feels weird.

But I’m still not sure what I want to write about. I’ve got a few ideas, mainly by ask­ing some of the pro­fes­sors I might want as advi­sors if they had any inter­est­ing projects lying around. Con­tinue read­ing Thesis

Just when we thought the games industry was showing a few signs of growing up…

this comes along.

At Comic Con, if you com­mit “an act of lust” with an EA booth babe and take a pic­ture, you could win din­ner with said babes, as well as a great big pile of prizes related to the upcom­ing Dante’s Inferno. That’s right, the babes won’t just get the stan­dard behav­ior and awk­ward advances — if some­one is really obnox­ious, they get rewarded for it, and then you get to see them again socially!

What absolute moron came up with this? And how did every­one else who had to sign off on it not real­ize what a ter­ri­ble idea it is?

I must say I’m dis­ap­pointed in EA. This is just giv­ing both the games indus­try and gamers a bad name, in addi­tion to giv­ing their own employ­ees even more crappy behav­ior to deal with in a job that already exposes them to plenty of it.. That kind of misog­yny just isn’t cool.

Well, at least the reac­tions are encour­ag­ing. Let’s see how they try to wrig­gle out of this PR disaster.

Markdown and web typography

As a gen­eral rule, I swore years ago to stay as far away from web design and web devel­op­ment as at all pos­si­ble. I still believe that this is one of the fun­da­men­tal rules of hap­pi­ness, and I haven’t regret­ted it, but for once, I was actu­ally impressed (rather than depressed, which is what web devel­op­ment usu­ally makes me feel like) with a few pieces of web design, and so I decided to make an excep­tion and talk about it for a moment.

After launch­ing this blog ear­lier today, I spent a bit of time research­ing how to get a more intu­itive syn­tax for for­mat­ting my posts. I’m not really a fan of “rich text” text edi­tors like the one Word­Press uses by default (luck­ily it can be dis­abled). It offers lim­ited con­trol, is awk­ward to use, and just doesn’t lend itself to well-formatted posts.

So I decided to look for alternatives.

Con­tinue read­ing Mark­down and web typography