Skip to content

Comment on C# almost has implicit interfacesparent

Comments

An interface is a named set of one or more function pointers. (actually zero or more if you use empty interfaces too).

But yes, this idea is for the case where there's exactly one interface member, then it's equivalent to a function pointer.

Did you just misquote me and "well, actually'd" your own paraphrase? I never used "one or more" :)

What is this catchphrase word salad trying to convey? I can see exactly what you used and didn't use, in your one sentence long comment above. Why assume that you're being quoted at all?

Empty interfaces or "marker interfaces" are allowed by the c# language: public interface IDoNothing { };

But no style guide will recommend them, and they are seldom seen in code, as there are better ways to accomplish the same thing. So they're technically there, but are usually overlooked, that's all.

Single-method interfaces are common, and are roughly equivalent to a function pointer.

Multi-method interfaces are also common, and are not.

It's not about you.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.