TodePond / DreamBerd

perfect programming language
https://dreamberd.computer
Other
10.62k stars 299 forks source link

Add Inheritance #640

Open valoeghese opened 2 weeks ago

valoeghese commented 2 weeks ago

But you can only remove properties from subclasses

SkyaTura commented 1 week ago

Add inheritance, but all properties must be private

JUSTIVE commented 1 week ago

there must be inheritance tax, indeed

schaier-io commented 1 week ago

I feel strongly against it Inheritance is a feature so messed up only Java Devs can use it. Therefore, I believe it is not a good idea for any serious project

SkyaTura commented 1 week ago

What if instead inheritance, you could cherrypick some behavior from a class e use it on yours?

schaier-io commented 1 week ago

Maybe we can have a look into how it works in nature. The default there is that you will inherit different traits from one parent and others from the other parent.

So maybe it is a solution to inherit from two classes simultaneously and choose at random which behaviour is used?

SkyaTura commented 1 week ago

Maybe if the parent class could specify different sets of traits to be inherited based on randomness and combination of factors.

For instance, it's random for the child to be of a type annotated by a unsigned 1 digit number.

A class could annotate that only children with X or Y type inherit the traits.

No kidding, this would be awesome.