Sealed classes - would you want them in D? (v2)

Steven Schveighoffer schveiguy at yahoo.com
Fri May 18 12:51:42 UTC 2018


On 5/17/18 10:08 PM, KingJoffrey wrote:
> On Thursday, 17 May 2018 at 14:14:28 UTC, Steven Schveighoffer wrote:
>>
>> D's main draw is not OOP. So if you are here for OOP goodies, then you 
>> are definitely better off looking elsewhere.
>>
> 
> I'll add that too my list of D forum quotes.

Awesome, I love being on lists!

> 
>> That being said, D does have OOP, and many OOP programmers are fine 
>> with the current state of affairs.
> 
> How many OOP programmers in the world?

Too many.

> How many of them use D?

Only the good ones ;)

> Your use of the word 'many' is questionable.

Many means more than a few.

>> Not disputing that, it's a reasonable choice either way.
> 
> And yet, the D community is intent on not empowering the programmer to 
> make that choice themselves.

I'm not aware of a programming language that lets the user decide what 
keywords are supposed to mean. If there is one, let me know so I can 
stay away.

>>
>> Unfortunately, that fails the first time you see code that has 
>> "sealed" on it, and have to go figure out what exactly that means.
> 
> That's what happend to me, with the 'D version' of 'private'.

It happened to me too!

https://forum.dlang.org/post/fbs28v$2ss6$1@digitalmars.com

And then I learned how it worked and said "oh, ok, makes sense".

> You can say the same for every other attribute D has, that I had never 
> seen before.
> 
> It's a nonsense argument that many use, to prevent change.

The argument is that it *does* add to the load needed to understand the 
language, so it better be worth it. It's not a nonsense argument, every 
extra attribute adds extra cognitive load.

So saying the change would be "blind" to those people who don't care 
about it is not true. When you see an attribute that you don't 
understand, you need to look it up to see what it does, it may do 
something you don't want it to.

>> You're welcome to write a DIP, but I don't see a very good chance for 
>> acceptance given the discussions on this subject.
>>
> 
> I agree. The D community is too small, and insufficiently diverse to 
> discuss this any further.

Hm.. I see you are still here arguing though. Interesting.

> It's funny how we build programming languages to serve us, but we end up 
> serving them.

This should go on your quotes list I think. Or maybe a fortune cookie.

-Steve


More information about the Digitalmars-d mailing list