[Gambas-user] Gambas 3 IDE features request
Benoît Minisini
gambas at ...1...
Sat Dec 18 17:33:18 CET 2010
> 2010/12/18 Benoît Minisini <gambas at ...1...>:
> > I think that already exists: it's named "Property". :-)
> >
> > --
> > Benoît Minisini
>
> Hi Benoît. I know that property exists, but:
>
>
> 1) In some situations (rare I admit, but real) could be necessary
> write a setter and unnecessary write a getter, but properties are
> both: write and read or only read, there's no option to automatically
> write only the code for property write
For me, a write-only property is a non-sense. Just use a normal method then.
> 2) Properties, forces to have more code
Just one line to declare the property.
> 3) Properties, forces to use the dot notation or to write getters and
> setter by hand
No, both. And this is better. It allows to underline that normally a property
is a light O(1) process (just reading something somewhere, or writing and
updating something somewhere), whereas a method underlines a more complex and
heavier algorithm.
> 4) Write and Read methods are generated while code is being write. I
> would appreciate can write sketch code for a class without Write/Read
> or getters/setters methods, and when I finished the class design can
> generate that code automatically by one step.
When you enter the property declaration, the getter and the eventual setter
are written automatically. But they do nothing, so what is the problem?
Setter and getters were invented only for languages that do not have
properties.
Regards,
--
Benoît Minisini
More information about the User
mailing list