TwoDesk Delphi Blog

TwoDesk Delphi Blog

Hi, I'm Jacob. I'm a computer programmer and the owner of TwoDesk Software Company.

In this blog, I write about the Delphi programming language and provide tips, tricks, and training for Castalia, a tool that I've written for other programmers using the Delphi programming language.

14 February 2012 ~ 0 Comments

Critical update: Castalia 2012.1.1

I’ve just released Castalia 2012.1.1, a bugfix update that fixes two bugs, one of them critical:

  • Fixed: Certain syntax error conditions can cause a runaway, memory-leaking, stack consuming, infinitely recursive zombie parser thread.
  • Fixed: A syntax error is incorrectly identified for an array member of a constant field declaration.

Castalia users with a current subscription can download Castalia 2012.1.1 at http://subscribe.twodesk.com.

Everyone else can give it a try at http://www.twodesk.com/castalia/freetrial.html.

06 February 2012 ~ 0 Comments

Castalia 2012.1 is making Delphi even better!

Castalia 2012.1 is now available, which means Delphi just got better!

This is a very exciting release. First, it includes the beta of my brand new scripting engine for Delphi. There will be a lot more blogging about this scripting engine coming up, but you early-adopter types will want to just jump in and see what you can do.

The scripting engine runs right in the Delphi IDE, and lets you write code to manipulate the contents of your Delphi editor.

It’s just a beta, and there are big plans for the future – this scripting engine is going to revolutionize the way you customize your IDE!

Castalia 2012.1 also includes several bug fixes:

  • Fixed: Delphi XE2 split editor doesn’t load color settings correctly
  • Fixed: Split editor in Delphi 2009 and later doesn’t copy text to the clipboard correctly
  • Fixed: Access Violation in the precompiler if certain registry values are blank or don’t exist
  • Fixed: “Raise” keyword not treated properly by the internal code formatter
  • Fixed: Parser doesn’t allow “Object” types to have class methods or properties (Thanks to “Thaddy,” for this fix contributed to the open source Castalia Delphi Parser).
  • Fixed: Navigation toolbar doesn’t recognize project namespace prefixes when opening external units
  • Fixed: Syntax error with a class helper for a class identified with a fully qualified name
Castalia users with a current subscription can get Castalia at https://subscribe.twodesk.com. Everyone else can download a free trial at http://www.twodesk.com/castalia/freetrial.html.
(Note: The scripting engine beta is available to current Castalia Suite subscribers, and is not included in the “Essentials” edition or the free trial).

31 January 2012 ~ 1 Comment

Rethinking the Delphi code editor

When you chose to use Delphi, you picked a great language with an absolutely perfect, flawless, IDE that couldn’t possibly be improved.

Right?

Wait, what’s that you’re saying?

It’s NOT perfect? It CAN be improved?

Ok, I admit, that was a lousy attention-getter to open with, but the fact is, I love Delphi, but I think the IDE can be improved to save you time and effort, and I’ve set out to improve it with Castalia for Delphi.

For example, Castalia adds some awesome advanced syntax highlighting that helps you understand code faster, whether it’s your own code, someone else’s code, or even your own code that you wrote a while ago and now it looks like someone else’s (we’ve all been there).

There’s also some great code navigation tools that let you find your way around that code super fast, without having to hunt for things.

<BillyMays>Plus, there’s more!</BillyMays>

In this video, I show a few ways that Castalia improves the Delphi code editor to save you time. It barely scratches the surface of what Castalia can do, but if you’re writing Delphi code, you WILL be able to do it faster after you watch this 8-and-a-half minute video:

This video requires Flash.

Give it a try. Download a free trial at http://www.twodesk.com/castalia/freetrial.html

13 January 2012 ~ 1 Comment

Never hold down the SHIFT key again

I know you’re a good programmer, and you NEVER copy-and-paste code.

Right? RIGHT?

But sometimes, for whatever reason, you do need to select a chunk of code in the code editor.

How do you do this? Are you a drag-the-mouse-around-and-hope-to-get-it-right kind of programmer? Or are you a hold-down-the-shift-key-and-use-the-arrow-keys kind of programmer?

Whichever you are, forget it, because you’re about to learn a much better way:

Castalia has a feature called “Selection Expansion” that lets you select a chunk of code just by pressing a shortcut key (Ctrl+W by default).

