27Apr

I am much better at C++ than I recall

Posted by Elf Sternberg as programming

I have C++ on my resume because I wrote it for several clients while I was working at Spry and CompuServe, but it’s neither MicroSoft C++ nor is it particularly up-to-date.  One of the things I did not recall was that Raucous, the RADIUS-to-Oracle interface I wrote many moons ago, was written in C++.  For some reason, I was convinced that it was written in C, but no, I found an original copy of it on one of my ancient work-from-home folders and, sure enough, it was written in C++.  Not just that, but good C++.

Raucous wasn’t a particularly complicated piece of software: it listened to a shared memory message queue, passed that message to Oracle, took the response from Oracle, and dropped the response into a another shared memory queue.  It was a primitive two-way consumer-producer channel between the RADIUS server and the Oracle DB, but it was absolutely rock solid.

There were five objects total; not a huge ecosystem.  Thread, Log, Radius, Oracle, and Service.   Service, Thread, and Log were all generic server objects designed to handle any kind of internet transaction, and are pretty much an early thread-based Reactor pattern implementation.  Radius was a kind-of Service that listned to the queue, and each Radius thread had a shared handle to the Oracle object (which was written in Pro*C, an SQL-embedded C) and each query was wrapped in thread management so as to not confuse Oracle.  It was definitely a “as long as Oracle doesn’t choke, everything will work fine” kind of program, and it ran beautifully.

The thing of it was, it’s written with Literate Programming.  There’s an incredibly verbose section where I go on and on about how the shared memory deque works, mostly because it was my first foray into Solaris shared memory and I wanted to make sure I understood it before doing any more.  It’s an interesting read that way.   Even better, every major interface got its own LP document, as if I were writing independent libraries and only the int main(int argc, char *argv[]) mattered after that.

I haven’t written much C++ since then.   It was informally verboten at the last job after we had one programmer whose C++ was so good, so beautiful, so perfect and pedantic that nobody else could read it.  But if this is what I’m capable of, I should definitely get my noweb install working properly and start writing in it again.

Comment Form

Subscribe to Feed

Categories

Calendar

April 2009
M T W T F S S
« Feb   May »
 12345
6789101112
13141516171819
20212223242526
27282930