可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I'm a hesitant upgrader when it comes to development tools. For roughly half of my product I still use D7, and for others D2006.
The truth is, although Unicode support is more than welcomed and very useful, it could cause me more troubles than gains with my current projects (they are more-or-less Unicode ready already). It's especially case with one of them who's performance would suffer a lot if each string takes twice as much memory as before.
So, Unicode aside, what are other major incentives to upgrade?
回答1:
To put things in to perspective, look at the things that were added between Delphi 7 and Delphi 2007. This was a significant high water mark.
http://blogs.codegear.com/nickhodges/2007/03/28/33579
http://www.stevetrefethen.com/blog/VCLAndRTLEnhancementsSinceDelphi7D7.aspx
Delphi 2009 sets the bar even higher.
http://blogs.codegear.com/pawelglowacki/2008/11/03/38527
http://blogs.codegear.com/chrispattinson/2008/09/19/38897
Here are some of my favourites:
Generics (naturally) and generic collections in the RTL.
Improved build configurations where they inherit from a common base configuration.
DataSnap improvements, including removing COM dependencies.
Faster and more stable IDE over Delphi 2007, which was no slouch.
I'm not sure how I'm going to use them in production, but you have to admit that anonymous methods are really cool. I'm curious to see how people wind up using them with threading.
Just two things about Unicode support (another favourite of mine).
You will probably see a significant performance improvement when you convert your existing Unicode projects. I know I did.
You will need to be careful about converting any code that makes assumptions about character size. You probably won't see many problems if your existing code is Unicode aware.
http://dn.codegear.com/article/38437
http://dn.codegear.com/article/38498
http://dn.codegear.com/article/38693
回答2:
First of all I don't think you're going to notice that much of a performance hit.
Have a look at this
I'd say just generics make it worth the upgrade. Followed by Anonymous methods.
回答3:
I recently upgraded from Delphi 4 to Delphi 2009, primarily because of Unicode, but also because of the many improvements everywhere in Delphi since my Version.
But the unexpected improvement that pleased me the most when I upgraded was the new IDE (Integrated Development Environment). Delphi 7 and previous versions had an undocked layout that drove me crazy. Now it is one docked form that can be resized and moved around easily. Not to mention many improvements to it that make every programming task easier. Remember, you spend all your programming time in front of the IDE, so every little thing made easier is a time saver.
When debugging and stepping through the code, all local variables are watched by default. That is extremely helpful.
The FastMM Memory Manager is built in.
And I now have both Delphi 4 and Delphi 2009 installed, and I can run either one, or even both at the same time. That was extremely useful when converting my programs, because I could debug and step through both together to ensure the converted program was working right.
Also, Embarcadero still gives a special upgrade price that Borland and then Code Gear did for all previous version owners. They didn't have to, but that is a great move on their part to treat the early adopters of Delphi as their VIPs.
What don't I like? Well, Delphi 4 started up in 2 seconds. Delphi 2009 takes about 15. But it's fast after that. Also stepping through code goes into the CPU code much more often because it is often inlined, and I don't think there's any way around that.
If you need Unicode, don't think twice about upgrading.
If you don't need Unicode, there are still enough improvements from Delphi 7 and earlier to make it worthwhile to finally jump.
回答4:
As steve said, the major language additions are a big plus. But there is an other thing.
Delphi had been in stormy weather the last years. And that was reflected by the versions. 7 was the last good version, 2006 was reasonable, but still below average. But now with 2009 a new era has started. Delphi has found a new home. And the focus is back on being the best development tool there is. There is still some backlog that needs to be solved, but as far as I am concerned Delphi is back on the way up.
回答5:
Delphi 2009 has proven to be much more stable than Delphi 2007, that alone for me would be enough to upgrade, delphi 2007 bugs and crashes are very annoying and stressful.
回答6:
2 things. The stability is much better than 2006 and 2007. (Not to mention it installs faster, runs faster, and isn't full of nasty memory leaks that eat up hundreds of megs of RAM.) That alone is worth ditching either of the last two versions for. But as for the language improvements, there's a lot to talk about, and it's been talked about plenty, but for me the crown jewel is the generic support, and especially the new built-in Generics.Collections unit. Finally, no more of this ugly idiom that we're all familiar with:
for i := 0 to myObjectList.Count - 1 do
begin
currentObject := myObjectList[i] as TMyObjectType;
currentObject.WhateverYoureDoingWithIt;
...
end;
Instead, if you declare MyObjectList as a generic-based TObjectList<TMyObjectType>
, it takes care of type conversions for you, and it throws in a free enumerator (AKA iterator) as part of the package. Your loop now looks like this:
for currentObject in myObjectList do
begin
currentObject.WhateverYoureDoingWithIt;
...
end;
Unicode and anonymous methods are nice, and Unicode especially may be essential for some people, but personally my favorite improvement is the end of ugly list access.
回答7:
Nick Hodges posted:
Top Ten Reasons to Upgrade From Delphi 7
They include:
- Live Templates
- History Tab
- Dockable/Customizable IDE
- VCL Designer Guidelines
- New Tool Palette
- Refactoring
- Generics
- Anonymous Methods (Closures)
- Unicode Support
- Ribbon Controls
In his Conclusion he said:
"the hardest part about writing this article was limiting it to only ten"
and then he lists 24 other things (not counting Intellimouse twice).
回答8:
I just gave the Generic Collections and the enhanced For-loop a spin (don't mind the visual ugliness of the code (e.g. if-then-else on one line)):
program genericTList;
{$APPTYPE CONSOLE}
uses
SysUtils,
Generics.Collections;
var
myList : TList<string>;
s: string;
begin
myList := TList<string>.create;
try
myList.Add('Peter');
writeln('Inviting Peter');
myList.Add('Barbie');
writeln('Inviting Barbie');
if myList.Contains('Bob') then writeln('Bob has managed to sneak in...') else writeln('Bob is not invited!');
writeln('List of invited people:');
for s in myList do writeln(s); //feels sooo goood X-)
readln;
finally
FreeAndNil(myList);
end;
end.
After three years of staying away from Delphi, which seemed dying back then, I think I might return to this lovely world.
My greatest Delphi project seems to suffer from not being Unicode-ready, but Unicode is great stuff too, so I'll just have to fix the code in few places. Yesterday I also managed to get it to build and execute without errors (seems there was some sort of D2007->D2009 transition trickery involved) and I noticed that D2009 is just EXCELLENTLY FAST! It's better than the older versions in (almost*) every aspect.
*I have not found regressions YET.
回答9:
The by far most important incentive to me was the overall speed of the IDE in comparison with Delphi 2006 and the same project.
回答10:
Refactoring - extracting methods, moving classes around, extracting interfaces, operations which can improve code and design quality, are a very nice feature in newer versions of the IDE.