Creative JavaScript?

Saw this a little while ago, but suspect it’s not new. Even to my novice eyes it looks as untidy as it comes. Your thoughts?

Modern javascript, annotated (updated): pic.twitter.com/iIFDHpoxJJ

— Eric D. Fields (@ericdfields) December 18, 2015

https://pbs.twimg.com/media/CWeYEUvWoAA5Z3V.png

He goes in to further detail in the following blog post: https://medium.com/@ericdfields/modern-javascript-annotated-updated-an-epilogue-c29aad3507fb

Is there actually any native JavaScript in there? It doesn’t look like it - looks like it is all calls to a framework library. That framework might be written in JavaScript but that doesn’t make the code written to use the framework an example of modern JavaScript though.

Good point. I have trouble reading code as an image, but it looks like the complaint is more about how the webpack module bundler is using the React library and Redux framework more than “modern JavaScript” in general.

I’m guessing it’s required that code be written a certain way in order to work.
eg. similar to jQuery syntax being different from non-jQuery JavaScript

IMHO if one doesn’t like the learning curve or thinks the package / library / framework is garbage, don’t use it. But I guess rants bring clicks

Most of the annotations are js.

imports, exports, decorators, fat arrow, classes, inheritance, const, splats.
JSX is the only odd one one out.

but that doesn’t make the code written to use the framework an example of modern JavaScript though.

All of the recent examples I’ve been reading(Angular 2, React, Vue etc.) look a lot like that actually.

They are still just the code that calls the framework though. Those frameworks might be using JavaScript but the code looks no more like actual native JavaScript statements than jQuery does.

You can create a framework where the calls you write look however you want them to look and still use JavaScript to do the actual processing - that doesn’t make the way you design the code for your framework JavaScript though

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.