News for hackers. Stuff that matters.
Re:Types as Interfaces by klysm on Tuesday July 23, 2024 @12:23PM (#41047833)
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.
Re:Types as Interfaces by tinix on Tuesday July 23, 2024 @02:29PM (#41049239)
fair, maybe i should have said "protocols define behavior" instead of interface