Hello,

I agree with David's statement:
> So yes anyay, my view is that between interfaces as we have them today,
> traits and abstract classes, there isn't a problem which needs to be
solved
> by now allowing properties on interfaces, but it would open up a
likelihood
> of encouraging things which are often regarded as anti-patterns.

It could be abused creatively. Interfaces define the behaviour of the
object, not the data the object should contain. That's why the properties
are implementation details. Liskov principle describes the behavioral
subtyping, not the state.

Although a few languages already support properties in interfaces (C#,
Java, Typescipt), so it's not rare case in other languages. However, I'm
not well oriented whether those communities have any problems with them.

My though about this topic. Wouldn't allowing abstract properties in
abstract classes resolve the issue of 'enormous amount of boilerplate code'
without touching interfaces, Zoltán?

Kind regards,
Jorg

Reply via email to