No Way…
I think I actually got a snippet of Symbian code to work on the first attempt! This is a first... Maybe I'm actually getting the hang of this. I just find the whole "descriptor" concept very odd.
Anyway, all I was trying to do was replace all plus signs with spaces. I normally wrestle with descriptor nonsense for a while but this time, I got it on the first try!
_LIT(TestData, "THIS+IS+A+TEST"); HBufC* heapBuf = HBufC::NewLC(255); *heapBuf = TestData; TPtr pHeapBuf(heapBuf->Des()); while (heapBuf->Find(_L("+")) > 0) { pHeapBuf.Replace(heapBuf->Find(_L("+")), 1, _L(" ")); } CleanupStack::PopAndDestroy(heapBuf); //Don't forget!
Bleh... stupid Symbian. Thank goodness I didn't have to change the length of the descriptor...
Variable Naming
Some in computer programming have insisted on using the prefix is for all boolean data types. I've been bumping against this lately. I think it's silly. It's a form of Hungarian notation which seems unnecessary considering that the compiler/interpreter in almost all cases will help us deal with type issues. For readabilities' sake, wouldn't it make sense to name something what it represents? For example, if the boolean variable represents the state of being done, I suppose isDone may be an OK name. But if it represents the state of something that may or may not have been done 3 years ago, a better name might be wasDone. What if we want special checking to take place if a flag is set? Should that flag be called isCheck? It seems silly -- maybe shouldCheck would work. What if we're talking about ownership or class relationship. isChild works as a name to indicate class relation, but hasChildren is a perfectly logical name to define the inverse relationship. I saw a few places that advocate the use of helping verbs (have, has, had, do, does, did, shall, should, will, would, may, might, can, could, and must) or verbs of being (am, is, are, was, were, be, being, and been) to prefix these names. This makes sense. However, we speak English and sometimes in English we drop helping verbs (think of did for example). Is something.didSucceed better or worse than something.succeeded? There are numerous similar examples.
I think in the end, naming variables to make them readable is much more important than following some convention. Or perhaps I should rephrase that: the convention we ought to follow is the convention of written English, not some tightly defined arbitrary subset.
Driving me Crazy

