Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Depends on the language. In typescript and interface can absolutely encode shape. In C# you can encode shape in interfaces via properties. Interfaces don’t even describe behavior, it’s just that we typically associate them with a man implicit contract. Strictly speaking they are just a shape.


fair, maybe i should have said "protocols define behavior" instead of interface




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

Search: