11 ms·
JavaScript. The Core: 2nd Edition
- expertentipp 9y agoThis article is useless for the modern web development. Nowadays the essential is to know the nuances between Angular versions and how to defer a promise returned by chained observables.
- uoaei 9y agoWhile I appreciate the tip, it's completely irrelevant to the topic at hand.
- macspoofing 9y agoYou can get away with treating a JavaScript Engine as a black-box but understanding what is happening under the hood will make you better. It will give you a mental model to draw on when you run into some edge case that causes strange behaviour that is otherwise unexplained.
- watwut 9y agoIt is for those who already know frameworks, can hack something together and are interested in learning more. Having habit of learning things like this helps a lot in the long term.
- tomclive 9y agoI've just been reading through this and it's surprisingly accessible to someone without a CS background. Anthony Alicea's Understanding Weird Parts of JS on Udemy was pretty good at introducing some of these concepts and I would have thought most people working with JS would be interested in finding out what's below the surface.
- _cereal 9y agoTrue, I'm not much into client side programming, just learning and lectures like this or Axel Rauschmayer's[1] are gold sources to understand Javascript. [1] http://exploringjs.com/es6/ http://exploringjs.com/es6/
- sAbakumoff 9y agoAs much as I like dmitrysoshnikov's content, I think it can't compete with You Don't Know JS series.
- vog 9y agoDo you care to elaborate? What do you see missing, what should be improved?
- sAbakumoff 9y agoI mean downvoters didn't care to elaborate, so why should I do that.
- obstacle1 9y agoBecause saying "X is worse than Y" is not useful unless you provide reasons as to why you believe that. Imagine being someone reading your post. What are they to think? "Oh, this person says X is worse than Y -- I'll go ahead and take their word for it, despite no justification"? That's them buying into an appeal to your authority. Now imagine if you'd actually provided reasoning. "Oh, this person says X is worse than Y because Z -- Z is a good point, therefore this is useful!" How different. Providing baseless opinions is not useful, which is why you got downvoted; and incidentally, it's the exact same reason why you should "care to elaborate".
- vog 9y ago> downvoters didn't care to elaborate Obviously not true. You just replied to the counterexample, where I did elaborate on my downvote.
- Sawamara 9y agoThis is a very solid foundation to work with, for anyone who might have struggled with the contexts and how arrow functions, local variables, thises (hah) and prototypes fit into the bigger picture. It also clearly shows that Javascript is not the mess that it looks like from a beginner's perspective. Yes, anyone can create a 15-20 min video about how == and === can mess up stuff, how you cant just pass around a function with a this in it without being careful, how NaN is wtf, and all that jazz. But at the end of the day, stick to this language long enough and it works for you.
- skocznymroczny 9y agoI just wish Javascript had a standarized working module system that doesn't require external dependencies (webpack/rollup etc.)...
- fiala__ 9y agoIt does now (ES2015 modules) but it was standardized too late, so people created their own solutions, and now it's super hard to implement the standard over them. That's why nodejs isn't transitioning to ES2015 modules anytime soon (although they're working on it).
- sametmax 9y agoSure this car get dust on the ventilation, and you can mess up if you use the 3rd gear and you can't really use the blinkers without being careful and the seat warmers are wtf. But in the end of the day, stick to this car long enough and it works for you. Plus the most popular road of the world only accept this car so take it or leave.
- at-fates-hands 9y agoNot everybody can afford a Tesla or a BMW. For some of us, A Toyota Corolla or a Honda Accord is more than capable of getting the job done.
- 9y ago
- frik 9y agoI wish Douglas Crockford would update his great "JavaScript: The Good Parts". It's still great and aged okayish, but doesn't cover ES2015+.
- alexhutcheson 9y agoIs there a good similar book that covers modern JS?
- tomclive 9y agoThe 3rd edition of Eloquent Javascript (including ES6) should be online next month. Marijn Haverbeke was fundraising and reached his target. https://eloquentjavascript.net/3rd_edition/ https://eloquentjavascript.net/3rd_edition/
- mariushn 9y agoRelated, any Typescript guides that you found very useful?
- joshuacc 9y agoI've found Basarat's TypeScript Deep Dive very helpful: https://basarat.gitbooks.io/typescript/content/ https://basarat.gitbooks.io/typescript/content/
- stdgy 9y agoWow, this is great! I think it's the clearest, tersest explanation of JS langauge fundamentals that I've seen.
- brosky117 9y agoI also highly recommend Kyle Simpson’s “You Don’t Know JS” series. Very very good. https://github.com/getify/You-Dont-Know-JS/blob/master/README.md https://github.com/getify/You-Dont-Know-JS/blob/master/READM...
- johnhenry 9y ago> "ECMAScript is an object-oriented programming language, having concept of an object as its core abstraction." I'm curious as to whether or not this definition makes sense to other developers? ECMAScript does have a built-in "Object" data type, though I wouldn't say that this is it's "core abstraction". Further, firmly object-oriented languages, such as Java, seem to lack this abstraction. Perhaps I'm missing something in the definition?
- FLUX-YOU 9y agoHuh? All objects in Java implicitly derive from java.lang.Object. Same for .NET and System.Object. The exceptions being value-types and structs.
- johnhenry 9y agoSorry, as a Javascript developer, my understanding of the Objects in Java is crude at best, so I may not have made a lot of sense here.
- ridiculous_fish 9y agoThe core notion is little-"o" objects, which are a collection of properties, which in turn are a collection of attributes. There is also the big-"O" Object (sometimes called the "Object object," hah). This is a place to hang useful functions and also serves as the default prototype.
- abiox 9y ago"object oriented" can mean a wide variety of things. java isn't necessarily more object-oriented than other options. generally, i think when people say "oo", they're really just referring to nominal subtyping; probably due to the language's ubiquity (as well as c++ and c#). this nominal subtyping gives rise to the hierarchical taxonomies of object-classes that are a quintessential characteristic of java, c# and friends.
- mvaliente2001 9y agoIt's a Prototype Oriented Language, a language where the inheritance chains follows objects. Although, in all fairness, Object Oriented programming should be called Class Oriented, and Prototype Oriented should be called OOP.
- vorpalhex 9y agoThis is good, with one major critique: > ECMAScript is an object-oriented programming language, having concept of an object as its core abstraction. This is technically correct but misses that Javascript is not OO in the way that many other languages are, but is instead prototypical in nature. That's an important distinction because creating long prototype chains in JS is a very bad and negative habit, where as the same behavior is absolutely fine in Java.
- aryehof 9y agoDoes JavaScript have some special definitions for delegation and dynamic dispatch? The definitions provided in the article appear to particularly relate them to inheritance - which is not the traditional definition applied to either term in object-orientation?
- Sawamara 9y agoI think that the article is actually correct, because the reason why in other - mostly static, and better designed dynamic -languages, you knew that member functions were bound to the object being called is because that is how the functions were actually handled by that language's runtime. There is no such assumption in JS, so where in C# you explicitly design a delegate, the reverse is true here. You need to explicitly bind the function or declare the function as a property with an arrow function and capture the execution context.
- deleted 9y ago[deleted]
- zhirzh 9y agoIt bugs me that the use of the word "inheritance" overshadows "delegation". It paints a false image of the language.
- Roboprog 9y agoAs many useful things as there are in ES2015 (and beyond!), it's probably worth pointing out a few "corporate" environmental constraints that might limit one to ES 5.1: * IE11 isn't dead yet. MS still supports it. * The "Nashorn" engine inside (Oracle) Java 8 only supports 5.1. Scoff at them if you will, but some of us have to live with these things, and aren't using a transpiler.
- Roboprog 9y agoOne issue I have with this JS tutorial is that it spends little to no time talking about FP, just OOP (functional vs object-oriented programming). What text it does devote to Closures makes them sound like a "problem" to be worked around. Funny, I thought "this" was the problem (to be worked around, or avoided entirely whenever possible). Class based languages such as Java do an excellent job of modeling how I thought about programming back in 1990. It's how we were taught in school, so as to be able to manage mutable data in a turing tar pit. (remembering a lecture about garbage collection, which essentially scoffed at the overhead...) Having learned a good deal more about FP in the last 10 or 15 years (beyond the little bit of Lisp I did in an AI class back in the 80s), Javascript really starts to shine in many ways, whereas Java (and other [Simula67 subset] C++ derivatives) looks like the intellectual cripple in comparison. I wish people would stop trying to turn Javascript into something more and more like C++/Java. Just stop, already. It was supposed to be like Scheme and/or Smalltalk, but The Management (marketing) got involved, and the rest is tragedy, er, history.
- yugoja 9y agoThe last paragraph describes perfectly frustration JavaScript developers face while going deep into the language.