Any idea, thoughts?
fcl-stl is not exactly the best implementation -its interface is! -. It tries to mimic a C++ style standard template library..
FPC/Lazarus has at least two standard libraries that are - implementation wise - much better:
- fgl
- rtl-generics.
Furthermore these are - but this is my opinion - much easier to use.
People coming from other languages often make the mistake to go for
FCL-stl instead of
RTL-generics (or for 3.0.4 and before:
fgl.) because it contains a magic word: stl. But it should not contain that magic word.
That said: with some effort it could achieve what it advertises.
1. I think OO implementation of standard double-linked list is more readable, extendable and customizable.
A TList or a TList<T> are underneath linked lists, just like in C.
2. There must be other reasons (memory, performance,...)
No. The only reasons are OOP in the first place: A linked list isn't. It's a list of pointers, a.k.a. memory locations.
IOW very low-level. OOP is about high-level abstractions.
3. Using records in classes in wrong place and way breaks OO spirit and design.
You do not understand the
encapsulation part of object orientation.
Structures or variables in general can be tightly coupled to a class they belong to.
That's an asset. Not a hindrance.