[fpc-devel] Unicodestring branch, please test and help fixing
Michael Van Canneyt
michael at freepascal.org
Tue Sep 9 16:42:05 CEST 2008
On Tue, 9 Sep 2008, Anton Kavalenka wrote:
>
> > Nothing stops you from doing this yourself.
> >
> > But for something as basic as text operations, I think this is bloat.
> >
> > Imagine that you would have to do
> > I:=TInteger.Create(1);
> > J:=TInteger.Create(2);
> > I.Add(J);
> > What kind of language do you end up with then ? Utterly unreadable, and
> > slow, because heavily relying on the heap.
> >
> > Michael.
> > _______________________________________________
> > fpc-devel maillist - fpc-devel at lists.freepascal.org
> > http://lists.freepascal.org/mailman/listinfo/fpc-devel
> >
> >
> Bad example
> Numbers are scalars
> Strings are vectors
> += operator in not so straightforward as for numbers.
bad example for you, but not for me: Handling strings should be as
easy as handling integers.
>
> Who else except Pascal developers knows that s:=s1+s2 is the string
> concatenation and invokes lot of hidden stuff that is out of control.
This is the beauty of pascal: you don't need to know, and there should
be no need.
I once asked a C++ programmer how to read a file full of strings.
After 2 hourse he came to tell me he didn't know.
In Pascal, it takes about 1 minute to code, because strings are a
basic type, handled on the stack. And rightly so.
Michael.
More information about the fpc-devel
mailing list