[Lazarus] Strings

Michael Van Canneyt michael at freepascal.org
Tue Nov 17 20:11:52 CET 2009



On Tue, 17 Nov 2009, Marco van de Voort wrote:

> On Wed, Oct 28, 2009 at 10:16:48AM +0100, Mattias Gaertner wrote:
>>> all. Mapping this to different types dependend on compiler switches
>>> or whatever is a can of worms. I would prefer that one of the clear
>>> genuine string types is used directly. Lots of code is dependend on
>>> the string type.
>>
>> That's why you can set the mode for each unit or via a switch for
>> each package/project.
>
> That could as well be to not break old code, not to signify they both still
> have a place.
>
> And I think shortstring should generally be discouraged. The standard is
> always "255 is enough", but sooner or later somebody hits it:

No, it should not be discouraged.

I, for one, use shortstring extensively, and have never "hit this limit" 
in 12 years of working, because I know when to use and when not to use
a shortstring.

Shortstring has it's uses. It still works faster and uses less memory
when used correctly. It also causes less memory fragmentation then.

Michael.




More information about the Lazarus mailing list