c# ramblings

why can’t we have constructors in an interface? grrr.

about the “language has no syntax for this” – it’s as simple as 1-2-3. ISomeType something= new<ISomeType> typeVariable(arg, arg2, arg3), f.ex. Static checking, no grammar conflicts, all good.

Without the syntax it’s easy, too, either with Factory pattern, or w/reflection, but it’s not so nice :/

I surely miss python-style callables/constructors unification.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s