Archive for the ‘Delphi XE’ Category
Posted by jpluimers on 2014/02/18
About a year ago, I wrote about Delphi: you should avoid the with statement as it makes your code less future proof. Then I already tweeted I would follow up. Time to do it now (:
Besides my first post, these links inspired me most:
Posts about the with statement usually cause a stir: people either like or dislike it with passion.
Starting with some history and examples, this posts lists a few DOs and DON’Ts when using the with statement, shows advantages and drawbacks, and shows you tools to eliminate with statements. Read the rest of this entry »
Posted in Borland Pascal, Delphi, Delphi 1, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Pascal, Software Development, Turbo Pascal, With statement | 9 Comments »
Posted by jpluimers on 2014/02/13
Summary: Always try to avoid sharing .DCU files between projects.
I see a lot of projects at clients that do not have their individual DCU directories set (therefore having the DCU files in the same directory as the PAS files causing shared units to share the DCU files), or share DCU files among different projects.
Both are a very bad idea, as the compiler does not always understand when the DCU file does not match the combination of PAS file and compiler options.
The result is the occasional use of the DCU file in stead of the PAS file causing wrong code to be used, or wrong debugger information to be included.
Danny Thorpe phrased it on Stack Overflow: Read the rest of this entry »
Posted in Borland Pascal, Delphi, Delphi 1, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, FreePascal, Lazarus, Pascal, Turbo Pascal | 9 Comments »
Posted by jpluimers on 2014/02/12
Do not forget to register for the RAD-in-Action Webinar Unit Testing in Delphi featuring Nick Hodges.
If you cannot watch it live: register anyway, as that will give you the URL for the replay download.
Very interesting stuff (I attended his sessions during the German EKON Conference) and a very entertaining speaker.
He is going to cover a lot in this seminar, and it is a great addition to the material in his Coding in Delphi book (Warren Postma wrote a nice review). You get the electronic edition of the book free when you have Delphi XE5, a hard-copy should be available soon. Read the rest of this entry »
Posted in Delphi, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | Tagged: Delphi, nick hodges, Warren Postma | 1 Comment »
Posted by jpluimers on 2014/01/29
In the series “interesting stuff you can do with Implicit operators”: delphi – With a class operator is an implicit typecast to itself allowed? – Stack Overflow.
Be careful though, as Implicit assignment will allow more code paths to the compiler than you expect at first sight (:
–jeroen
Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2014/01/10
Ever since around Delphi 2007, it started to use temporary .VRC files to re-build the project .RES file.
It confuses people, and with reason as the only public information about it on the dockwiki seems to be in the Version Info page (though there is more on the other embarcadero sites).
The reason is that parts of the .RES file are no more leading in the process of getting them from your project options to the final binary (EXE/DLL/BPL/…) of your project.
Delphi XE3 for instance can have these resource structures in the .VRC file:
Except for type 24, Delphi XE2 seems to have the same kinds of resource types.
All in all, most if not all of the .RES files are being auto-generated for at least a couple of years now so there is less and less need to put it under version control.
The problem is that if for one reason or the other, your project .RES file becomes readonly, and you get errors like mentioned in Why does a projects res file need to ….
[BRCC32 Error] xxx.vrc(1): error creating xxx.res
.RES in VCS or not?
Read the rest of this entry »
Posted in Conference Topics, Conferences, Delphi, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Event, QC, Resource Files and Scripts (.res/.rc), Software Development | Leave a Comment »
Posted by jpluimers on 2013/12/22
Cool stuff: DelphiSpec library, inspired by Cucumber. It runs on top of DUnit.
via DelphiSpec Library Announce « Роман.Янковский.me.
A similar one in the .NET realm: SpecFlow – Pragmatic BDD for .NET.
–jeroen
Posted in .NET, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 3.0, C# 4.0, C# 5.0, Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2013/12/19
Almost a year ago, a thread on “premature Delphi optimization” came by on G+ about this code:
procedure ExchangeInteger(var AValue1, AValue2: Integer);
begin
AValue1 := AValue1 xor AValue2;
AValue2 := AValue1 xor AValue2;
AValue1 := AValue1 xor AValue2;
end;
I don’t think that was premature optimization, just some code from an old fart that had already been programming in the era where processors had reasons to use it:
Back then, the only efficient way to exchange two variables of the same data type was using the XOR swap algorithm.
Nowadays you have more options, and this is where the fun in that thread began, which I will show in a minute.
First a bit of history
The XOR swap algorithm was widely known in the 80s of last century and before, especially because the 6502 processor (oh the days of LISA Assembler) was vastly popular, as was the Z80. Together, they powered the majority of the home computers in the 70s and 80s.
Read the rest of this entry »
Posted in Borland Pascal, Delphi, Delphi 1, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Development, History, Pascal, Software Development, Turbo Pascal, UCSD Pascal | 7 Comments »
Posted by jpluimers on 2013/12/12
StackOverflow user David Heffernan – Stack Overflow has an interesting take on Delphi postbuild events:
At the moment my actiona read:
if exist PostBuild.bat call PostBuild.bat $(Platform) $(Config) $(OutputDir)
And then the PostBuild.bat script calls a Python script so that I can write my scripts in a real language.
I actually impose the build actions in a shared option set that I reference from all of my projects. That way I enforce consistency and predictability.
I know others use tools like FinalBuilder but building is so important that I feel it’s worth my effort in rolling my own tooling.
– David Heffernan Feb 14 at 20:24
–jeroen
via: Delphi XE3: Problems with complex pre-build events – Stack Overflow.
Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2013/11/26
Another instalment in the WordPress Missed Schedule series (:
Each version, Delphi gets more features, and grows bigger.
Especially in testing environments (where you want to have a cut-down base machine you can clone from), it is wise to cut down on the installation size.
A few directories you might want to consider compressing for your Delphi installation:
C:\Users\All Users\{*}
The directories with GUID names contain the installer cache. You can ditch the whole installer cache if you keep ISO images of all installations. I prefer just to compress these directories.
Compressing usually saves 50% of the storage there, which can count for 5+ gigabyte of savings for the newest Delphi version.
C:\Users\Public\Documents\RAD Studio
Contains (among others) the help files and SVN examples, and (for the most recent version) the Platforms SDKs.
Saving is usually a couple of 100 megabytes for less recent Delphi versions until about 1 gigabyte for the most recent.
C:\Program Files (x86)\Embarcadero\RAD Studio\#.0\lib
This contains all the precompiled files. Since they are readonly in nature, it pays of compressing them, usually saving 50% or more.
Saves 5+ gigabytes for the most recent Delphi version.
–jeroen
Posted in Delphi, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Missed Schedule, SocialMedia, Software Development, WordPress | Leave a Comment »