Archive for June, 2009

Just released: Castalia 2009.2

Posted on June 24th, 2009 in Business, Castalia, CodeGear, Delphi, TwoDesk | 2 Comments »

I’m very excited to announce the latest version of Castalia, the ultimate tool for Delphi developers.

The major focus of Castalia 2009.2 has been improving the parser and adding support for many language features that have been added to Delphi in recent years. I’m very happy to say that the Castalia Delphi parser is now fully up-to-date.

In addition, Castalia 2009.2 includes the following improvements over the previous version:

* Fixed: “Index Out of Bounds” error during some context switches
* Fixed: Some Castalia features not available after line 30768 in the code editor
* Fixed: Access violation when firing a code template with an empty scope

Castalia users with a current maintenance subscription can download version 2009.2 today at http://subscribe.twodesk.com.

Everyone else can grab the free trial at http://www.twodesk.com/castalia.

Dead and Deader

Posted on June 20th, 2009 in Business, Castalia, Delphi, iPhone | 6 Comments »

Last Friday (June 12), I went out for an afternoon bike ride, and when I got home, the monitors connected to my main work computer were dark. I wiggled the mouse to bring them back to life, but they did not revive. The computer had crashed.

While such a thing had never happened with this particular computer before, we’ve all seen random system crashes, and I didn’t think anything of it. I had saved all my files before going out the door, after all.  I pushed the power button on the computer case to shut off the machine and reboot it…

…And nothing happened. The case LEDs were still on, keyboard LEDs still glowing. The machine had all the appearances of being alive, but was dead. I tried again. Held the power button down for 15 (it should turn off after 10), 20, 30 seconds. No response. It wouldn’t turn off.

Hmm. This is strange.

I flipped the rocker switch on the power supply and the machine shut off instantly. After a short wait, I flipped it back on and pressed the power button.

Nothing happened.

Again, I pressed and held the power button. No case LEDs, no keyboard lights, no fans spinning up, nothing. Great.

I love the small town where we live, but one of its downsides is that there’s no decent place to buy computer parts in a pinch. Thankfully, there’s a big internet electronics warehouse store that’s located such that when we order things with the cheapest UPS ground shipping, we almost always get them the next day. But, it being late Friday afternoon, I knew anything I ordered wouldn’t actually ship until Monday, so I wouldn’t get it until Tuesday. Oh well, at least I still have the laptop to keep me on top of things.

I ordered a new power supply, since it was obviously fried, and it arrived tuesday afternoon, just as expected. Tuesday evening, I sat down with the ailing computer and swapped out power supplies. I got it all plugged in and put together, and hit the power button.

Nothing, again.

Dangit! As most of you surely know, when you have a computer that’s just dead, the culprit is almost always either the motherboard or the power supply. In this case, I had good reason to believe the power supply was the problem. Apparently it wasn’t (or at least it wasn’t the ONLY problem). Now I need to order a new motherboard.

Again, it’s after shipping time, so anything I order will ship Wednesday and arrive Thursday. Fine. I ordered a new motherboard, and went back to work on the laptop (which, by the way, is a Mac, and doesn’t have all the Delphi versions on it that I need to work on Castalia). The new motherboard arrived Thursday afternoon, and went easily into the computer case

Cross fingers. Say a prayer. Do a rain dance. Push the power button.

It booted right up. No other hardware damage, no data loss.

The rest of Thursday was spend installing new drivers for the new chipset and audio all that stuff that comes with a new motherboard, and Friday I was finally back in action. A full week without my main computer was quite a bit of lost work, and put me behind schedule, but I’m catching up quickly.

One thing I had planned to do towards the end of the week was release Castalia 2009.2. Obviously, that didn’t happen, but final testing is looking good, and I think it’s close. Watch for it this week, as long as there are no more major hardware failures (and misdiagnoses).

The moral of the story: While I didn’t lose any data, it made me take a good look at my backup strategies. While the source code that keeps my business running was always backed up in two different places, other things (like iPhone app sales records) were not. If there had been a hard drive problem, some important things could have been lost.

So please take this opportunity to review your backup strategy and make sure that everything important is backed up and will survive a hardware failure or worse (Question: what would happen if your house burned down while you weren’t home? Would you still have your precious data intact?). We work way too hard on creating our digital lives to have them vanish at the whim of a few faulty bits of silicon. Be careful!

Naming things in code

Posted on June 6th, 2009 in Castalia, Delphi | 7 Comments »

I came across a great blog post yesterday by Robert Nystrom, Naming Things in Code.  Robert goes through a whole bunch of examples and comes up with some rules for how things should be named. Here’s a an oversimplification:

  • Type names should be nouns
  • Functions that do things should be verbs
  • Functions that return booleans should be questions
  • etc…

I don’t want to reproduce his article here. I want you to read his article.

I’ve thought for a long time that the way things are named in code is one of the most important decisions a programmer can make. I’ve also discovered that when you’re “in the flow” of creating something, stopping to decide the best name for something can be an interruption and can actually hurt your code.

Sometimes, you know you need to store some data in a temporary variable, for example, but you’re just not sure what to call it. So either you break your flow to stop and think up the right name, or you call your variable “X” and you move on.

This exact scenario is the reason that the first refactorings created in Castalia were the simple “rename” refactorings. In my opinion, the essence of refactoring comes down to two things: 1. Renaming things, and 2. Extract Method.  The whole point of both of these is to take code that you know should be organized better and to make it really easy to organize it better.

So when you realize that X should really be called “AverageUnits,” you can use Castalia Refactorings to change it with just a few keystrokes and move on, with no tedium and with no impact on the way the code works.

The point? More readable code is better code.

A quick update

Posted on June 3rd, 2009 in Castalia, Delphi | 2 Comments »

I haven’t written anything here in a while. I really should write more.  But I just wanted to quickly share something that I’m a little excited about:

I’ve fixed something like 100 parser bugs in the Castalia source code in the last several days.  These will appear in the Castalia 2009.2 release that’s slated to come out sometime in the next couple weeks.