Order of Enum in Case Statement

July 12th, 2008

A while back my manager asked me if the order of the enums in a Delphi case statement changed performance: i.e. Enums in order being faster then those not.  I was pretty sure it didn’t, but thought it was worth checking out.  Time for a test application and some disassembly . . .

Read the rest of this entry »

Beyond Compare 3 Beta

July 8th, 2008

One of my favorite tools for software development beyond Delphi is Beyond Compare.  It is the best tool for comparing and merging files, directories, etc.  It is also written in Delphi.

They happen to have a Beta for version 3 available now.  Beyond a whole slew of new features for comparing and merging source files, they are also now running natively on Linux.  I sent them an email about the Linux support and they are using Kylix along with some GUI wrappers of their own to make development smoother.

click for screenshotThey have a full list of the cool features in version 3, along with upgrade information.  One of the really cool features I am looking forward to is the 3-way text merge.  I also really like the image comparison plug-in they offer.

I have found it is an indispensable tool when I am moving files between one computer to another.  If the process fails part way through do to network issues or whatever, Beyond Compare effectively lets me resume where I left off.  Additionally, I can quickly see if some of the files are out of date or corrupted.  A great way to trouble shoot system differences in testing software.

Embarcadero Keeps Coming Up

July 3rd, 2008

  • The building I work in is owned by Embarcadaro Capital Partners (See picture of the directory in the lobby.)
  • Our company headquarters is moving to the corner of The Embarcadaro and Harrison in San Francisco, CA.
  • The primary tool I use at work is Delphi, which was just purchased by Embarcadero Technologies.

Seems to be a theme here. . . .

Good-bye Old Friends

July 1st, 2008

It appears I am saying my good-bye to two of my old friends.  I knew this was coming on both accounts, but the reality is finally here.  First of all, I good-bye to Borland, hello to Embarcadero.  The people and products will still be there, but it is a new company.  I expect this to be a change for the best.  Now I need to figure out a way to re-brand all this Borland merchandise I own. . . .

My second old friend I bid farewell to is bsdg.org.  I registered the doman name when I took over as president of the Boise Software Developers Group back in 2000.  In that time it also became my first blog site, which I found quite enjoyable.  At my high point I broke the news about PDC 2005 thanks to an email from the organizer, and that resulted in links from Robert Scoble as well as many others.

As of October 2007 I moved away from Boise, and Chris Brandsma took over as president of BSDG.  At one point I debated changing to to the Borland Software Developers Group and keeping the domain name, but Delphi was already dropping the Borland roots at that point.  All my old blog posts are still there someplace, but they are hidden behind a wall of cryptic 404 errors provided by the ASP.NET CMS that was recently installed.  Rather sad.  Maybe I will migrate some of the content here. . . . .

¡ʇǝʎ ǝpoɔıun ɹoɟ ǝsn ʇsǝq ǝɥʇ

June 20th, 2008

With all the talk about the next version of Delphi fully supporting Unicode, I was pretty excited to find:

¡ʇǝʎ ǝpoɔıun ɹoɟ ǝsn ʇsǝq ǝɥʇ

Well, maybe the best use for those of us who typically only need to use standard ASCII characters. . . .

PasswordMaker

June 11th, 2008

Ever since I discovered PasswordMaker.org, I’ve been recommending it, especially in my cryptography trainings.  What it does is take a hash of your super secret password with the url of current site and creates a password.  Your super secret password is never transmitted, and since the hash is secure, it cannot be reversed to your password.  So each site has a different password, so if any one of them is compromised, then you only need to reset that one password.

Joel was looking for a solution to his password storage and syncronization issue over at StackOverflow. So I sent him an MP3 quote and they played it on their podcast.  Joel liked the solution, Jeff not so much, but his solution is to just memorize a few passwords.

Their podcast is hosted by IT Conversations now.  They played at 57:14 – The audio quality isn’t great.

Updated Delphi Road Map

April 23rd, 2008

Nick just posted an updated Delphi Road Map.  Check it out.  This looks to be one of the most significant Delphi releases in a long time.  This road map is just covers native code, not .NET – that will be in a future road map I guess.  Anonymous Methods, Generics and Unicode stand to be huge langauge and framework improvements.

