﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <description><![CDATA[Comments for Delphi Techniques: A Simple Alternative to TStringList ]]></description>
    <title><![CDATA[Comments for Delphi Techniques: A Simple Alternative to TStringList ]]></title>
    <link>http://dn.codegear.com/article/33423</link>
    <!-- source: http://dn.codegear.com/article/33423/feed-->
    <dc:date>2008-12-01T19:28:29-08:00</dc:date>
    <item>
      <description><![CDATA[&gt; This is going to promote the worst, sloppiest type of code with new &gt; programmers who see the records and won't be able to differentiate &gt; them from objects. When they get the objects create, they will &gt; randomly forget to free them. No, this is an interesting historical &gt; oddity that should just be tossed.Records have automatic finalization, so the dynamic array of TStringListRecord will be freed when the record disappears. That is not the problem. Of course, other resources, i.e. non-automatic types, will not be freed or released.Actually, giving methods to records is the same as having global procedures accepting old-style records as (var) parameters. It just gives you a cleaner syntax, better scoping and the possibility to use operators, so people can easily write performant matrix or complex records, or e.g. a HugeInt type that has value type semantics (which is very convenient for any kind of numerical or mathematical type).Operators would not work on classes, since intermediate results would not be automatically freed, and since they would be anonymous (not bound to a variable), the user wouldn't be able to free them either, in Win32. ]]></description>
      <title><![CDATA[re: Delphi Techniques: A Simple Alternative to TStringList - by Ed Vander Hoek]]></title>
      <managingEditor>
	 (Rudy Velthuis)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=38944</guid>
      <dc:date>2006-02-26T05:22:57-08:00</dc:date>
      <pubDate>2006-02-26T05:22:57-08:00</pubDate>
      <source url="http://dn.codegear.com/article/33423/feed">Comments for Delphi Techniques: A Simple Alternative to TStringList </source>
    </item>
    <item>
      <description><![CDATA[I would still advocate the way TStringList grows, instead of  SetLength(FItems, Count + 1);On very long string lists, this can make a considerable difference.]]></description>
      <title><![CDATA[Delphi Techniques: A Simple Alternative to TStringList - by Ed Vander Hoek]]></title>
      <managingEditor>
	 (Rudy Velthuis)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=38943</guid>
      <dc:date>2006-02-26T05:12:59-08:00</dc:date>
      <pubDate>2006-02-26T05:12:59-08:00</pubDate>
      <source url="http://dn.codegear.com/article/33423/feed">Comments for Delphi Techniques: A Simple Alternative to TStringList </source>
    </item>
    <item>
      <description><![CDATA[Ed said,&gt; private and public are the only visibility categories allowed.Actually, Ed, there another one allowed -- didn't you try them all?  You can also use "strict private", and it does what you would expect (prevents the symbol from being used outside of methods of the record).-Jay]]></description>
      <title><![CDATA[re: Delphi Techniques: A Simple Alternative to TStringList ]]></title>
      <managingEditor>
	 (Jay Huber)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=38938</guid>
      <dc:date>2006-02-23T06:40:40-08:00</dc:date>
      <pubDate>2006-02-23T06:40:40-08:00</pubDate>
      <source url="http://dn.codegear.com/article/33423/feed">Comments for Delphi Techniques: A Simple Alternative to TStringList </source>
    </item>
    <item>
      <description><![CDATA[&gt; this is an interesting historical oddity that should just be tossed.So, you don't use TPoint or TSearchRec or TGUID or TRect?  Records are a fine data structure.  As for why Borland has been enhancing them lately, it is driven by .NET, where other languages offer value types (records) with methods and operator overloading.  This allows Delphi to be a first-class .NET language, and that's nice.&gt; can you imagine the harm this is going to cause to the stack?This isn't very likely, as most records would either be small (TPoint, TRect), or would have indirect references to other data (strings, dynamic arrays, objects, interfaces).  For example, the TStringListRec presented in the original article was just 4 bytes -- the same size as a TStringList variable.I suppose you are right that there will be some people who won't understand records.  However, please keep in mind that the Delphi programming languag is intended for, well, programmers.  If someone can't understand records, they probably shouldn't be programming.  My grandmother probably won't understand virtual methods, but does that mean they should be removed from the language?  Of course not!  Besides, you can't go very far in .NET without understanding value vs. reference types.-Jay]]></description>
      <title><![CDATA[re: Delphi Techniques: A Simple Alternative to TStringList]]></title>
      <managingEditor>
	 (Jay Huber)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=38937</guid>
      <dc:date>2006-02-23T06:35:20-08:00</dc:date>
      <pubDate>2006-02-23T06:35:20-08:00</pubDate>
      <source url="http://dn.codegear.com/article/33423/feed">Comments for Delphi Techniques: A Simple Alternative to TStringList </source>
    </item>
    <item>
      <description><![CDATA[This basically goes back to how objects worked in TP 5.5.  Then, all objects were just fancy records.  To allocate them on the heap, you had to create a pointer reference and new it up and dispose it later.Frankly, there is a reason they dumped it in favour of always making it reference based on the heap, and I am suprised to see that they brought it back.This is going to promote the worst, sloppiest type of code with new programmers who see the records and won't be able to differentiate them from objects.  When they get the objects create, they will randomly forget to free them.  No, this is an interesting historical oddity that should just be tossed.Besides, can you imagine the harm this is going to cause to the stack?  Yikes. First time they hit recursion and get an 800mb stack they'll wonder why.]]></description>
      <title><![CDATA[Delphi Techniques: A Simple Alternative to TStringList - by Ed Vander Hoek]]></title>
      <managingEditor>
	 (C Johnson)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=38930</guid>
      <dc:date>2006-02-17T15:39:45-08:00</dc:date>
      <pubDate>2006-02-17T15:39:45-08:00</pubDate>
      <source url="http://dn.codegear.com/article/33423/feed">Comments for Delphi Techniques: A Simple Alternative to TStringList </source>
    </item>
    <item>
      <description><![CDATA[As a C++Builder user, this article was eyeopening...I know the TStringList example is a little contrived, but in C++, you can just use an 'auto_ptr' template with pretty much every VCL class to get exactly the same effect of exception-safe behaviour. New classes requiring writing: Zero. Compatibility with original VCL classes: 100%.{  auto_ptr&lt;TStringList&gt; list = new TStringList;// do stuff with list...//...//  list freed automagically on going out of scope.} - Roddy]]></description>
      <title><![CDATA[Delphi Techniques: A Simple Alternative to TStringList - by Ed Vander Hoek]]></title>
      <managingEditor>
	 (Roddy Pratt)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=38924</guid>
      <dc:date>2006-02-15T02:01:06-08:00</dc:date>
      <pubDate>2006-02-15T02:01:06-08:00</pubDate>
      <source url="http://dn.codegear.com/article/33423/feed">Comments for Delphi Techniques: A Simple Alternative to TStringList </source>
    </item>
    <generator>Atom 1.0 XSLT Transform v1 (http://atom.geekhood.net)</generator>
  </channel>
</rss>