Skip to content

Comment on More details on Microsoft's new M# languageparent

Comments

You may be right about python, I don't know it as well as the others.

though you can end up in the same situation with "optimistic downcasting" (eg, get an Object as parameter

You can, though it doesn't happen much in practice. The complexity of the type systems (generics, interfaces, etc) are aimed in part at always allowing there to be a strong type.

Using void* in C/C++ is to explicitly disable type checking for something like byte buffer i/o. Another circumstance is in a broad interface such as a callback method that will pass along an argument. In the latter case a top-level interface like 'object' is essentially the same thing and in both languages you can create APIs that don't have these catch-alls. What's the wisdom behind wanting to be protected from this construct?

AboutSource Built by g1lg1l

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