One thought for alleviating some of the tension in driving:
Imagine each driver on the road around you is your mother.
Really, people -- it feels better to drive places and not get there as quickly as you can because you took the time to treat others with courtesy.
Formats
I've been hitting this wall a lot recently. Just think about writing a document... Let's start with a simple document -- I just need section headers and simple wrapped paragraphs of text. No images, no tables, nothing complicated. I can do this in any simple text editor (Notepad, TextMate, SciTE, whatever). This works great at first. I can keep some notes in this format easily enough. It's easy to use -- nothing special to fiddle with.
Then something changes and I need some "special" formatting. Maybe some graphics, tables, more focus on things like margins, etc. We have a million options now. Convert it to Word? To Pages? (that's Apple's word processor for those unfamiliar) How about simply converting to HTML? I despise Word documents (especially because of the oddities associated with their formatting). Pages is nicer in a way (it doesn't get in your way while you're writing documents) but has many of the same problems. HTML is too loosely defined to display the same universally (on Firefox it will look great but something will inevitably go wrong on Safari/IE).
In the last couple years, I've started to use simple, consistent markup languages like WikiText, reStructuredText, etc. These have mostly been implemented on Wiki sites (like MediaWiki) but in theory, you could write a local application that used the same notation. These intermediate markup languages provide things like header formatting, table layouts, graphic alignment, etc. but don't tend to focus on the "page" related details like margins, headers/footers on printed output, and other details. They translate the result into a fairly rigorously tested standards-oriented HTML. This works fine for anything I don't intend to print into a glossy handout. Notes to myself, development and design comments, and many other daily working documents work well here.
But then, after several weeks of tweaking a design doc, the PHB decides that he wants to see a copy of my design. He wants it printed. Printing the wiki-based version and handing it to him results in the comment "this isn't using standard headers/footers on each page is it?" So now I'm stuck. I paste the output into Word and spend far too long formatting it for his consumption. He marks up the Word copy and I had to merge my changes back into the wiki.
What a pain.
At work, I'm mostly stuck with Microsoft tools so I tend to use Word if I have to use anything complex. However, elsewhere I typically take an additional step: converting my Word/Pages output to Adobe PDF. It's sort of the universal printable format and it works for most things.
Wiki's have definitely answered my need for most documents. The only link that's missing is how to enable Wiki's and other screen-displayed documents to be able to be easily converted to printable documents (with header/footers, page numbers, etc.). Ideally, there could be some meta-tags that did this sort of thing. The problem currently is that while a slightly varied HTML rendering is acceptable when viewing on a screen, the printable layout MUST conform to a strict standard. Maybe someone will (or already has) put together a plugin or something that will let this happen easily. I eagerly await the day...
Update: I will mention here that under the leading of a certain Coder, I was able to help build at least a partial tool that did this exact thing for my last position. It parsed MediaWiki content and converted to Word format. This was nice but it was a little limited. I'd like to see a more generic solution in place -- especially one that would allow output from the browser without having to have Word at all.
George Orwell on Writing
Not that I follow these rules, but I've had this excerpt kicking around for a while in my notes and figured I'd post it somewhere I could reflect on it:
- Never use a metaphor, simile, or other figure of speech which you are used to seeing in print.
- Never us a long word where a short one will do.
- If it is possible to cut a word out, always cut it out.
- Never use the passive where you can use the active.
- Never use a foreign phrase, a scientific word, or a jargon word if you can think of an everyday English equivalent.
- Break any of these rules sooner than say anything outright barbarous.
"These rules sound elementary, and so they are, but they demand a deep change of attitude in anyone who has grown used to writing in the style now fashionable. One could keep all of them and still write bad English, but one could not write the kind of stuff that I quoted in those five specimens at the beginning of this article"*
From George Orwell, "Politics and the English Language", 1946.
*To see the full context of what he was talking about, you can take a look at the entire essay here.
How I feel at work these days…
I've had a heck of a time staying productive this week. I don't think that it's been helping that I've been trying to do a lot things on the side. But something about this week felt different. I have clearly defined tasks but I've been procrastinating an awful lot more than usual. I tend to have 25 things to do and continually shuffle the top 5 things. I finish them and instead of hitting things farther down the list I substitute the most interesting next 5 things that I can do. So a backlog is typical. My problem is that recently I've been feeling guilty about tasks way down in the 20's and spend a lot of my "free" time trying to focus on that. So instead of knocking out high-priority tasks, I've been ineffectively working on low-priority things.
I tend to mix my personal goals, chores, continuing education, and regular work all into the same priority pile. I find it hard to segment it any other way. Unfortunately that means that at the office sometimes I'll blow time on things that aren't work related meaning that now I have to work evenings, stay late, take vacation, etc. This would ideal if I was working as a consultant and could make my own hours. I've never felt like I needed a boss to motivate me and enjoyed the shorter-term goals of contract work and the variety of experience that they innevitably demand.
Here's a list of things that I'd like out of work:
- I'd really like to be able to work with companies and individuals that need services that I can offer.
- I'd like to be able to excel in providing these services to the point that my value is clearly seen.
- I'd like my work to offer me the opportunity to be creative -- not simply implementing known entities.
- I'd like to be location-agnostic for much of my work (i.e. telecommuting should be an option for 90% of the time).
- I'd like the project sizes to be such that I can cycle to new projects or new clients every 6 months.
As a software engineer, I feel much more like a [traditional brick-and-mortar] architect than a manufacturer or general contractor. What I do should be bigger than simply implementing a known solution -- it should be validating, improving, and refining a requirement and then implementing an innovative solution that may be somewhat unexpected. I know that's a lot of buzz-words, but it seems accurate. I don't want to help people install Microsoft Word on their computers, I want to help them think about the problems of word processing, document management, collaborative editing, world-wide publishing, and the myriad of associated goals and put whatever solution in place that makes sense for them (hopefully it's not Microsoft Word).
Anyway, enough angst-filled longing for today.
...Back to the ever-fun-and-exciting C++ experience...
Cell Phones
Well my new position has been keeping me busy writing software for Symbian, Nokia's primary phone operating system. I hate it. It's fun to learn new stuff and it's probably a good thing to be learning. But it's still awful. Documentation is terrible. Developer forums have lousy support. Two unique programming elements: descriptors and the cleanup stack just make life agonizing.
I've never appreciated C# so much.
On the bright side, it's drawn me back into C/C++ coding which I haven't done in years. That part is fun. It's funny how many things I take for granted with C#. I've even gotten lazier considering some of the wonderful upgrades to C# 3.0. For example:
List<string> list = new List<string> { "Susie", "Lucy", "Bobbie" };
This makes sense to me. It's easy and straightforward. It saves [development] time.
At work things have been interesting because I've been working with developers firmly set in an embedded mindset. They think in terms of saving bytes. My .NET programs take up 20MB of RAM just in basically displaying a simple window with a few controls. It bugs them.
I don't know -- I see the point of using assembly, C, even the horrible descriptors of Symbian for situations where you are highly concerned with efficiency. However, it does seem that you're going to be forced to spend more development time (by a huge amount) and the code will almost by necessity be much more difficult to maintain. When there's no clear single way to convert a descriptor to a char * every developer will do it differently and the code will be more and more complex and incomprehensible. It might run fast, but it's not flexible.
In the world of mobile development, optimization for speed seems important but if you take 6 months to update your application when new feature sets become available, your product likely isn't selling.
Along these lines of thought, I'm considering pouring a bit of time into iPhone development. I've always shuddered at Objective C but I need to bite the bullet and get into it. My assumption is that I'll be happy with it since from what I've heard it balances maintainable, understandable and easy-to-write code with reasonable performance/stability.
I'll keep you posted.
Christ Church, Victoria, B.C.
We saw this church in Victoria, B.C. and it truly was amazing (and I believe God-centered and glorifying in its design). It's a pity that churches are often just like business offices or other "ordinary" places. I guess some would disagree but I think that a return to "great" architecture in church buildings is a wonderful thing. The UMC and some other denominations seems to have gone through a period of uglification in their architecture -- somehow trying to modernize or reinvent something that wasn't in need of an update. People in general seem to be less willing to spend the big bucks on churches than on other things like the poor and the needy. I know other issues can't be ignored, but worshiping God in a place like this seems to really help put things in perspective. Just like the robe, the solemnity of the service, and the order of the liturgy, the architecture seems to be a huge aid in the worship. I'm sure like all things in the Christian life and even those things in worship, it can become an idol but I have a hard time believing it's wasted money or effort. The Temple was a truly glorious place; a feeble attempt at showing the glory that will be revealed in heaven, but a worthy attempt. As Christians we carry out the creation mandate to bring order out of chaos in the world. A building like this that's built not to commemorate its long-standing members, nor to enshrine saints, but to stand as a place of worship -- a place set apart.
I know it's far, far away for our small group (and even a large and prosperous church like the above took over 100 years to get where they are), but I look forward to the beginning of such an effort.
Update: Regarding Dave's comment -- I wasn't very specific about what "like this" I think is good... I think it's architecture that reflects attributes of God and his nature. So yeah -- creative is a good thing but I think that awesome and majestic is important too... Obviously some of these characteristics are a little subjective. I hadn't really thought of it so much but Dave mentions the re-using and revitalizing of buildings; this seems perfectly to reflect the transformative power of God's Kingdom. Thanks Dave.
I’m getting old…
Today on the way back from work I stopped at the wonderful oasis of Fry's. I was kind of stressed out from a long and not terribly rewarding week of work and I figured that for once I'd actually just buy a game.
Well, I ended up with two games! I drove home, slightly faster than usual. After some much-needed mowing in the back and dinner I figured I'd get down to installing them. But wait, the computer I intend to install them on is in pieces after I'd tried swapping some parts around. 45 minutes later it's all assembled (I had to reattach the motherboard and everything) and booted it up. But wait, I had Ubuntu on these disks, not Vista or XP so I've got to install the wonderful Microsoft product before I can start. Vista installs quickly (I was actually sort of impressed. But not that much.) But wait, although the video card is detected and installed, the audio drivers aren't. A hardware scan doesn't even see them I power off and pop in a spare sound card that I have lying around. The audio drivers get installed and the game begins. I start with the tutorial. Patrick (who has been very patient this whole time) is interested. He especially likes when the guys I'm controlling open fire on an opposing team. Explosions, gun fire, this is great stuff. We finish up the tutorial and start the first mission. Within 30 seconds the sound card starts crackling and 10 seconds later the sound dies. I check the connectors and then check the software settings. When I try to save the software settings, the game crashes.
So, despite being home by about 7:45pm, it is now 11:45pm and I've barely even started playing the game since I've been too busy working (again). How depressing.
The worst thing is that the game felt a little confusing and difficult (I'm sure it's not -- it's just me getting old). I'm pretty sure that Patrick understood it. If I'd let him, I'm sure he'd be on there for the rest of night.
Or maybe the worst part is that I just spent the last 10 minutes writing this blog entry. So much for crazy wild 7+ hour gaming sessions. I'm lucky if I can clean out my inbox.
I'm exhausted. Time for bed.
