C++: Using Boost ranges to simplify enumerations

Let’s say you’ve created a class which encapsulates an STL-style container and you now need to expose the data in that container. There are a few possibilities which we’ve probably all tried and found to be unsatifactory.

Read more »

Share/Save/Bookmark

D Development with Emacs

A few months after discovering the D programming language, I finally got around to setting up a reasonable development environment just for writing D programs. After playing around a bit with Visual Studio and a few other Windows-based text editors, I settled on using Emacs to drive my work.

Not that I’ve used Emacs much before. I’ve often had to tweak configuration files on various *nix systems. As a result I’ve gotten to know Emacs, Vi, Joe, Jed, Nano, Pico and occasionally even Ed.

Now, when I say that I “know” these editors, I mean that I can fire them up, change some text, save and exit. Get in. Get out. Nobody gets hurt.

So I was doing some late night surfing a few days ago and I ran across two very serendipitous finds:

Read more »

Share/Save/Bookmark

Objective-C Cheat Sheet

I purchased my first Mac about six months ago and have been having fun with it ever since. Being a software developer, I started poking around XCode and built a few trivial apps based on some of Apple’s tutorials just to get a feeling for Cocoa and Objective-C. I’ve put together a small Objective-C cheat sheet. It’s definitely incomplete, but it has helped me greatly with some of the unfamiliar syntax.

Objective-C Cheat Sheet Download Objective-C Cheat Sheet v. 0.1

Any comments, suggestions, errata, etc. are welcome. I will update it as necessary.

Share/Save/Bookmark

What’s a higher level language?

In his blog entry titled The Benefits of Modern Software Development, Soon Hui makes some good points about the benefits of higher level languages running on VMs versus supposedly lower level languages that compile to native code. I’m not suggesting that this is a definition of low vs. high level languages. There’s no reason a high level language can’t compile to native code and a low level language run in a VM.

There are some real benefits to these platforms, not the least of which is that the two dominant VMs, the CLR and the JVM, seemed to have inspired an revival in language development. A lot of new, interesting and powerful languages such as Scala and Clojure would probably not have come into existence without a platform already in place to support them. The ability to compile to an abstract byte-code and let the JIT compiler worry about performance has made it possible for language designers to focus on the language rather than the implementation.

Read more »

Share/Save/Bookmark

Using Boost to tokenize strings

Like most C++ programmers that came from a C background, whenever I needed to parse a string into a bunch of tokens, I reached for strtok(). Sure, it’s not thread-safe. But I can take care of that later if it becomes an issue, right?

Eventually, I ran across the STL and learned to put my strings and other objects into containers. But strtok would eventually rear it’s ugly head to break the abstraction of STL strings just so I could split up a string without putting in too much effort.

At some point, I started playing with Boost. If you’re a C++ programmer and you don’t know what Boost is, you need to go to boost.org and take a look at it right now because I guarantee that you are doing way too much unnecessary work without it. Go ahead, I’ll wait until you’re done looking around.
Read more »

Share/Save/Bookmark

Next Page »