Saturday, March 31, 2007

D4PHP a first impressions review

As a non PHP programmer, let's say a PHP rookie, I was excited that Delphi for PHP hit the doorstep this week. I always wanted to use/learn PHP but for several reasons that had not happen, until now. Delphi for PHP seems to be a very good start point for learning PHP as a Delphi programmer.

Installation gave, as expected, no problems. The installation is a little different to Delphi 2007 for Win32 which we now might consider the sister or brother of Delphi for PHP.

Using Delphi for PHP
After starting Delphi for PHP you will feel right at home because the IDE is almost similar to Delphi 2007. It is all there, the Code Explorer, the Object Inspector, the Project Manager and the Toolpalette. Also the welcome page is present.
The look and feel is the same, however the working of some elements are slightly different compared to Delphi 2007. (For example Code Insight and debugging 'feel' different)
Delphi for PHP comes with a lot of samples. The sample projects are located on a, not that, obvious location namely "C:\Program Files\CodeGear\Delphi for PHP\1.0\VCL\Samples". After some searching I found this link via the "Sample and Demos" link on the Welcome page.

The componentset, offered on the Tool Palette, is amazingly similar to the Delphi 2007 standard set. You will recognize lots of components, from Button and Edit, to Actionlist and PageControl. Also the Database control, like DataSource, Table and Query are available.
This really gives Delphi programmers a headstart!

My first PHP webapplication
OK, time to build my first PHP application.
Armed with my free PHP 5.0 power programming book I started some basic coding. PHP syntax is similar to C syntax, but that is another story. Using the VCL and its controls is a known experience:
Drop a Listbox, drop an Edit and a Button, double click the button and the ButtonClick event appears in the code just as in Delphi. The IDE is a little slow on drawing the controls on the design interface, but it is not disturbing me.
Debugging the code is easy although it does not show parameter values in a hint when placing your mouse on it. I suppose this will be improved in later versions.

Where is the HTML?
Using ASP.NET HTML is immediately generated on the design page. In Delphi for PHP you will not find any HTML (at least I did not find it yet, is it there?).
At first it is a bit strange and scary that there is no HTML (we are building a website, aren't we?) and gives you the feeling that D4PHP is mainly for pure application type websites instead of fancy HTML websites.
But D4PHP offers a template model for HTML files which can be used to "inject" your PHP components and code into HTML.
Big difference to ASP.NET, but I think I may like this. It seems to divide code and layout even more then ASP.NET. (First impression, have to investigate this much more)
Nice side effect here is that the IDE can't mess around with the HTML which happens a lot when you use ASP.NET IDE's like Delphi or Visual Studio.

There is a nice template demo in the sample projects which shows this technology.
A HTML page with D4PHP injected PHP looks like this:

{$lbMessage} is a label on your PHP page, just as {$RichEdit1} and {$btnSendContens}. On your page you code the button click, in this case the text of the RichEdit control is placed into the label lbMessage.

When the application runs the PHP controls are injected into the template and code runs just normal.

Looks pretty flexible to me.

Using databases
D4PHP offers a, almost endless, list of possible database connections. Two of them, MySQL and Interbase, are supported by the Data Explorer, and can be used to drag-and-drop database connections, tables and fields.
I tried to setup a connection to an Access database which I happen to use for my website, but I have not yet been able to get it to work.
HELP (F1)?
Press F1 and help is executed immediately. The Help however is a bit dissapointing. It is context sensitive and finds the right property, but gives information like this:

This is getConnected, a member of class Database

Well we knew that, didn't we? We would like to have information on how to use it!
A good alternative is the sourceforge help which seems to give more information.

Delphi for PHP is a real member of the Delphi family. The IDE and VCL will be very familiar to Delphi programmers. Coding in D4PHP is like coding in Delphi, quick, clean and easy.
Its alternate approach (I compare this to ASP.NET) is refreshing and the more I think about it the more I like it! Using Templates with PHP injection seems to be a very flexible and clean solution.
The help and documentation is not good and needs huge improvement.
Considering that it is a 1.0 product I think it is a great piece of work. It inspires me to dive into PHP 'the Delphi way'.

Wednesday, March 28, 2007

Wow! This is VCL

CodeGear released this week Delphi 4 PHP. Read the press release.
Today I found out that the documentation of the Open Source class library, which Delphi uses, VCL for PHP is available on SourceForge. You can find it here.

A quick scan shows that this is VCL as we know it!
Object, Persistent, Control they are all there!

Can not be to difficult to learn PHP this way, can it?
There is also a one day (One day?) trial available for download here.

Friday, March 23, 2007

Trouble viewing on Vista?

Recently I discovered that I could not view the website on my new (very fresh) Vista computer. It was not IE related because also in FireFox the website was not shown. After setting virusscanner, firewalls, parental control(?) on and off it still did not work. (Bummer :-$ )

Finally I asked in the delphi.non-tech newsgroup, and guess what? As always it was fortunately not just me, but a common encountered problem. :-)
Thanks to Roddy Pratt I finally found the solution, which also comes in play by registring Delphi 7 and Delphi 2006. You can find the solution on the Borland support site.

