You are not logged in.
Pages: 1
I'm now working with Delphi 2007 on a very interesting framework named XMLRAD. Delphi 2007 compiles fine, but... but... I'm still using Delphi 7 for the OpenSource libraries available on this site.
Why use Delphi 7?
- if your source code compiles on Delphi 7, and you make careful usage of Unicode/AnsiString, it will work as well with Delphi 2010;
- if your source code compiles on Delphi 7, it will work as well with Free Pascal, so cross-platform and 64 bits are open to you;
- Delphi 7 runs well on my Windows Seven 64 bits system, if you are interested, I can explain you how;
- Delphi 7 starts faster than Delphi 2007, and MUCH faster than Delphi 2009/2010;
- generated code is almost the same since Delphi 7 - when I need speed, I use better algorithms, and assembler if it's worth it;
- I'm still using CrossKylix and Delphi 7 is the exact same compiler version;
- Delphi 7 IDE is as powerful as Delphi 2010 IDE, if you use some IDE enhancements like http://www.cnpack.org;
- Delphi 7 help is still the reference - why waiting for 20 seconds on my Core i7 processor waiting for the awful MS help system to launch?
- I use the assembler/CPU view a lot: all Delphi IDE have the Alt-F2, but you can close this window by the escape key on Delphi 7 - I was not able to find such a keyboard shortcut under Delphi 2007/2010, and it's very annoyning;
- Delphi 7 executable size are small, and even smaller with our LVCL libraries (30 KB for a form with buttons);
- I didn't have the need for generics and such up to now - and I like knowing which code is generated;
- Delphi 7 is Unicode ready, whatever you say - the VCL is not, but CharSets are not evil, and work well;
- and so on, and so on...
Online
In newer Delphi I like this:
- Exit (10) instead Result := 10; Exit;
- For..in
- inline directive
- very good is extended Record (e.g method on Record) - see TStopWatch implementation
- FastMM (I known - can be used for old delphi too)
- TObject.ToString, TObject.Equals, TObject.GetHashCode
In IDE I like component palette from Delphi 2010. For me with combination with CnPack is unbeatable.
This are also interesting features:
- System.TMonitor
- Class Helpers
- Stack breakpoints (for debugging)
- strict private and strict protected
- sometimes class property and class var
But I agree with you - I hate new Help, in Delphi 7 was better help (a fast).
Last edited by radek.cervinka (2010-07-02 12:15:52)
Offline
You mentioned that coding in Delphi 7 manner helps to migrate to Free Pascal and so forth. However, Delphi 7 doesn't provide TDictionary/HashMap/HashTable, which is convenient sometimes.
Could you help to comment on this issue?
Offline
Similar features are available in the IniFiles unit, as far as I remember.
You have THashedStringList and TStringHash classes since Delphi 1.
In our enhanced RTL, I've rewritten the TStringHash.HashOf function, in faster optimized asm:
function TStringHash.HashOf(const Key: string): Cardinal;
{$ifdef PUREPASCAl}
var I: Integer;
begin
Result := 0;
for I := 1 to length(Key) do
Result := ((Result shl 2) or (Result shr (SizeOf(Result) * 8 - 2))) xor
Ord(Key[i]);
end;
{$else}
asm // faster hash implementation by AB (exact same hash algorithm as above)
xor eax,eax // eax = Result
or edx,edx
push ebx
jz @z
xor ecx,ecx // ecx = Result shl 2 = 0
mov ebx,[edx-4] // ebx = length(Key)
@1: shr eax,$1e // eax = Result shr (SizeOf(Result) * 8 - 2))
or ecx,eax // ecx = ((Result shl 2) or (Result shr (SizeOf(Result) * 8 - 2)))
movzx eax,byte ptr [edx] // eax = ord(Key[i])
inc edx
xor eax,ecx // eax = () xor ord(Key[i])
dec ebx
lea ecx,[eax*4] // ecx = Result shl 2
jnz @1
@z: pop ebx
end;
{$endif}
But I liked to code these hashing/maping myself, optimized for every purpose, when I need them.
I even made a new hashing algorithm, named Hash32, which I found out to be faster than the one used in TStringHash.HashOf and even crc32 or adler32.
It's not a compiler/IDE restriction. It's just some diverse units and implementation.
It's always up to the coder to use either the standard units of the compiler used, or have a set of common functions (like our SynCommons.pas unit) which are optimized for speed, and cross-platform.
Online
Thank you very much for your comments!
I had tried the "THashedStringList" together with a separate TObject list/array to mimic a Dictionary/HashMap/HashTable before, but I didn't know the "best practice" to do it in Delphi 7. Besides, there have been discussions and THashedStringList was said to be low efficient generally (i.e., a simple linear search for bucket collisions is used internally, which is a bad choice in general and an especially bad choice for a fixed small bucket count. See https://forums.embarcadero.com/message. … geID=86963). In that post, DIContainers has been recommended, but it doesn't provide Kylix compatibility.
Regarding IniFiles.TStringHash, because the key is string type and the value is integer type, I would think its usage is the same as THashedStringList. Could you help to comment whether it has the same problem of bucket collision search as THashedStringList?
Last edited by ComingNine (2010-08-03 22:54:33)
Offline
Indeed, the hashing implemented in IniFiles is far from perfect.
I didn't knew this discussion, but the main info of this forum thread, that is the hashing is limited to 256 items so collisions happens often, is true for THashedStringList, but wrong for TStringHash.
If you check the VCL source, you've got:
TStringHash = class
(..)
constructor Create(Size: Cardinal = 256);
So the default hash size is 256 - which is used by THashedStringList - and this is bad.
But TStringHash is able to handle another size of its hash list. So it's not limited to 256.
I've even updated the initial Create method so that it will use always a power of two as hashing size, then use a very fast and (i.e. a binary mod per a power of 2) instead of a lower mod (which is a div).
constructor TStringHash.Create(Size: Cardinal);
const
MINHASHBITS = 5;
MAXHASHBITS = 16;
var i,j: cardinal;
begin
inherited Create;
// faster version by AB: round Size to a power of two
if Size>1 shl MAXHASHBITS then begin
Size := 1 shl MAXHASHBITS;
BucketsAnd := (1 shl MAXHASHBITS)-1;
end else begin
j := 1 shl MINHASHBITS;
for i := MINHASHBITS to MAXHASHBITS do
if Size<=j then begin
Size := j;
BucketsAnd := j-1;
break;
end else
j := j*2;
end;
SetLength(Buckets, Size);
end;
The other comment of the forum - i.e. that it's ok if you populate the list at once, then make some lookup - is true about THashedStringList, but TStringHash doesn't have this limitation.
So you can use TStringHash directly in your classes, in order to fast retrieve an integer value from a string key, and it works well enough for most cases.
Take a look at our Big Table small component, and you'll find in its source code some good ideas about fast string retrieval, without any hashing, just by using good old binary search, and self-sorting data (i.e. adding the new string at its exact sorted position in the list). It's simple and very efficient in practice, even with numerous items. And you don't suffer hashing collision, and maintaining a hash index parallel to the main data.
I don't know why such an algorithm is not used much. Hashing is not everything: binary search is fast also. Binary search is a logarithmic algorithm and executes in O(logN) time. In some cases, it's easier than hashing.
Like always, the algorithm to be used depends on your data, and how you store it, and what you need from it... there is no "perfect search" algorithm. And there is only one truth: profile your application with real data, in the worse case, and in the mean case. Don't believe those how say: "I've the fastest hashing/searching class ever".
Online
- Delphi 7 starts faster than Delphi 2007, and MUCH faster than Delphi 2009/2010;
Delphi 2009/2010 start faster than Delphi 2007, I don't know why in your case Delphi 7 is MUCH faster than D 2009/2010 and just faster than D 2007
- Delphi 7 IDE is as powerful as Delphi 2010 IDE, if you use some IDE enhancements like http://www.cnpack.org;
To be honest, that's not true, cnPack has a lot of nice enhancements, but it will not make delphi 7 as Delphi D2010 for example:
1. Refactoring.
2. Search in components.
3. SynEdit.
4. IDE Insight.
5. New search-bar.
6. VCL Guidelines.
7. Histroy Tab (it's very useful if you don't use VCS).
8. Code Formatter.
and a lot of other small enhancements, which make development is more productive than before .
and if you combine the above features in IDE with other improvement in compilers (inlining, Generics, Anonymous methods, Attributes), that's make a big difference than old version, specially attributes that may make your work with Sqlite framework easier and better ;-).
Except if you need to have compatibility with Free Pascal and Kylix, or you mostly work with low level programming.
Delphi 2010 is much lighter and faster than previous versions D2005-D2007
Offline
Delphi 2009/2010 start faster than Delphi 2007, I don't know why in your case Delphi 7 is MUCH faster than D 2009/2010 and just faster than D 2007
Perhaps because I use Delphi Speed Up for Delphi 7. And it also depends on how many components are installed in your IDE.
1. Refactoring - there is some basic Refactoring in cnpack, and you can also take a look at OPEdit2 - http://www.codefactor2.com
2. Search in components - if that is typing on the keyboard do get a component on the palette, there is one
3. SynEdit - ????
4. IDE Insight - you've got the same feature with either cnpack either DevExtensions
5. New search-bar - old was good for me, but there is some additional search features in cnpack
6. VCL Guidelines - cnpack has it, in a more powerful and customizable manner
7. Histroy Tab (it's very useful if you don't use VCS) - I use SynProject for that, which is perfect
8. Code Formatter - there is one in OPEdit2 - http://www.codefactor2.com
and a lot of other small enhancements, which make development is more productive than before
I'm still annoyed by the Alt-F2 problem of closing it: neither ESCape neither Ctrl-F4 work for me.
And what about the help? 10 seconds to open it under Delphi 2010 on my Core i7... and with problems finding the right information. Google and msdn are better and faster.
and if you combine the above features in IDE with other improvement in compilers (inlining, Generics, Anonymous methods, Attributes), that's make a big difference than old version, specially attributes that may make your work with Sqlite framework easier and better ;-).
Of course I miss this enhanced RTTI, but I guess the one existing in Delphi 7 was sufficient up to now.
Except if you need to have compatibility with Free Pascal and Kylix, or you mostly work with low level programming.
That is the case, and since it's an open source framework, I'm happy providing support also for older version of Delphi: not every one has enough money to buy a next version every time. And my last contract was with a Delphi-7 medical SW: in such area, SQA and RA look after unitary tests, regression stability and code quality, more than on using "new Delphi features". For them, Delphi, DotNet or Java make no difference. My marketing boss or support people don't care about generics. But they want the work to be done, and the SW to do its purpose with our Clients.
Delphi 2010 is much lighter and faster than previous versions D2005-D2007
I didn't see that: I've Delphi 7, Delphi 2007 and Delphi 2010 installed, and I noticed no difference (with Delphi SpeedUp on Delphi 7 and 2007) between Delphi 2007 and 2010.
Online
I like D2010 as well as the language and library improvements made since D7. It's fast enough for me. I never feel like I'm being slowed down by the IDE.
Thank you,
Ron Grove
Evanoah I/T Services
Offline
I like D2010 as well as the language and library improvements made since D7. It's fast enough for me. I never feel like I'm being slowed down by the IDE.
So you don't use the integrated help often?
D2010 is indeed a good IDE.
D2011/XE just looks great, but perhaps not worth the extra money from my point of view.
Language improvements since D7 makes sense to me.
But if you take a look at the FreePascalCompiler newsgroup these days, you'll find a lot of new interesting stuff, in both language and library.
And FPC already compiles 64 bit code, and can create Mac OS X executables...
What's still missing with FPC is the IDE. But I didn't take a look at Lazarus since years: I'll make a try these days.
How knows?
Online
I don't use too much help because I really only do straight forward line of business database applications. I rarely do anything I haven't done before. I'm certain anyone doing more complex programming probably has to use help a lot more than I do.
I only have Macs so I'm very familiar with FPC/Lazarus on the Mac. The apps look horrific. I compile with the QT layer when I play with it because it looks slightly better than the Carbon layer. QT also supports 64 bit where the Carbon libs are being deprecated and will remain 32 bit. In any case, they still look terrible and are pretty buggy. I'm looking forward to seeing how the Objective-Pascal effort turns out. A group on the MacPascal email group has been working on it for over a year and in my lurking it looks very promising. More promising to me for a Mac GUI application in Pascal than other options.
Thank you,
Ron Grove
Evanoah I/T Services
Offline
Programming with wxWidgets using C++ tools? Nope, you're potentially talking to the worst C++ developer ever... Simply deplore the language. I'd probably use QT if I had to use C++ anyhow. Tools are decent and there's tons of documentation and discussion about it online.
Or are you refering to the TwinForms product? I've was impressed when it was released, but the forum had little to no traffic last I looked and still doesn't say anything about D2010 on the purchase page (just checked). I suspect it just didn't sell well. No database components and I'm not sure about how you'd create your own. What about charts, etc? But If I recall the Mac samples in screencasts looked pretty natural for a Mac.
Thank you,
Ron Grove
Evanoah I/T Services
Offline
I meant wxforms for Delphi.
Database components are on the road.
There is also the lack of user-defined components, which is a need.
I agree with you. It looks like that it don't say well.
But this product is well designed, and works well.
Online
I agree with Ab.
Delphi XE is really slow and buggy. It will take some time until they will release Update 2, 3, 4 (and maybe 5) to fix all those bugs.
Offline
I am happy with Delphi XE personally (I work for Embarcadero by the way, but I still feel the same way about XE, and I don't work on the RAD XE team, I work on AppWave).
But I understand the people who stick with Delphi 7. Here is why I understand:
1. The project Options and IDE Options got much more complex after Delphi 7. Most people who were comfortable in Delphi 7 find the upgrade painful for that reason.
2. People liked the IDE user interface the way it was, and moving it around, when you already know your way around the IDE upset lots of people. You can make RAD XE work and look a lot like Delphi 7, at least for the main windows. But you can't roll back the project options (base, debug and release configurations).
Here are the reasons why I would feel sick to my stomach working in Delphi 7 now that I use XE all the time:
A. Stability. Delphi 7 crashed a lot for me. Maybe it was my particular set of experts and add-ons, but I never could get it stable.
B. Unicode. The internet is unicode. HTML and XML and SOAP and JSON all mostly uses utf8. I am sick of Ansi delphi and won't go back. Your XP or other recent Windows version using an NTFS filesystem is purely Unicode too. Like it or not. It's the year 2011.
C. IDE Insight (F6). Try it. You'll get addicted to it.
Warren
P.S. I would be surprised even if there was an Update 2 for XE. I think Update 1 fixes all that is going to be fixed before the next version of Delphi is released.
Last edited by wpostma (2011-07-22 19:12:03)
Offline
Pages: 1