News for hackers. Stuff that matters.
Re:Imba: A new programming language for web apps by wnevets on Thursday January 14, 2016 @11:23AM (#10902298)
prototypal inheritance isn't a liability that needs to be fixed.
Re:Imba: A new programming language for web apps by manyoso on Thursday January 14, 2016 @11:31AM (#10902355)
Yes, it is and the first reason is related to #1. Prototypical inheritance doesn't make much sense outside of a dynamic language. The second reason is because Javascript is disguised to look like Java and hence people familiar with the C-family of languages are surprised and baffled because Javascript is using the C-family syntax and idioms for classical inheritance to mask the very different prototypical inheritance.
Re:Imba: A new programming language for web apps by wnevets on Thursday January 14, 2016 @11:37AM (#10902406)
Javascript is disguised to look like Java because people keep trying to "fix" it.
Re:Imba: A new programming language for web apps by manyoso on Thursday January 14, 2016 @11:47AM (#10902513)
It was designed from the very beginning by Eich to look like Java and not because subsequent people tried to "fix" it. Where are you getting this stuff?
Re:Imba: A new programming language for web apps by wnevets on Thursday January 14, 2016 @01:03PM (#10903081)
ES2015 just added the class keyword to make it look like java last year. IIRC the new keyword wasn't part of javascript in those first two weeks when javascript was released.

Where are you getting this stuff?

Re:Imba: A new programming language for web apps by manyoso on Thursday January 14, 2016 @06:07PM (#10905515)
The point is that Eich made Javascript use syntax and idioms from Java from the very beginning and it wasn't just later evolution of the language to "fix" it that did this.
Re:Imba: A new programming language for web apps by nilliams on Thursday January 14, 2016 @02:12PM (#10903619)
'class' wasn't added to make it look like Java. It was added as sugar for a common pattern that everyone was already using. Many languages other than Java have a class keyword.
Re:Imba: A new programming language for web apps by wnevets on Thursday January 14, 2016 @02:45PM (#10903895)
> Many languages other than Java have a class keyword.

Yes many classical oop languages have the class keyword and that's why javascript added it.

Re:Imba: A new programming language for web apps by nilliams on Friday January 15, 2016 @08:37AM (#10909180)
Because it's a useful pattern, that people were using heavily. Not sure why you're trying to suggest some kind of ill-intent.

A nice thing about prototypal inhericance is that classical inheritance can be implemented in it. People were doing that commonly enough that it made sense to add sugar to do it more directly, and signal intent more clearly to the reader.

Re:Imba: A new programming language for web apps by CuriousSkeptic on Thursday January 14, 2016 @03:50PM (#10904384)
It could be interesting to have prototypical inheritance with static types if you do immutable objects and structural typing.