Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I didn’t know this for years. Please don’t turn this into an interview question. In fact, this post is more about JavaScript than it is about React.

Well, I think how prototype works is much more important than using React.

I think having an interview in JS without knowing prototype is like having an Java interview without knowing polymorphism, abstract class, interface or something.



I don't disagree with this — I was referring to the how does React do it part specifically.

Although I'd also note that in practice people tend to use a subset of JS in their work, and often prototypes aren't directly used. (I understand they power everything under the hood but I'm talking about something product engineer has to think about.)


I have heard Prototype in js used as a term, but I don't really understand what it means. I have programmed a good deal of things in js also, and I have never felt like I needed to explicitly know what Prototype means. Is it really essential to know what this term means?


As a js dev for 6 years now, and having conducted hundreds of interviews, I would say it is not necessary for a junior developer and most of the things they'd be doing.

However, when it comes to a mid or senior level engineer, it's important not to just make things work, but to understand the how and why in order to build performant applications at scale.

So to answer your question, no it's not a necessity to build applications. Yes, it is if you want to excel at building applications.


Depends on what you work on and what kind of developer you are.

If you are just building frontend applications using frameworks like React and Vue, you don't really need to know how things work under the hood. Especially with all of the new syntactic sugar introduced to JS in the last few years.

But, if you are building lower level tooling and you want to understand why things are implemented the way they are (this post being a great example) you really should understand them as best you can. A lot of design decisions in JS are influenced by these lower-level design "constraints."


I don't know.

Prototypes are more powerful than anything Java has to offer.

It's a low-level concept that is mostly used to create a class system on top of it, rather than used directly.

Polymorphism, abstract classes or interfaces are part of the day-to-day stuff a Java dev has to meddle with.


I have developed javascript applications for a while now and I have never had to use prototype. If I was asked about it in an interview, I would explain that it's a leaky abstraction, that using it in code means you are over-complicating your solution, and that it seems to be a holdover from when people thought your codebase should be modeled according to reality ("we have users, therefore we should have a user model").

You can absolutely be a great javascript developer without ever touching prototype. Prototype is an infection of object-oriented programming into a functional language.


I couldn't agree more !




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: