Re: [Vala] Final / Sealed classes in Vala



On Fri, Sep 25, 2009 at 17:45:28 +0200, Hans Vercammen wrote:
On Fri, 2009-09-25 at 23:36 +1000, Magentus wrote:
Does anyone have a concrete example of where this sort of thing is
actually appropriate, just for the sake of blocking sub-classing?

I agree it is arguable and I don't see this as a high priority or must
have feature.

In my opinion a feature should not be implemented unless there is a real
use-case for it with no easy alternative. Otherwise we get a bloat.

But in the end it comes down to language design and in
vala's case, enforcing compile time errors instead of deferring critical
errors and misbehavior at runtime. (just like abstract classes are not
instantiatable, even if they don't contain abstract or pure virtual
methods)

Programmers should be given enough rope to shoot themselves in the feet.

Abstract classes are different thing, because they prevent instantiating them
by mistake. But do you think you would inherit a class by *mistake*?

On the other hand I had problems with things being declared private when they
were needed outside the class many times, either by mistake or because the
author didn't realize they were actually needed by the user.

-- 
                                                 Jan 'Bulb' Hudec <bulb ucw cz>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]