[fpc-pascal] Re: Delphi's anonymous functions in Free Pascal
tcoq at free.fr
tcoq at free.fr
Thu Aug 30 10:31:12 CEST 2012
No, "can't" is the correct word. In Pascal, one should have the ability to name the constructs one uses. For example, i like very much the ability to name my own Event types:
"type TOnMyEvent = procedure(aStr: string) of object;". Or my Exception types.
Thinking about the event name usually helps me to nail my design.
And you're right, your example is spot on. I use Pascal Analyzer (thanks Peganza!) to check my own programming (as I'm lazy as everybody else), and it detects bad design just like the example you mention. Usually because of the unnamed constant. When I have some time for refactoring, i try removing some of the more offending smells...
What's nice about Pascal is that we all smell them easily... ;-)
----- Mail original -----
De: "Arioch" <AriochThe at gmail.com>
À: fpc-pascal at lists.freepascal.org
Envoyé: Jeudi 30 Août 2012 10:18:31
Objet: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal
> a laziness to software design: what you can't name you actually don't
Guess you meant "don't want to" instead of "can't"
And You mean all the non-named arrays, don't you.
"var x: array[0..10] of integer; " is not only violating Pascal Report, but
also is twice lazy.
since one should name every part of design one should type like
SomeEnumSemanticName = 0..10;
SomeEnumMapSemanticName = array[SomeEnumSemanticName] of integer;
var x: SomeEnumMapSemanticName;
That has a point, for self-documenting if nothing else. But i don't believe
it is practically that pervasive as your stated maxima would assume.
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Delphi-s-anonymous-functions-in-Free-Pascal-tp4911527p5711056.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
fpc-pascal maillist - fpc-pascal at lists.freepascal.org
More information about the fpc-pascal