Archive

Archive for the ‘Programming’ Category

Something Programming Related…

February 9, 2012 Comments off

Click to insert.Day 1 Keynote– Bjarne Stroustrup: C++11 Style | GoingNative 2012 | Channel 9.

We know how to write bad code: litter our programs with casts, macros, pointers, naked new and deletes, and complicated control structures. Alternatively (or additionally), we could obscure every design decision in a mess of deeply nested abstractions using the latest object-oriented programming and generic programming tricks. Then, for good measure, we might complicate our algorithms with interesting special cases. Such code is incomprehensible, unmaintainable, usually inefficient, and not uncommon.

But how do we write good code? What principles, techniques, and idioms can we exploit to make it easier to produce quality code? In this presentation, I make an argument for type-rich interfaces, compact data structures, integrated resource management and error handling, and highly-structured algorithmic code. I illustrate my ideas and guidelines with a few idiomatic code examples.

I’ve been assiduously avoiding C++ for the better part of a decade now and coding mostly Java and C# with a smattering of ObjC aside from a small brush this past year.  I read through several C++ coding style guides (ours, NASA’s, one from a national laboratory, Google), dusted off my Scott Myers books and remembered why I went over to the dark side.  The gem of this experience was finding the Joint Strike Fighter Air Vehicle C++ Coding Standards, written in part by Stroustrup.  If you’re doing embedded or mission critical C++ you should look at this guide because it probably blows the doors off whatever you’re currently using.

Another gem was bumping into this talk on Channel 9 a couple days ago.  It’s worth the time to follow along with the slides.  There’s a funny comment on slide 30 and yes, I do want my garbage collector and not just in C++ but ObjC in iOS too!

I’m not going to trade in Java or C# if I can help it, but if I have to do C++ again I’m going to push hard for C++11.

Advertisements
Categories: Programming