Showing posts with label language-design. Show all posts
Showing posts with label language-design. Show all posts

Tuesday, May 29, 2012

Why must we define both == and != in C#?


The C# compiler requires that whenever a custom type defines operator == , it must also define != (see here ).

Sunday, May 20, 2012

Why must we define both == and != in C#?


The C# compiler requires that whenever a custom type defines operator == , it must also define != (see here ).

Thursday, April 19, 2012

Benefits of prototypal inheritance over classical?


So I finally stopped dragging my feet all these years and decided to learn JavaScript "properly". One of the most head-scratching elements of the languages design is it's implementation of inheritance. Having experience in Ruby, I was really happy to see closures and dynamic typing; but for the life of me can't figure out what benefits are to be had from object instances using other instances for inheritance.

Monday, April 16, 2012

Why is Multiple Inheritance not allowed in Java or C#?


I know that multiple inheritance is not allowed in Java and C#. Many books just say, multiple inheritance is not allowed. But it can be implemented by using interfaces. Nothing is discussed about why it is not allowed. Can anybody tell me precisely why it is not allowed?