Jacob Thurman http://www.jacobthurman.com Programming, Design, Business, and news from TwoDesk Software Company Mon, 11 Jul 2011 20:14:21 +0000 en-US hourly 1 http://wordpress.org/?v=3.6.1 Refactoring the Blog http://www.jacobthurman.com/2011/07/11/refactoring-the-blog/ http://www.jacobthurman.com/2011/07/11/refactoring-the-blog/#comments Mon, 11 Jul 2011 20:14:21 +0000 Jacob http://www.jacobthurman.com/?p=105 I’ve decided to perform a little blog refactoring, specifically the “Extract Blog” refactoring.

People who follow this blog basically fall into two categories: Delphi programmers, and everyone else. So, for the Delphi programmers, I’ve started a new Delphi-centric blog over at delphiblog.twodesk.com. If you’re a Castalia user or otherwise follow this blog for the Delphi-related content, you’re going to want to subscribe over there.

For the “everyone else” category, this blog is going to be more of a personal-professional blog. Expect more less-technical stuff here regarding business, education, and maybe even a little bit of light business/tech related politics.

]]>
http://www.jacobthurman.com/2011/07/11/refactoring-the-blog/feed/ 0
Delphi Blog Posts http://www.jacobthurman.com/2011/07/11/delphi-blog-posts/ http://www.jacobthurman.com/2011/07/11/delphi-blog-posts/#comments Mon, 11 Jul 2011 20:05:10 +0000 Jacob http://www.jacobthurman.com/?p=103 Recent posts over on the Delphi Blog:

]]>
http://www.jacobthurman.com/2011/07/11/delphi-blog-posts/feed/ 0
Castalia User Survey http://www.jacobthurman.com/2011/06/09/castalia-user-survey/ http://www.jacobthurman.com/2011/06/09/castalia-user-survey/#comments Thu, 09 Jun 2011 22:25:21 +0000 Jacob http://www.jacobthurman.com/?p=100 http://survey.io/survey/f56ae

I have a favor to ask Castalia users:

Would you take a few minutes and answer an 8-question survey about how you use Castalia?

I’ll use this information to improve the product and to direct the planning of new features.

Thanks in Advance!

Here’s a link to the survey: http://survey.io/survey/f56ae

–Jacob

]]>
http://www.jacobthurman.com/2011/06/09/castalia-user-survey/feed/ 0
Announcing Castalia “Essentials” http://www.jacobthurman.com/2011/05/03/announcing-castalia-essentials/ http://www.jacobthurman.com/2011/05/03/announcing-castalia-essentials/#comments Tue, 03 May 2011 16:38:06 +0000 Jacob http://www.jacobthurman.com/?p=98 I’m excited to announce the Castalia “Essentials” edition. Castalia Essentials includes the most commonly used features of my Castalia Delphi IDE add-in, for a very affordable price.
Castalia Essentials includes the following features:
* Structural highlighting
* Parenthesis matching
* Flow control highlighting
* Navigation toolbar
* Smart home key
* One-key comments
* Smart keys
* Automatic declared case correction
* Automatic line wrap
* Editor line numbers (D5-D7 only)
* Fix line breaks
For a full feature comparison, visit http://twodesk.com/castalia/compare.html. For more information about Castalia, and to download a fully-functional free trial, visit http://www.twodesk.com/castalia.

I’m excited to announce the Castalia “Essentials” edition. Castalia Essentials includes the most commonly used features of my Castalia Delphi IDE add-in, for a very affordable price.

Castalia Essentials includes the following features:

* Structural highlighting

* Parenthesis matching

* Flow control highlighting

* Navigation toolbar

* Smart home key

* One-key comments

* Smart keys

* Automatic declared case correction

* Automatic line wrap

* Editor line numbers (D5-D7 only)

* Fix line breaks

