D2005

When Delphi 2005 works it works well, Here are some of the best features.

5/28/2005 Permalink

iPod my Car

The only way this is Delphi related is that I used it to listen to a Borland Radio show. I put an iPod in my car.

5/28/2005 Permalink

Delphi 2005 for .Net

I have been using Delphi for DotNet 2005 full time for a month now. I would love it, I would love all the features but the damn thing locks up so much that it is amost unuseable and I have all three patches on a brand new PC.

It is almost enough to move me to Visual Studio. Fix the bugs Borland.

5/26/2005 Permalink

Making Wrong Code Not Compile

The advantage of a strongly typed language like Delphi is you can use the compiler to help find a lot of bugs.

Codefez > Home > Making Wrong Code Not Compile
In fact, I'd have to say that if you have "primitive data" that has other attributes or properties, or that is constrained in some way, then it should be an object, an instance of a class that you write to enforce the constraints, etc. Let the compiler take the heavy load of making sure you use the data properly, not some wacky naming convention.

 

5/26/2005 Permalink

The Code Project - TraceTool 4.1: A trace framework and a visual trace utility - C# Programming

This may by the replacement I use for overseer. I am now doing .Net development in Delphi 2005. So I need a new logging tool, this one works with most languages and is written in Delphi if I need to extend it.


The Code Project - TraceTool 4.1: A trace framework and a visual trace utility - C# Programming
The problem when debugging a multi tier system (with perhaps multiple languages) is that traces are placed in different log files, in different formats and in different locations on the network.

Update: I switched to Codesite.
 

 

4/29/2005 Permalink

User Interface Design

UI Design is a topic I always pay close attention to. It is often overlooked yet something where a little effort can give a huge return. It is usually no more expensive to write a good UI. On the flipside a bad UI will incure hidden costs with support and unhappy users.

This quick read will get a few easy to implement top level points. Use it yo go back and tweak your application. The costs will be little but the rewards will be a happy user.

A Summary of User Interface Design Principles
This document represents a compilation of fundamental principles for designing user interfaces, which have been drawn from various books on interface design, as well as my own experience. Most of these principles can be applied to either command-line or graphical environments.


 

 

4/23/2005 Permalink

How to Use Actions, Action Lists, and Action Managers

Delphi 4 and above support actions. If you have not used them take a read of this borland paper by Brian Long from 2003. It give a good introduction to what they can do. Since I was introduced to them they have become very useful

4/22/2005 Permalink

Another NET Developer's Guide?

This is not really a surprise. I am buying less Delphi books these days. It is a great product but I get any new Delphi knowledge I need from blogs these days (via RSS)

 

"I'm sorry to say that I am not going to write a follow up to the Delphi for .NET book." Xavier Pacheco


 

 

4/22/2005 Permalink

Delphi Papers Online

Borland has put the papers from the 2003 and 2004 conferences online. I'll go through them and link to the interesting ones here.

4/20/2005 Permalink

New Job

Sorry for the break in posting I am getting a new job.

4/5/2005 Permalink

Title Bar Size

I develop under Windows XP I have always been annoyed with how much space the title bar takes up under windows XP if you turn the themes on. When you are on a small monitor it can use precious pixels.

This is what it normally looks like

Title Bar

But it can be resized smaller.

Smaller Title Bar

You just change the display settings here.

Display Settings

 

 

1/26/2005 Permalink

Debug only what you want to debug

Write this down:

{$D-,L-}

If you add this compiler directive to your Delphi unit the IDE wont try to step into it when you debug.

This is extremely useful if you have units the debugger steps into often, usually because they respond to messages or do painting, but you know they are bug free and do not need to be debugged.

If you do need to step into the unit just comment out the complier directives.

I guarantee you will be more efficient debugging once you use this directive. You can get advance by wrapping the compiler directive above in another directive to allow it to be conditionally applied depending on what you are debugging.

{$IFDEF DEBUG_ALL
{$D+,L+}
{$ELSE}
{$D-,L-}
{$ENDIF}

Note: All of these directives apply to the whole unit and cannot be used to wrap a procedure or code section.

 

1/20/2005 Permalink

Just 1 line of code.

I was fixing/debugging/enhancing some code and came across this 1 line of code.
 
    PrintSendStatement(1,sessionStatementGrid);
 
The line was so good yet so bad all at once. This is what I was able to work out just by looking at this line of code.
 
Firstly it was calling a procedure named PrintSendStatement. Which seems like a well named procedure I can guess exactly what it does. The code that prints statements and the code that sends statements must be very similar so one procedure that does both seems reasonable. I have no idea the scope of the called procedure but from it's name it does not seem relevant. Score: +1
 
The second parameter is the number 1. This just kills me. I can see another line that calls the same procedure with a zero as the first parameter. Without further digging I have no idea what zero and one mean other than guessing one prints and the other one does not. A constant would have been super cool here. It would have taken maybe 30 seconds for the original developer to do. Now it will take me and every other developer for the rest of time 30 seconds to look it up. Score -2
 
The third parameter is a grid. Which surprised me as I would have expected a different colection or a single variable to be passed. A grid is a weird collection to use so it told me something. It told me that PrintSendStatement probabley had a very local scope and it needed a grid as a parameter. No-one would choose a grid as a parameter so it must be required. Why? Grids allow the user to select or multiselect records. I can infer that PrintSendInvoice will print or send the select records in the grid. Score +1. But I'm taking off another point because if PrintSendInvoice is local then constants really should have been used, the developer can't fall back on the excuse 'I copied the code and that is the way it was'.
 
Total Score : -1.
 
So now I have to dig into PrintSendStatement and see what it does. I didn't want to do this. I was fixing something else. I really need a timesheet code to charge back the original developer and bill him/her.
 
Should I put constants in now?

  • Yes: That will save time for all developers going forward.
  • No: I'm not here to touch that code. Plus I'd have to search for all the ones and zeros to keep things consistent. This could take a while.
  • Compromise: Just add comments at this location to help the next developer without creating any new bugs.


What would you do?
 

1/17/2005 Permalink

King Blogger

In the land of the information starved the blogger is king.

1/17/2005 Permalink

Finding Delphi Apps

This is an old trick. If you want to know if an app was written in Delphi. In the task bar right click on it. If the menu only has three choices: Restore, Minimise, Close then it is most likely a Delphi app.

This is not 100% accurate but it is right most of the time. There is a fix for it which is why it is not right all the time.

1/17/2005 Permalink

Day 2ish of Delphi 2005

Now I am getting this trying to install some packages. I have already spent 2 hours on it.

---------------------------
Error
---------------------------
Cannot load package 'rtl70.'  It contains unit 'ZLib,'which is also contained in package 'rtl90'
---------------------------
OK  
---------------------------

None of my google searches have found a reason for it and I do not like any of the work arounds.

Update: It seems to be a path issue.

Update2: This is what I did to fix it.

Find all my Delphi 7 BPLs in my system32 folder. Then I moved them to a new folder on my desktop. Basically moved them out of my path. Once I did this Delphi asked me to recompile another BPL and then it was all done.

I have not had to use Delphi 7.0 any more so I have not moved the components back but I am sure it would work.

1/17/2005 Permalink