Learning JavaScript:Learning JavaScript: JavaScript Essentials for Modern Application Development. 2017. E. Brown
Читать

Learning JavaScript:Learning JavaScript: JavaScript Essentials for Modern Application Development. 2017. E. Brown

 Even though this is my second book on technologies in the JavaScript ecosystem, I still find myself somewhat surprised at my role as a JavaScript expert and evangelist. Like so many programmers, I held a strong prejudice against JavaScript up until about 2012. To do such an about-face still feels a little disorienting. My prejudice was for the usual reasons: I considered JavaScript a “toy” language (without really learning it properly, and therefore not knowing of what I spoke) that was practiced by dangerous, sloppy, untrained amateur programmers. There is a little truth in both of these reasons. ES6 was developed quickly, and even its inventor Bren‐ dan Eich admits there are things that he didn’t get right the first time around—and by the time he realized it, too many people were relying on the problematic behavior for him to effectively change it (show me the language that doesn’t suffer from this prob‐ lem, however). As for the second reason, JavaScript did make programming suddenly accessible. Not only did everyone have a browser, but with only a little effort, they could see the JavaScript that enabled the websites that were rapidly proliferating on the Web. People learned by trial and error, by reading each other’s code and—in so many cases—emulating poorly written code with insufficient understanding. I’m glad I have learned enough about JavaScript to recognize that—far from being a toy language—it is based on extremely solid foundations, and is powerful, flexible, and expressive. I’m also glad I have come to embrace the accessibility that JavaScript brings. I certainly hold no animosity toward amateurs: everyone has to start some‐ where, programming is a profitable skill, and a career in programming has many advantages. To the new programmer, the amateur, I say this: there is no shame in being an ama‐ teur. There is some shame in staying an amateur (if you make programming your profession, certainly). If you want to practice programming, practice it. Learn every‐ thing you can, from every source you can. Keep an open mind and—perhaps most importantly—question everything. Question every expert. Question every experi‐ enced programmer. Constantly ask “Why?” For the most part, I have tried to keep this book to the “facts” of JavaScript, but it is impossible to completely avoid opinion. Where I offer opinions, take them for what they are. You are welcome to disagree, and you are encouraged to seek out the opin‐ ions of other experienced developers. You are learning JavaScript at a very exciting time. The Web is leaving its infancy (technically speaking), and web development isn’t the confusing, complicated Wild West that it was 5 and 10 years ago. Standards like HTML5 and ES6 are making it easier to learn web development, and easier to develop high-quality applications. Node.js is extending the reach of JavaScript beyond the browser, and now it is a viable choice for system scripting, desktop application development, backend web develop‐ ment, and even embedded applications. Certainly I haven’t had this much fun pro‐ gramming since I started in the mid-1980s.