For a full feature comparison, visit http://twodesk.com/castalia/compare.html. For more information about Castalia, and to download a fully-functional free trial, visit http://www.twodesk.com/castalia.

]]>
http://www.jacobthurman.com/2011/05/03/announcing-castalia-essentials/feed/ 1
Just released: Castalia 2011.2 http://www.jacobthurman.com/2011/05/03/just-released-castalia-2011-2/ http://www.jacobthurman.com/2011/05/03/just-released-castalia-2011-2/#comments Tue, 03 May 2011 16:23:44 +0000 Jacob http://www.jacobthurman.com/?p=95 I’m pleased to announce the newest update to Castalia, my collection of Delphi IDE enhancements. This update includes several new features and major bugfixes:
* New: Ctrl+W selection expansion (http://www.twodesk.com/castalia/codingassistance.html#selectionexpansion)
* New: Automatic declared case correction (http://www.twodesk.com/castalia/codingassistance.html#casecorrection)
* New: Some refactorings now have a preview to show what the refactoring will do
* Improved: If a variable declaration of the required type already exists, the new variable will be added to that declaration. If not, new variables are added at the end of the var section instead of the beginning.
* Improved: Structural highlighting is now much more tolerant of unmatched parenthesis or square brackets
* Fixed: Refactoring menu flickers
* Fixed: Code formatter mangles dynamic array types
* Fixed: “International” characters typed with “dead keys” don’t work in the code editor with Castalia installed.
* Additional small bugfixes and performance improvements
Current users can download Castalia 2011.2 at http://subscribe.twodesk.com. Everyone else can get a free trial at http://www.twodesk.com/castalia

I’m pleased to announce the newest update to Castalia, my collection of Delphi IDE enhancements. This update includes several new features and major bugfixes:

* New: Ctrl+W selection expansion (http://www.twodesk.com/castalia/codingassistance.html#selectionexpansion)

* New: Automatic declared case correction (http://www.twodesk.com/castalia/codingassistance.html#casecorrection)

* New: Some refactorings now have a preview to show what the refactoring will do

* Improved: Local variable insertion (inline variable declaration and various refactorings) is more intelligent: If a variable declaration of the required type already exists, the new variable will be added to that declaration. If not, new variables are added at the end of the var section instead of the beginning.

* Improved: Structural highlighting is now much more tolerant of unmatched parenthesis or square brackets

* Fixed: Refactoring menu flickers

* Fixed: Code formatter mangles dynamic array types

* Fixed: “International” characters typed with “dead keys” don’t work in the code editor with Castalia installed.

* Additional small bugfixes and performance improvements

Current users can download Castalia 2011.2 at http://subscribe.twodesk.com. Everyone else can get a free trial at http://www.twodesk.com/castalia.

]]>
http://www.jacobthurman.com/2011/05/03/just-released-castalia-2011-2/feed/ 0
Looking for some beta testers http://www.jacobthurman.com/2011/02/18/looking-for-some-beta-testers/ http://www.jacobthurman.com/2011/02/18/looking-for-some-beta-testers/#comments Fri, 18 Feb 2011 20:27:39 +0000 Jacob http://www.jacobthurman.com/?p=93 There’s some really cool stuff coming up in Castalia’s future, and I’m looking for a handful of people who are willing to tread the exciting waters of beta testing. You’ll get to live on the absolute bleeding edge of IDE tools, and you’ll get to see, experience, and influence new tools that are used by thousands of Delphi developers.

I don’t want this to sound too much like a headhunter’s job inquiry, but interested individuals should meet the following requirements:

  • You must already be a Castalia user with a current active subscription.
  • You should know how to write a good bug report
  • You should know how to use IRC. There will be a private IRC server set up for quick discussion. (If you can’t IRC for whatever reason, you should at least be a Skype user)

If you’re interested, contact me here: http://www.twodesk.com/contact.html (or any other way you’re used to getting in touch with me, if we already know each other).

]]>
http://www.jacobthurman.com/2011/02/18/looking-for-some-beta-testers/feed/ 1
Random thoughts on refactoring tools http://www.jacobthurman.com/2011/02/10/random-thoughts-on-refactoring-tools/ http://www.jacobthurman.com/2011/02/10/random-thoughts-on-refactoring-tools/#comments Thu, 10 Feb 2011 20:28:17 +0000 Jacob http://www.jacobthurman.com/?p=90 (You’ll have to forgive me on this one. This post is kind of rambling stream-of-consciousness, but it’s been on my mind the last few days.)

I’ve been thinking a lot about refactoring the last few days, and about how the tools we use (and create) for refactoring are involved in the refactoring activity. Here are some random thoughts:

First, I’ve realized that refactoring is more than just applying the changes to code. It seems there are a few steps (and decisions) involved:

  1. Recognize or decide that a particular piece of code needs to be refactored.
  2. Choose a refactoring to be applied.
  3. Apply the refactoring.

Automated refactoring tools, including the ones that come with Castalia, are really good at making step #3 painless and accurate, but we only use them after we’ve gone through the mental effort of steps 1 and 2.

Unfortunately, generally speaking, these steps are in reverse order of difficulty. The truth is, it’s relatively easy to break a refactoring down into specific steps. Any decent programmer could follow the steps in Fowler’s book, or a better programmer could turn those steps into an automated tool.

It’s harder to know which refactoring to apply in a given case. Yes, knowing when to apply “Rename Local Variable” is easy, but it takes some experience to know when to use “Tease Apart Inheritance” or “Extract Hierarchy.”

So knowing which refactoring to apply in a given situation can be hard, but it gets worse: How do you recognize when you need to refactor in the first place? Step 1, recognizing the need for refactoring, requires the identification of “smells,” and that seems to only come with considerable experience.

So, recap: The first step in refactoring, recognizing that refactoring is needed, is the hardest part of the refactoring process. The next step, figuring out which refactoring to apply, can also be difficult. The third step, actually doing it, is considerably easier, and is made even easier by automated refactoring tools.

