[Issue 7724] 'final:' doesn't work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 21 11:29:15 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7724



--- Comment #8 from Manu <turkeyman at gmail.com> 2012-04-21 11:30:09 PDT ---
(In reply to comment #7)
> @Manu:
> I see your point.
> However, I disagree - one should learn the language, and understand where and
> how "final:" can be used. I have no problems with the current situation.
> Compiler also generates a helpful error message that can be understood by
> anyone. I personally never use public: final: private: etc... I prefer
> public{}, private{}, etc. or use these per-declaration.

I think it's safe to say that the preference of keeping associated stuff
together is nothing to do with learning the language or not. This is culture,
taste, and company standards.

I need to reiterate the consistency issue. Other superfluous attributes appear
to be silently ignored where they are not applicable. __gshared makes no sense
on a function, but it doesn't complain, as is static, shared, immutable, etc.
It's only final that complains, and that's very annoying, because it's the only
one I'm passionately insistent about.

I'd like to think it should be fixed to be consistent with all the others for
consistency's sake alone. Making me happy would be a nice side effect :)


>From a subjective point of view, I don't like the introduction of an extra
indentation level by attribute{}, and why supply 2 ways if not to support user
preference?

I'd prefer the language forcefully dictate how I arrange my code as little as
possible. 95% of functions are final, and as such, for us, it should always be
within the first couple of lines in the class.

It would be a company policy that it were the first line in every class if I
could explicitly state virtual. However as is now, we ideally declare 1-2
virtuals, then final:, and then everything else, with the class laid out
however is most naturally readable, and logical to follow.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list