Hacker News new | past | comments | ask | show | jobs | submit login

Responding to messages or choosing not to is event handling.



In a sense, but message passing is the basic concept of object-oriented programming. Choosing which messages to receive and respond to is defining an interface. If you don't want to do that, you just don't want an object-oriented list of strings. Maybe you just want a list of strings that lives in a struct with some function pointers and some syntactic sugar for calling those functions. And that's fine. But for those of us who do want an object-oriented list of strings, allowing that list of strings to respond to messages like "where" is perfectly acceptable, and certainly no worse than demanding that it only respond to messages like "filter".

If anything, it introduces unnecessary semantics to syntactically distinguish between messages that are responded to with instance variables and messages that are responded to with function calls.


[deleted]


It's nice that you know more about the semantics of C# than the maintainers of the .NET framework.


edit: lost cause




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: