CodeGear has published the roadmap for 2 of it’s major products Delphi and C++ builder.
Moving to .NET Platform, A difficult choice? May 20, 2007
I am working on a product which is developed using Delphi for Win32. Originally Delphi 7 was used and we then moved to Delphi 9 (Delphi 2005) and are now planning to move to Delphi 10 (Delphi 2006). I have to admit that despite the originally reluctance in accepting the Delphi as the long term development technology, I have now grown to simply love it. You know what I like about Delphi most? The fact that it solves the real world problems!
You know there is lot of technology talk always going on. Every second day you hear the announcement of a new language, new database technology, new framework which would just magically solve all your problems. But if you have worked even for few months in software industry (as I have), you will realize there is no such thing which can solve all our problems magically. Language, framework and components just assists you do your job and *nothing* can replace a good programmer. Still Delphi provides the simple to understand and simple to use framework which suits most developers. This is because real developers like to find the “most appropriate way” to solve a problem in given time and resources and not essentially the “best way”. Lengthy and exhaustive time, performance, use analysis is luxury of few developers, who program in a garage and for fun.
Everything was working fine until my organization had to think “What to do about .NET platform? Do we need to go for it?”
After thinking for sometime, I concluded couple of points:
- Developers (who actually get to work on product) like to work on a technology which is popular in market. Perhaps it makes them feel safer that it will not be too difficult to find another job, just in case. If you ask “Why you like to work on .NET?” it would be difficult for them to answer. Perhaps the only answer is “because every second person seems to talk about .NET”.
- It doesn’t matter to the organization whether its developers are using .NET or Java or Delphi; it wants to deliver the right solutions to customer at right time.
During my initial couple of months in software development, I used to find so many problems with existing code/structure/design etc. Even a stupidly named variable would drive me nuts. It’s not that now I don’t care about how variable are named but you just can’t make everyone to name variables like you. You have to adjust somewhat somewhere. I always liked to do things the perfect way and I still do, but now I also think “what is more important? Renaming the variable to my taste in 20 odd units or shipping the product to customer next week?” Don’t take me wrong, I am a real nasty person in this regard; I would still rename the variable in 20 odd units but only in next planned release!
In coming few days, a decision will be made by me and few senior people (who I actually admire). Lets see what comes up!
Delphi Compiler Version Directives March 6, 2007
|Here is a list of Delphi Compiler version directives. I searched few places but none could give me complete list (A page on About.com was closest to completion) so I thought of creating this list and publishing it.|
|WIN32||Indicates that the operating environment is the Win32 API.|
|CONSOLE||Indicates that an application is being compiled as a console application.|
|LINUX||Indicates that the operating environment is Linux.|
|CPU386||Indicates that the CPU is an Intel 386 or better.|
|MSWINDOWS||Indicates that the operating environment is Windows. Use MSWINDOWS to test for any flavor of the Windows platform instead of WIN32.|
|CLR||Indicates the code will be compiled for the .NET platform.|
Thinking of using constants in Delphi? Consider class properties! February 27, 2007
What I want to discuss is an alternative to constant. There are called “class properties”. In C world, these would be called static properties. Yes, you guess right. These are properties which relate to a “class” rather than an “object” (instance of the class). With Delphi.NET, we now have:
- Class Fields
- Class Methods (Both procedures and functions)
- Class Properties
Class fields and class properties and not available in Delphi for Win32 (well, programmers take “never say die” approach).
So class properties allows us to write something like:
number := TPredefinedNumbers.DefaultNumber;
//do something with number
Here, “DefaultNumber” is a class property of TPredefinedNumbers class and we can access DefaultNumber using class name and without actually creating an instance of it. .NET framework makes extensive use of class properties. Refer SystemColors, Brushes etc.
Why class properties qualifies as an (perhaps better) alternative for constants? The reason is, you never know what crazy requirement will be raised by your sales or marketing person which calls for user control on that constant. Perhaps you would think that using the INI file for that constant value would be better so that you can control it. Perhaps day after tomorrow it will qualify to sit in a database field. Who knows?
So class properties provide a great abstraction. When you want to change the location where that constant value resides, all you need to change the get method of class property. And everything works fine..
TPredefinedNumbers = class
class function GetDefaultNumber: Integer;
class property DefaultNumber: Integer read GetDefaultNumber;
class function TPredefinedNumbers.GetDefaultNumber: Integer;
//You can return a hard coded value
Result := 0;
//or you can get from INI file or database or whatever and return
Using the HashTable in Delphi for hybrid collections February 16, 2007
While working on one of my project I came across a problem of maintaining a collection of item who were of different types. As I was using Delphi.NET, I was able to use HashTable class (in System.Collections namespace) for this purpose.
Here is code snippet:
hybridCollection := Hashtable.Create;
stringValue := ‘A String…’;
dateTimeValue := System.DateTime.Now;
integerValue := 1000;
//stuff different type of values in the collection
hybridCollection.Add (1, stringValue); //Add a string
hybridCollection.Add (2, dateTimeValue); //Add a datetime
hybridCollection.Add (3, integerValue); //Add an integer
//Get the values back
stringValue := hybridCollection as System.&String;
dateTimeValue := hybridCollection as DateTime;
integerValue := hybridCollection as Integer;
Above code snippet produces following output:
16-Feb-07 12:15:05 PM
Making Delphi applications Vista friendly February 6, 2007
Here is an article I came across while surfing which mentions some basic steps needs to be performed to make Delphi application Vista friendly.
Feeling like have to buy a restaurant to have dinner? January 12, 2007
One time or another you might have felt this if you using Delphi 2006 (or Borland Developer Studio as they call it). I came across this Delphi 10 Lite while browsing yesterday and a guy (don’t know who he/she is) has done a great job ripping BDS 2006 and making a light weigth developer environment. Loads in couple of seconds and is lightening fast.
I don’t know whether it is completely legal or not and I don’t care either. Borland should learn from Delphi Configuration Manager and BDS 2006 start up managers. Why they couldn’t add the functionality of various personalities in Delphi 2005 which they had to add later on in Delphi 2006 inspired by the success of Delphi 2005 configuration manager.
Run a google search on “Delphi 10 Lite” and I am sure you will find some download links.