3 ms·
I've mentioned prominent example, there is underlying problem class Foo {} typeof Foo //"function" Foo instanceof Function //true Is the
by sergeykish 6y ago
I've mentioned prominent example, there is underlying problem
class Foo {}
typeof Foo
//"function"
Foo instanceof Function
//true
Is there underscore here? How about
typeof Object
//"function"
typeof Function
//"function"
Object instanceof Function
Object instanceof Object
Function instanceof Function
Function instanceof Object
How many underscores there? And looks like you don't know about
Object.getPrototypeOf
Object.setPrototypeOf
Reflect.getPrototypeOf
Reflect.setPrototypeOf
without underscore and you blame I don't know this land.
You've got burned by Java and C++, bad for you. There are other languages — Python and Ruby (last example). JS [[Prototype]] is equivalent of class hierarchy. You shown many times that you can't comprehend, normal reaction should be investigate and understand first, not your case. It shows you in a bad light.
- pwdisswordfish4 6y ago> there is underlying problem No, you haven't ever defined _any_ problem, only abstract things that bother you. There is only one problem that matters: writing a (correct) program. If you can do it without meta-programming, then you should. If you start meta-programming when you don't have to, then you have already lost. If you are doing this when you shouldn't, and then you experience pain and say, "This system needs to be fixed", then make sure you fix the correct part of the system: yourself. > JS [[Prototype]] is equivalent of class hierarchy. Which nobody is futzing around with (because they can't, and they shouldn't futz with it anyway) on the level that you're insisting we do, in the ordinary course of writing programs. (The level where you are seeing "problems".) Once again: keep that stuff in your REPL. If you are editing a regular source file that will be committed to the repo and you are typing out "prototype" or "__proto__" or "setPrototypeOf" more than once or twice every 10k lines, then you're almost definitely doing something wrong. > You've got burned by Java and C++, bad for you. No, it's that the world is burning because of thousands of programmers who can't behave responsibly because they pick up a dynamic language and say, "There are no adults around to discipline me, so now is the time to go nuts." (And the irony is that this thread exists because of your complaints about JS and how it burns you, where I started out arguing that JS is fine at the beginning. But now you're the champion for JS?)
- sergeykish 6y agoYou've shown your position — ignorance. You don't have to repeat yourself. You would not save that "burning world". I am sorry for all junior developers who is in contact with you and who you "discipline". I am quite grown up and estimate such worldviews as "no more than middle, or terrible mistake".