Getting back on track
We’ve more or less settled in our new apartment, and we’ve got internet… sort of! Continue reading Getting back on track
We’ve more or less settled in our new apartment, and we’ve got internet… sort of! Continue reading Getting back on track
Sorry for the lack of updates. I haven’t forgotten about this blog, but real life has kept me busy. The lease on my apartment expired November 1st, so the last two months or so have been spent trying to find a new apartment (with greater and greater urgency as the deadline got nearer). Continue reading Still busy
By now, I’ve read an awful lot of papers about STM systems, and certain trends are really starting to stand out, not so much in terms of the algorithms used or the clever schemes invented to make transactions appear atomic, but in how they interface with the actual language.
It has really underlined to me just how deeply entrenched most Java, C and C++ programmers are in the imperative mindset. Continue reading Being functional in an imperative language
We’re nearing the end!
Part I focused on the very fundamentals of C and C++, making sure that you understand the build system 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 language, including a few useful parts of the standard library, such as vectors and strings.
You now know all the basics we need, and the actual Win32 API should now be very simple to deal with. Not elegant or consistent, but comprehensible as long as you keep a close eye on the documentation and take nothing for granted.
Continue reading A .NET Developers Guide to C++ (part III)
As I mentioned a few weeks ago, I’m writing my master’s thesis on software transactional memory (STM).
Of course it is still early in the process, and while I’ve got some ideas for my implementation, and have started prototyping parts of it, most of the time has been spent catching up on all the existing work in the field.
Little did I know when I accepted the subject that there’d been written that many papers about it over the last decade. Phew… A commenter asked me for the references I found useful, so here’s an incomplete list: Continue reading Software Transactional Memory
Welcome to the second installment in my guide of “what you need to know if you’re a .NET programmer 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 thesis has kept me more busy than I’d originally expected. Sorry for the delay!
In part I, I went through a minimal “Hello World” program in some detail, and attempted to explain the arcane workings of the C/C++ compilation model. Some may argue that this had no relevance to my target audience, but I think it is a necessary evil. Almost all C++ programmers get tripped up at some point by the the difference between compiler and linker errors, and what exactly the #include directive actually does. Hopefully, by reading part I, you’ll be able to avoid this.
With that out of the way, we can get started on the interesting part, though. Part II will focus on actual C++ code. We won’t consider managed interop or even the Win32 API yet, though. This part will still take place in native C++-land only. In short, the purpose of this part is to enable you to write simple C++ programs, and more importantly, to understand the C++ sample code you probably run into from time to time.
Continue reading A .NET Developers Guide to C++ (part II)
Been a bit quiet on the blog front lately. I’ve been busy getting my master’s thesis off the ground.
But now it is official. Continue reading Thesis, yay!
One of my coworkers is essentially a self-taught programmer, but he is interested in, and wants to learn, absolutely everything. A year or two back, he asked me to give him a crash course in C++, because he felt it was a problem that whenever he needed to do something that required functionality not exposed by the .NET framework, he essentially hit a wall.
So we took an afternoon out to run through some basic C++ code, and while we had fun doing it, and I’m pretty sure he found it interesting, it didn’t really achieve the goal of making him comfortable with writing small C++ programs to communicate with native APIs such as the Windows one.
Looks like the spammers found me. Just had to delete 10 spam comments that appeared overnight. What a shame. I’m going to try enabling the Akismet antispam plugin. Hopefully it doesn’t mark real comments as spam. If it does, my apologies. Let me know and I’ll beat it into submission.
One of the great tragedies of C and C++ is that they are taught wrong — that a number of perfectly straightforward features are taught and described as if they were mythical and supernatural entities that no mortal can truly understand. Memory management in C++ is one such feature (it is actually very simple, once you know the trick), but the biggest of all is probably pointers.
Everyone who learns C++ fears pointers. Everyone who is new to the language, or who has merely heard of the language consider pointers to be some kind of magic — arcane constructs that give the programmer access to Real Ultimate Power — a feature that both mark C/C++ as superior and more powerful than other languages, but is also feared as dangerous or unsafe*.
None of this is true.
Pointers are simple.
Pointers are not magical.
Pointers are safe (as long as you use them only as allowed by the language)