several questions
Christopher Wright
dhasenan at gmail.com
Sun Feb 17 06:06:50 PST 2008
Saaa wrote:
>>> Thanks again,
>>>
>>> I don't think I ever override a function, should I make them final then,
>>> for optimizing purposes, or is final only for classes?
>> Are you developing an application or a library?
>>
>> If it's a library, don't final it unless it's deep in the bowels where
>> nobody will reasonably tread, or unless the library really requires
>> performance.
>>
>> If it's an application, feel free. You probably won't have much need for
>> inheritance, but then, the optimizations from your final classes might not
>> be that great.
>
> This reads as making a function final will hurt the optimization.
> btw. I don't use classes :), only functions.
> (application)
Marking a class or a method on a class as final can improve performance.
DMD might not take advantage of that as often as you like.
Marking a function that is not in a class as final should do absolutely
nothing.
More information about the Digitalmars-d-learn
mailing list