[Lazarus] Masks: ConstructLegacy

Juha Manninen juha.manninen62 at gmail.com
Wed Oct 27 21:55:16 CEST 2021

On Wed, Oct 27, 2021 at 10:06 PM Bart via lazarus <
lazarus at lists.lazarus-ide.org> wrote:

> You totally lost me here.
> IMHO there is no need for CreateExtende or similar new constructor.

Why not?

THis is what we currently have.
> TMask:
> constructor Create(const aMask: String; aCaseSensitive: Boolean;
> aOpcodesAllowed: TMaskOpCodes); virtual; overload;

I understood you will change constructor Create() to support the backwards
compatible syntax.
Now there is CreateLegacy() to make it easy and intuitive to use.
The same way a new CreateExtended() would make the new syntax easier to use.
Such a constructor is handy and intuitive especially when code completion
is used. A user sees alternative constructor names right away.
A sign of an intuitive well designed API is that you can select methods and
properties etc. with code completion by their names without referring much
to documentation. At least you then get an idea of what to search from the

These __are__ the extended constructors for aal the fancy new/extended
> stuff.
> They are called by all the other constructors that only have the old
> parameters.
> So we have backwardscompatibility and extended capability just with
> all constructors named simply Create.

The idea was only to offer an intuitive API which gives a hint there is
something extended available, just like CreateLegacy() gave a hint there
is the good old legacy syntax available.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20211027/38085b53/attachment.html>

More information about the lazarus mailing list