Sometimes, the recognition and decision steps are just confusing. Take, for example, a very long and complex function for drawing a control to the screen. It has painting code with device contexts and/or canvases. It has code for manipulating the data behind the control so that it can be drawn. It has code for drawing the control itself (borders, backgrounds, etc). It has code for drawing the graphical representation of the data. It has a lot of conditionals for drawing selected text or a selection rect or an insertion caret. This is one long method, and it does a lot of things.

We’ve all written code like this (it seems especially easy to do with drawing code for some reason).

Now, in examining the method, the first thing we do is notice that it “smells.” It’s too long. Some of you reading this will say “Well duh, obviously a method that’s that long needs to be fixed.” Others will say “Duh, obviously a method that’s doing that many different things needs to be fixed.” Others (who will never admit it) will say “What’s wrong with a really long method? It’s fine.”

Anyway, we’ve recognized the smell. We decide that it needs to be refactored. Step 1 accomplished.

Now, what do we do with it? Well, there are a number of refactorings that can help make a method shorter. Off of the top of my head, there’s “Inline Temporary Variable,” “Replace Temp With Query,” “Decompose Conditional,” and of course, “Extract Method.” Knowing which of these to apply takes experience, and knowing where to apply them takes quite a bit of effort as well (This is particularly true for Extract Method).

Once you’ve decided that what you need to do is Extract Method, and that you need lines 20-35 to become their own method, it’s trivial to select those lines and choose “Extract Method” from the Refactoring Menu. The tool does the rest.

I used to think that the tool was doing the hard part here. It was ensuring that your code’s behavior didn’t change. It was ensuring that the new method got inserted the right way with the right syntax. It was taking replacing what could be a few minutes to a few hours of tedium with a fast, painless process.

The curious thing is that with that problem solved, good refactoring takes less time, but it still seems to require more mental effort than it should.

So for someone who writes software that’s intended to help other programmers be more productive, this brings up a lot of interesting (and mostly┬árhetorical) questions:

  • Can the tool help you recognize smells? (I say yes, and that’s what static code analysis is for)
  • Can the tool help you decide which refactoring to apply? How does a tool know when a variable should be renamed? How does it know which part of an overly-long method should be extracted?
  • If the tool can do any of these things, how should it present the information to the user?

These are just a few of the things that have been on my mind lately. I’d love to hear what you think.

P.S. This seems to be somehow related to the whole “discoverability” issue I wrote about here.


I’m the creator of Castalia, a leading tool for Delphi programmers. Castalia can help you write code that needs less refactoring, and when you do need to refactor, Castalia makes it easy and fun. Check it out at http://www.twodesk.com/castalia.

]]>
http://www.jacobthurman.com/2011/02/10/random-thoughts-on-refactoring-tools/feed/ 3
TwoDesk is on Twitter http://www.jacobthurman.com/2011/02/07/twodesk-is-on-twitter/ http://www.jacobthurman.com/2011/02/07/twodesk-is-on-twitter/#comments Mon, 07 Feb 2011 19:31:34 +0000 Jacob http://www.jacobthurman.com/?p=88 Are you a Twitter user? Follow @twodesk for Delphi/programming related stuff.


I’m the creator of Castalia, the ultimate Delphi IDE add-in: Advanced syntax highlighting, smart code navigation, intelligent coding help, and more! http://www.twodesk.com/castalia

]]>
http://www.jacobthurman.com/2011/02/07/twodesk-is-on-twitter/feed/ 0
“RTFM” http://www.jacobthurman.com/2011/02/03/rtfm/ http://www.jacobthurman.com/2011/02/03/rtfm/#comments Fri, 04 Feb 2011 00:43:34 +0000 Jacob http://www.jacobthurman.com/?p=86 Mailchimp is my favorite web service of the day, simply because their API docs include “rtfm” in the URL:

http://www.mailchimp.com/api/rtfm/


I’m the creator of Castalia for Delphi, a highly intelligent Delphi IDE add-in that adds advanced syntax highlighting, powerful code navigation, intelligent code analysis, automated code refactoring, smart coding assistance, and more to the Delphi IDE. Try Castalia today!

]]>
http://www.jacobthurman.com/2011/02/03/rtfm/feed/ 1
New website and free programming books http://www.jacobthurman.com/2011/01/31/new-website-and-free-programming-books/ http://www.jacobthurman.com/2011/01/31/new-website-and-free-programming-books/#comments Tue, 01 Feb 2011 04:23:33 +0000 Jacob http://www.jacobthurman.com/?p=84 Just a couple of hours ago, I flipped the switch on a complete redesign of the website at http://www.twodesk.com. That’s the exciting part for me, but here’s the exciting part for you:

We’re giving stuff away!

Sign up for our new mailing list at http://www.twodesk.com and we’ll send you our PDF 10 Keyboard Shortcuts Every Delphi User Should Know absolutely free.

We’re also giving away free programming books. Every month we’ll pick one random person from the mailing list and send them a valuable book. We’re starting off with Kevlin Henney’s 97 Things Every Programmer Should Know.

Come give the new website a look at http://www.twodesk.com.

]]>
http://www.jacobthurman.com/2011/01/31/new-website-and-free-programming-books/feed/ 2