Scripting Engine Unit Template

April 10th, 2008

I must say, Delphi Live Templates and the Scripting Engines are REALLY amazing.  I wanted to make a new scripting engine, but then I got to thinking that my scripting engines had a lot of similar code, so I figured I would make a Live Template to create Scripting Engines.  I based it on Nick’s BaseScriptingEngine from his article on Creating a Live Templates Scripting Engine.

I then created a Template Project for the Scripting Engine Package.  So I can pop out a scripting engine now faster then you can say “Delphi Rocks”.

I thought I would share my Scripting Engine Unit Template.  You will probably want to make your own Scripting Engine Package Template Project, but if there is enough interest I will share mine out.  You will most likely want to modify this template to suite your own framework.

[Scripting Engine Unit Template]

Note: This references my general scripting engine to create a new GUID.  You will need to do that manually until I dress up my general scripting engine for public consumption.

Delphi Random Class Namer

April 9th, 2008

Ever wonder what class to write next in Delphi?  Well, combine Delphi Live Templates (including a custom scripting engine) with www.ClassNamer.com and you never have to wonder again.

Although how to implement that class is another question.

If there is any interest in the code let me know and I will polish it up and post it.  I created a random HTTP parser script engine and then the live template does the rest.  I figured this would be a fun way to get familiar with Live Templates and the custom scripting engine.  This is a really powerful feature of Delphi.

IE vs. Standards

March 29th, 2008

Joel once again has an interesting article about Marian Headphones. To sum up, IE8 defaults to standards compliant which breaks most of the existing web sites that worked around earlier version’s of IE’s poor standards compliance. Idealists believe that is great! Pragmatists believe that breaking most of the web is a bad idea.

Here is Joel’s prediction:

The IE8 team going to tell everyone that IE8 will use web standards by default, and run a nice long beta during which they beg people to test their pages with IE8 and get them to work. And when they get closer to shipping, and only 32% of the web pages in the world render properly, they’ll say, “look guys, we’re really sorry, we really wanted IE8 standards mode to be the default, but we can’t ship a browser that doesn’t work,” and they’ll revert to the pragmatic decision. Or maybe they won’t, because the pragmatists at Microsoft have been out of power for a long time. In which case, IE is going to lose a lot of market share, which would please the idealists to no end, and probably won’t decrease Dean Hachamovitch’s big year-end bonus by one cent.

What camp are you in? Pragmatist or Idealist?

I don’t think it is completely cut and dry. I am a practical idealist personally – when possible we should do what we can to move toward the ideal standards, but continue to make existing stuff work as much as possible. Maybe with a warning that something is non-standards compliant. I am a big fan of flagging things deprecated when developing libraries. Leave the old methods in place, but let the users know that they will be going away. If possible provide tools and tips to aid in migration.

The point Joel makes that a lot of pages can’t be updated for various reasons is a valid one. Same is true of deprecating and eventually removing methods in a development library. Developers may skip a few updates, or might not have access to all the source code to make the changes required. This is especially a big deal for run time libraries that existing compiled code depends on.

Delphi has typically been really good about marking things as Deprecated and giving users plenty of warning that things might change. Indy on the other hand is pretty bad about breaking things between releases, and not providing a very clear path to making your code work with the new version. Microsoft is usually really good at supporting their users (Office) but not so hot with their developers and leaving code written in earlier IDE’s unable to compile in the new version.

I agree that is good for IE to continue to become more standards compliant, and they are in a mess of their own making, but I do believe that Joel’s point is that a lot of the standards were incomplete or didn’t cover things that were needed. Like the now deprecated <blink> tag was not in the standard, and it was only the fact that Netscape supported it as a result of user demand that caused it to be added. Netscape, Mozilla and Opera still support it, although Internet Explorer has dropped support for it.

I don’t think it is in IE’s best interest to release a browser that appears to all those browser detection scripts as IE and causes the page to render funky for IE when it is no longer necessary. This results in messed up pages. Maybe they need to change the IE user agent based on what mode IE is running in so that if it is running in standards mode then pages don’t assume it is non-standard. . . . Opera does that, which is pretty effective.