3 ms·
The author apparently has a rather low bar for attributing an advanced level of understanding. > Understanding a methods 'arguments' variable and how it can be
by ionfish 16y ago
The author apparently has a rather low bar for attributing an advanced level of understanding.
> Understanding a methods 'arguments' variable and how it can be used to overload functions through arguments.length and make recursive calls through arguments.callee
The arguments object is one of the first things anyone learning about functions in JavaScript is introduced to. arguments.callee is a little more obscure, but not a particularly difficult concept.
> Advanced closures such as self-memoizing functions, partial functions, and the lovely (function(){})() call
Using an immediately-executed anonymous function to enforce a scope change and hide variables is a pretty common pattern. I suppose memoisation might belong on an 'advanced' list. As indicated later, the author clearly doesn't know what a partial function actually is.
> Function and html prototyping, the prototype chain, and how to use base JavaScript objects and functions (e.g. Array) to minimize coding
Surely this should be part of the basic level of understanding required of any JS programmer. Understanding the basic semantics of a language's object model is pretty essential to doing anything much with it.
> Object type and the use of instanceof
I once had to teach some novice programmers about JavaScript. We dealt with objects and the 'instanceof' operator in, I think, around the third session. Understanding the JS object model is basic knowledge.
> Regular expressions and expression compiling
This should be meat and drink for any professional programmer. There's nothing particularly weird about regular expressions in JavaScript. Fine, you can create regular expressions by writing new RegExp("my pattern as a string"), but so what? A quick read of any JS reference will reveal this fact; it's not exactly arcane knowledge.
> Knowing how to handle and use partial functions
Err, what? All functions in JavaScript are partial, insofar as there are arguments at which the value of the function is not defined. Perhaps the author meant partially applied functions, which are a completely different thing.
> With statements and why you shouldn't use them
The concept of 'with' statements is fairly straightforward. I admit that understanding just why they're generally a bad idea (and the problems they cause for people writing JS interpreters) requires an understanding of some subtleties of the scope model.
> The most difficult part of all, knowing how to tie all these tools together into clean, robust, fast, maintainable, and cross browser compatible code.
Finally, something that uncontentiously belongs on an 'advanced' list! Note that unlike the others, it doesn't turn on grasping how some particular language (mis)feature works. In other words, there's more to knowing what you're doing than knowing what the language does.
- kragen 16y ago> there's more to knowing what you're doing than knowing what the language does. Sure, but knowing JavaScript isn't just knowing how to program; it also involves grasping how the various language (mis)features work.
- ionfish 16y agoObviously. All I'm claiming is that knowledge of the language attributes listed isn't sufficient for being an advanced JavaScript programmer, not that it's not necessary.
- dts 16y agoUnderstood, but I think providing a list of attributes that you consider sufficiently advanced would be far more constructive / interesting.
- ionfish 16y agoI think raganwald has already put the case better than I could, further up the thread: the mark of an advanced programmer is being able to use her knowledge of the language to write programs that solve interesting or difficult problems. Admittedly that's not JavaScript-specific, but one can easily specialise this general criterion by reference to specific language attributes and types of tasks which the language is commonly employed to solve (DOM scripting etc.). That's all a bit hand-wavy, so here are some more concrete suggestions. Even in these days of Node.js et al, JS is mainly used for developing web frontends, so this will be heavily slanted towards those sorts of issues. An advanced JavaScript programmer should be able to: * Develop her own DOM library along the lines of the functionality provided by jQuery or YUI: a CSS selector engine, DOM traversal, element manipulation, all wrapped in a clean and well thought-out API. * Build an extensible UI toolkit suitable for writing the frontend of a CMS, capable of handling numerous different object types, and communicating with the backend via a specified serialisation protocol. * Write a testing framework with an equal level of features and stability as common current ones, such as QUnit. * Create a form validation DSL capable of handling not just simple binary cases and regex-based validation of input fields, but the specification of more complex dependency relationships and requirements. For bonus points, tie it into the backend so the same code generates the frontend DSL code and the backend validation rules, ensuring that they always harmonise. * Develop complex (as in, complex to implement using the DOM) interface elements such as sliders, drag-and-drop controls etc. Again, I'm not saying our hypothetical advanced JS hacker should have done all this—just that she should be able to. Note that while some of these require quite extensive knowledge of the DOM and cross-browser issues, one could easily construct examples which pitched more towards different specialities—those above are just problems I'm somewhat familiar with.