Login to participate
  
Register   Lost ID/password?

Louis Kessler’s Behold Blog

Interesting Twists - Sun, 26 Oct 2008

It’s only as you start doing something, that you discover a better way.

I started trying to remove the ElPack components that were in Behold. I added them several years back to do little things that Delphi 4 back then couldn’t do. My expectation was that most of these extras have by now, 10 years later, been added into Delphi 2009.

I am correct with regards to Delphi incorporating Unicode and the visual styles of Windows XP and Vista. But I found little bits of functionality - the display of the percentage on the progress bar; html links in the daily tips, an unlimited size INI file, and others - that I could have either have left out, or with some work looked for a way to replace.

The main feature of the ElPack package I was using was ElTree for Behold’s Treeview and for the Organize Pages. If my goal was to replace ElTree with Virtual Treeview, then why bother keeping the rest of ElPack for the other relatively minor components?

A few things made me change my mind, and I’ve now decided I’ll probably stick with the ElPack package, and the reasons are:

  1. Right now, everything works. Why fiddle with it?
  2. ElPack was bought by LMD and they have been actively updating it, seem to have good support and have a Delphi 2009 version available.
  3. ElTree has a virtual mode available (where the data is not stored in the tree) which gives me most of the benefits I’d get by switching to Virtual Treeview, the latter now being Open Source and is now maintained by the community rather than by its original developer.
  4. I wasn’t looking forward to the work involved in switching ElTree to Virtual Treeview and the possible loss or change of some of the current functionality.

The good news about all this is that significant progress is being made by *NOT* making these changes and therefore not delaying the schedule towards the beta. What it will take is an upgrade to the new version of ElPack, and I’ve been testing their trial version and everything (except the INI files) seems to work.

Patched Together - Sun, 19 Oct 2008

A lot of small steps are required. Delphi 2009’s method of connecting to the help file has changed, and I had to find out how to get that going. Some of my internal string constants had to be changed to Unicode, and it took awhile to track that down. The timing routine I included previously no longer works. There are other things I’ve already found and now got working.

But the major item I finished today has now got Behold semi-working again. Previously I loaded the GEDCOM file into a string buffer, and picked out the statements character by character. Under Delphi 2009 that simply failed. Now I directly load the file into a StringList in memory that already has each line as an individual item. Not only is that simpler, but Delphi 2009 is smart and converts non-Unicode into Unicode while doing it. Initial results seem to be that it is maybe a bit faster than it was before.

But there’s all sort of things you don’t expect that you accidentally stumble upon. While searching the web for an efficient way to load the GEDCOM file, I ran across a post by Jolyon Smith about String Performance. He said that the new “String Format Checking” compiler option which is turned on by default should be turned off since it incurs a performance penalty. Searching a bit more, I found this great article by Jan Goyvaerts explaining exactly why this is so. This compiler option is actually undocumented in Delphi 2009. I’m not sure how much of a difference this will make for Behold, and I can’t tell for sure until I get a profiler and do some testing. But when I’m trying to get every speed advantage that I can, these sorts of tidbits can really add up to performance improvements.

After only 8 days since I began the conversion, Behold now runs in Delphi 2009. But there’s still a number of bits and pieces, special cases, and user interface issues to clean up before this step is done.

Programmers of Today do it Differently - Fri, 17 Oct 2008

My purchase of Delphi books yesterday made me think about programming styles. I’m from the old school, I had physical hard-copy encyclopedias I actually read and browsed through. I went to the library when I needed reference material I didn’t have at home. And I learned programming from books.

Programmer of today realize they don’t need all this. They’ve got the good old WWW, search tools like Google, and reference sites online of everything you could imagine. When they have a question or a problem, they first search for the answer, and if they can’t find it that way, they post their question on a relevant Forum. I do that too, and have especially found that “Googling” error messages is very useful.

Instead of learning from books, programmers of today learn by trying. They are unafraid to open a program and just use it. They expect everything to be obvious, and if they can’t figure it out just by trying, then the program is not designed correctly. (Actually, I am trying to use that concept to keep Behold as easy to use as possible.) If they need to do something but can’t figure out how, they either go to the help file or go to the web. And they better find their answer in 10 seconds or less, or they just won’t do that action and will try something else.

That is actually an excellent way to become proficient at something. By doing you learn and when you run into problems you learn some more by solving the problems. But that can only take you to a certain level.

Once you reach a certain level of proficiency, that’s about as far as you’ll get by trying. What you need next is a good guide (a book or reference) of everything that the program does. You are at the level that you have the knowledge to understand everything the guide is referring to. You’ll start reading about all the wonderful features that you didn’t know about, those that have always been there for you to use. In my case, I’ve got to update myself from Delphi 4 to Delphi 2009 and learn the new capabilities of the programming language and development environment, and displace the old techniques that have now been superceded.

The other thing I get out of the books are ideas. Ideas that I wouldn’t have thought of on my own. Often an example given will lead me to think: I can apply that into Behold. And although Behold is unique in concept, many of its design features have been developed this way. It is much easier to develop and enhance an idea from an example, than to try to figure out how to implement an idea on its own from a blank canvas.

Now go out and get yourself a book on Microsoft Word or WIndows XP or whatever software you’ve been using for awhile that you think you’re proficient at, and see how much you’ve been missing.

By the way, I finally got Behold to compile and run under Delphi 2009 last night. It’s not inputting the registry, the Behold file or the GEDCOM file yet (probably due to Unicode changes) and it’s not closing itself properly (don’t know what this is yet), but at least I’ve got the program running again.