Decades ago I got out of the habit of writing C code that was easy for the compiler to translate into VAX machine language instructions. I didn't realize those skills I let atrophy might someday became useful again for JavaScript.
When do you think schools teaching JavaScript should instruct their students how to write easily minifiable code? Is that an appropriate topic for JavaScript 101, or is it more of a graduate level thing?
Can you please suggest any good online course where I can learn this important skill that you're suggesting all JavaScript programmers should have?
Has Doug Crockford written a book called "JavaScript: The Minifiable Parts"?
Does Google test job candidates for the ability to write minifiable JavaScript code on the white board during job interviews, by giving them a dry erase marker that's almost run out?
FWIW, back when I joined Google Search in 2009 the whole company was on a huge latency kick, and yet inline JS snippets in the HTML weren't compiled, and so there were instances where we had to "human compile" Javascript down into its minimum form. Single-character variable names, foreach-loops that look like "for(var i,e;e=c[i++];){...}", ordering statements so that they would GZip better - basically we were trying to simulate an optimizing JS compiler in our heads. I had code reviews turned back because I could save 1 byte in total GZipped size with a different for-loop construction.
Yes, this is insane. No, they don't do this anymore. But I'm glad I had the opportunity to do this (on somebody else's dime), because it made me really think about latency and on the performance trade-offs you make to get maintainable code. Code size is not free; many devs think it is, and they write really bloated SPAs as a result. And there's also a lot of low-hanging fruit that doesn't require lots of engineer effort but gives appreciable latency benefits.
No need to go overboard there Don. In fact, my statement was really intended to mean "minifiable" in the sense of an angular application. That is, following documented best practices for writing a minifiable application in angular as described here: https://docs.angularjs.org/tutorial/step_05
By "especially for simple applications" do you actually mean "only for extremely simple applications"?
So do you really believe that the insane scoping madness described in the article, and the fact that Angular's new templates breaks HTML syntax making it impossible to edit/validate/transform/generate/consume them with standard off-the-shelf HTML tools, are really not big issues, and dirt-simple two-way binding outweigh those problems, and are impossible to do without causing those other problems in the first place?
Since the order a user fills out text fields on a web page affects the scope in bizarre unexpected ways, shouldn't Angular automatically disable the offending second text field until the first is filled out, and provide tooltips and help text explaining to users why they're disabled, to force users to enter them in the correct order, that will not undermine the intent of the developer? Is that the kind of implicit magic that you expect from your full service front end web development stack, that makes it all worth it in the end?
Personally, I'd rather have a scoping mechanism that's less magical and astonishing, and more deterministic and predictable. And a templating system that doesn't forsake and reject the rich existing ecosystem of HTML and XML tools.
When do you think schools teaching JavaScript should instruct their students how to write easily minifiable code? Is that an appropriate topic for JavaScript 101, or is it more of a graduate level thing?
Can you please suggest any good online course where I can learn this important skill that you're suggesting all JavaScript programmers should have?
Has Doug Crockford written a book called "JavaScript: The Minifiable Parts"?
Does Google test job candidates for the ability to write minifiable JavaScript code on the white board during job interviews, by giving them a dry erase marker that's almost run out?