News for hackers. Stuff that matters.

Parsyval

Re:JavaScript: prototype vs. class on Wednesday April 04, 2018 @10:36AM (#16755089)
Well writing code is much simplier this, but devs that are familiar with 'classical' OOP languages will do a lot of mistakes because of what is in the article.
Re:JavaScript: prototype vs. class on Wednesday April 04, 2018 @10:34AM (#16755058)
Since I work with Typescript, I do the same with the TS playground, it's really usefull to learn that kind of stuff.
Re:Typescript: class vs. interface on Wednesday February 28, 2018 @03:50AM (#16481648)
'proper classes' no 'class' keyword syntaxical sugar, behind it's all prototypal. Please understand that if you are doing JS.
Re:Typescript: class vs. interface on Tuesday February 27, 2018 @12:18PM (#16475556)
Of course, you are right when you say "Once you create an instance of something [...] code will be created". But what I am pointing here is BEFORE you create any instance of anything.

You define a contract, what your object should look like. With an interface it's checked before runtime and then translates to no code. But using a class, you have code generated for the runtime.

Re:Typescript: class vs. interface on Tuesday February 27, 2018 @12:14PM (#16475502)
Thanks for this input, I'll see about that.
Re:Typescript: class vs. interface on Tuesday February 27, 2018 @11:27AM (#16474947)
"interfaces don't have a runtime representation" I was looking for a good way to say that while writing the article, this is a very good way ! Thanks Also I like that you think about the use of instanceof, I didn't really think of that, but some devs use this condition intensively.