I don't know what the exact problem is but it looks like a TCP/IP problem between Vista and the CodeGear server. It is very strange that some Vista installs do not have this problem. More information on this issue through Google.

By the way, just found out about this new dutch Delphi for PHP forum (in dutch)

CodeRage session replays available

Did you miss a few sessions on CodeRage? I know I did.
Well that is no problem: The CodeRage session replays are now available on the CodeGear Developer Network.

Tuesday, March 20, 2007

My 5 favorites in Delphi 2007 for Win32

OK, so I have been blog-tagged by Pawel Glowacki to tell about my 5 favorites in Delphi for Win32.

To make my life easy I could list all the things that already have been listed by several bloggers, and beta bloggers. Here is a quick list of favorites I could come up with:

1. Delphi's speed
2. Delphi's stability
3. The improved Help system
4. The new DBX4 architecture
5. The new build system
6. The Vista readiness
7. The improved memory manager
8. The improved tool palette filtering
9. The enhanced welcome page
10. The new installer

But that would be too easy, wouldn't it? Yes it would, so I go for an alternate approach:

My 5 favorites in Delphi 2007 for Win32:

1. Confidence
Delphi 2007 is one of the many signs that things has changed (and are probably still changing) at Borland/CodeGear. These guys are really listening and working hard to give us the tools we need. This only makes an upgrade worthwhile. I agree 100% with this thread A vote of confidence (started by Estaban Pacheco)

2. Quality
And I not only mean the quality of Delphi itself, but it allows me to supply my customers with first class robust, fast and high quality applications. OK, Delphi has had some 'dark' versions, they were gone with BDS2006, but will be vanished with Delphi 2007!

3. The 'built in' ability to beat my competition

Delphi always gave me a great benefit compared to my competition. Never ever have I made an application as fast, and as good (see point 1) as in Delphi. In Delphi 2007 this has (again) increased!

4. Fun
Programming in Delphi is fun, sometimes it looks like no work at all. That's been for 15 years now and it still continues with Delphi 2007!

5. The bright future
VCL, VCL.NET (the bridge to .NET), Delphi for .NET 2.0 (planned for mid 2007), Delphi for PHP. Should I continue?

Well that's it! Now I tag the following persons:

1. Bob Swart (Dr. Bob)
2. Robin (Turbo for Noobs)
3. Nick Hageman (Where are the posts?)
4. Marco Breveglieri
5. Ace Breakpoint (Hope you still use Delphi Ace!)

Sunday, March 18, 2007

Delphi 2007 Win32 is released!

Last friday, 16 march 2007, Delphi 2007 for Win 32 was released. The lucky onces who could get ESD(Electronic Software Deliverance) are now able to download and play with it. I will have to wait a little longer until it drops on my doorstep. :(

Although I found BDS2006 very acceptable in terms of speed and reliability it seems that Delphi 2007 is 'the succesor to the max'. Very positive reports can be read around the Internet. You can find a very nice overview of all the Delphi 2007 blogentries on here. (Thanks to The Delphi Geek: Primoz Gabrijelcic)

Well and now we wait (a little longer).

By the way Brian Layman announced that the Delphi for PHP betabloggers are on their way!
Love to see more of that product.

Wednesday, March 07, 2007

Will there be another Delphi? VCL for Ruby?

Will there be a VCL for Ruby? A question Mike Pence asked himself a few days ago in this blogpost.

He says:
There has been nothing like Delphi since Delphi. For an all-too-brief, shining moment in the late 90’s, nothing could touch it. Its visual design tools made it simple to build attractive user interfaces.
What made Delphi even more remarkable was its component model in the form of the Visual Component Library.

The answer to his question is given by Michael Swindell in his feedback of the mentioned post. Now I don't know much about Ruby but when I read Mike's answer in this post I can feel the excitement!

He says:
So, wow. How awesome is that? Borland makes tools that fill the entire application lifecycle — not just IDE’s and frameworks –but it is their top-shelf development tools that have made them famous, and they are coming to play.

So Delphi is not a language anymore? No, apparently it is not, get used to it. Delphi is a way of living (Oh well at least developing ;-) ).

Saturday, March 03, 2007

CodeRage sessions on

CodeGear has a new website for it's virtual conference CodeRage ( which will take place from march 12 - 16.

Here are the most interesting links:
All the sessions
Virtual Exhibit Hall