When you press Ctrl+W, Castalia automatically selects the identifier under the cursor. Pressing Ctrl+W repeatedly will continue to expand the selection by logical groups, selecting the current expression, statement, block, etc… until you get the selection you wanted (or the whole method has been selected).

Consider this example (keep reading, there’s a movie at the bottom!):

Pressing Ctrl+W repeatedly selects:

  1. Left
  2. FirstInd.Left
  3. FirstInd.Left+FDragOfs-GutterWid
  4. The entire Trunc() call
  5. The entire Editor.Paragraph.FirstIndent assignment
  6. All of the code in the method
  7. The entire method
Here’s a movie of Castalia’s Selection Expansion in action in the Delphi IDE

Get Adobe Flash player

Selection Expansion is just one of the many ways Castalia saves Delphi programmers time and effort. Learn more (and try it out) at http://www.twodesk.com/castalia.

09 January 2012 ~ 4 Comments

Question: What does “productivity” mean to you?

A little while ago, I asked a random sample of Castalia users to complete a survey. The primary purpose of this survey was to get feedback on how I can make Castalia better, and I tried to ask questions that would both tell me what I’m doing right as well as where I can improve.

One of the questions was “What is the primary benefit that you have received from using Castalia?”

90% of the respondents answered the question, and OVERWHELMINGLY, the responses used words like “productive” and “productivity.”

The thing is, “productivity” is one of those sort of late-90′s business management buzzwords that has come to mean so many things that it’s just about meaningless. So here’s my question for you: What does “productivity” mean to a Delphi developer?

I’ll start: I think that a productive programmer does three major things:

  1. Writes better code faster
  2. Understands code (whether his own or someone else’s) better, and faster
  3. Improves old code accurately (and faster)
As a programmer, what does “productivity” mean to you?

27 December 2011 ~ 1 Comment

Sneak Preview

I’ve been working on something new for Castalia. It’s nowhere near ready for general release, but here’s a sneak preview: http://screencast.com/t/FXaoj2AcO

In case it’s not obvious what’s going on, here’s a hint: Reversing a selection is *NOT* what’s being previewed here. ;)

23 December 2011 ~ 0 Comments

Just released: Castalia 2011.4.1

Castalia 2011.4.1 is now available. This is a bugfix release that fixes the following issues:

  • Fixed: Rename Method doesn’t work correctly with some nested method calls.
  • Fixed: Rename Method doesn’t work in some “with” statements
  • Fixed: Assertion failure in “Eliminate With” refactoring under some circumstances
Castalia users with a current maintenance subscription can download the update at the customer portal. Everyone else can try Castalia for free at twodesk.com/castalia.

29 November 2011 ~ 0 Comments

A New Look at TwoDesk.com

The Castalia website (and the rest of twodesk.com) has a new look. Check it out at http://www.twodesk.com/castalia.

21 November 2011 ~ 0 Comments

Video: Castalia Code Templates

Recently, a Castalia user asked me for a demo of how to use the Code Templates that Castalia adds to the Delphi editor. I took his suggestion and created a video:

The video is about 9 minutes long, and walks you through several of Castalia’s built-in templates:

  • if..then
  • if..then with a begin..end block
  • if..then..else
  • if..then..else with begin..end blocks
  • try..except
  • try..finally with local object creation
  • for loops
  • fori and forj, which automatically declare the looping variable if it hasn’t already been declared
Then, you’ll see the code template editor (and many more of Castalia’s included templates) and the template options dialog, where you can configure Castalia’s code templates to best work for you…
This video requires Flash.

Like what you see? Try Castalia Free or Buy Castalia for Delphi

07 November 2011 ~ 0 Comments

The Castalia Delphi Parser has a new home

The Castalia Delphi Parser, a high-speed, open-source parser for the Delphi language, has been moved from its former home at Google Code to Github. You can find it at github.com/jacobthurman/Castalia-Delphi-Parser.

The Castalia Delphi Parser isn’t very well known, but it is very useful if you need to write code that understands Delphi code. Here are a couple of projects that have made good use of the parser:

  • Obviously, Castalia - My set of Delphi IDE plugins that make Delphi even better
  • Delphi Mock Wizard - A mock object framework for Delphi
  • Anders Ohlsson’s Unicode Statistics Tool - A utility that collects statistics on how hard it would be migrate your older applications to Unicode.
The Castalia Delphi Parser is the exact same parser that’s used to make the magic of Castalia happen. From high-speed code templates and IDE scripting to smart refactoring and syntax highlighting, Castalia takes the greatness of Delphi and makes it even better.