What are major incentives to upgrade to D2009 (Unicode excluded)?

前端 未结 10 1717
一个人的身影
一个人的身影 2020-12-03 05:48

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 supp

10条回答
  •  北荒
    北荒 (楼主)
    2020-12-03 06:42

    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, 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.

提交回复
热议问题