{"id":31375,"date":"2019-01-21T09:39:15","date_gmt":"2019-01-21T15:39:15","guid":{"rendered":"https:\/\/gregladen.com\/blog\/?p=31375"},"modified":"2019-02-14T19:25:24","modified_gmt":"2019-02-15T01:25:24","slug":"learning-and-using-javascript-eloquently","status":"publish","type":"post","link":"https:\/\/gregladen.com\/blog\/2019\/01\/21\/learning-and-using-javascript-eloquently\/","title":{"rendered":"Learning And Using JavaScript Eloquently"},"content":{"rendered":"\r\n<p>First, let me disabuse you of the notion that &#8220;JavaScript&#8221; and &#8220;Java&#8221; are totally unrelated to each other other than having the word &#8220;Java&#8221; in both. That is a bit of revisionist history that serves no real purpose. On the other hand, JavaScript is not a scripty version of Java by any means. The two are different languages, developed independently, for very different purposes. The overlap or connection stems in part from the fact that early thinking about getting a language to program stuff inside browsers was happening when Java was emerging, and Java would be likely considered the default language to use for such a think, if a full blow real life language would ever be considered for this task. JavaScript have elements that look like Java, and was created by Brendan Eich to use instead of Java and it was, at the time, called Mocha, which is a coffee drink and Java is coffee and they drank a lot of coffee so&#8230;.)<\/p>\r\n<!--more-->\r\n\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"alignright is-resized\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"31376\" data-permalink=\"https:\/\/gregladen.com\/blog\/2019\/01\/21\/learning-and-using-javascript-eloquently\/eloquentjavascriptbookreview\/\" data-orig-file=\"https:\/\/i0.wp.com\/gregladen.com\/blog\/wp-content\/uploads\/2019\/01\/EloquentJavaScriptBookReview.png?fit=605%2C799&amp;ssl=1\" data-orig-size=\"605,799\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"EloquentJavaScriptBookReview\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/gregladen.com\/blog\/wp-content\/uploads\/2019\/01\/EloquentJavaScriptBookReview.png?fit=227%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/gregladen.com\/blog\/wp-content\/uploads\/2019\/01\/EloquentJavaScriptBookReview.png?fit=604%2C798&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/gregladen.com\/blog\/wp-content\/uploads\/2019\/01\/EloquentJavaScriptBookReview.png?resize=269%2C355\" alt=\"\" class=\"wp-image-31376\" width=\"269\" height=\"355\" srcset=\"https:\/\/i0.wp.com\/gregladen.com\/blog\/wp-content\/uploads\/2019\/01\/EloquentJavaScriptBookReview.png?w=605&amp;ssl=1 605w, https:\/\/i0.wp.com\/gregladen.com\/blog\/wp-content\/uploads\/2019\/01\/EloquentJavaScriptBookReview.png?resize=500%2C660&amp;ssl=1 500w, https:\/\/i0.wp.com\/gregladen.com\/blog\/wp-content\/uploads\/2019\/01\/EloquentJavaScriptBookReview.png?resize=227%2C300&amp;ssl=1 227w\" sizes=\"(max-width: 269px) 100vw, 269px\" data-recalc-dims=\"1\" \/><\/figure><\/div>\r\n\r\n\r\n\r\n<p>The fact that this is a falsehood, however, is irrelevant.  JavaScript is not Java (though they have a mingled early history of a sort) and JavaScript is the language you are likely to use if you want to program stuff inside a web browser. <\/p>\r\n\r\n\r\n\r\n<p>There is already a lot of stuff programmed into pages viewed by browsers, so knowing something about JavaScript is probably something you want if you are messing around at all in this area, even if just to fix stuff up or adapt it.  And, a good way to do that is to get a hold of Marijn Haverbeke&#8217;s new book <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.amazon.com\/gp\/product\/1593279507\/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1593279507&amp;linkCode=as2&amp;tag=grlasbl0a-20&amp;linkId=837d0ec938d204af5df320f05b9263ab\">Eloquent JavaScript, 3rd Edition: A Modern Introduction to Programming<\/a>.  <\/p>\r\n\r\n\r\n\r\n<p>Everybody hates JavaScript, including, it would seem, its creator (see video below) and Haverbeke, the author of this book. But they also love it, and use it, and know about it, as well should you, probably (if you are reading this far).  The book lays out the basics of how the language works, then guieds you through sticking JavaScript stuff into your browser.  In particular, Haverbeke goes through a number of very instructive and exemplary examples.  There is a pretty good chance that something you want to create, modify, or fix, relates in some way to one or more of the small projects in the book, and from there, you can understand and recode or create as you need to.<\/p>\r\n\r\n\r\n\r\n<p>The book also covers Node.js.<\/p>\r\n\r\n\r\n\r\n<p>Here is the TOC: <\/p>\r\n\r\n\r\n\r\n<p>Table of contents <br>\r\nIntroduction<\/p>\r\n\r\n\r\n\r\n<p>Part I: Language<\/p>\r\n\r\n\r\n\r\n<p>Chapter 1: Values, Types, and Operators<br>\r\nChapter 2: Program Structure<br>\r\nChapter 3: Functions<br>\r\nChapter 4: Data Structures: Objects and Arrays<br>\r\nChapter 5: Higher-Order Functions<br>\r\nChapter 6: The Secret Life of Objects<br>\r\nChapter 7: Project: A Robot<br>\r\nChapter 8: Bugs and Errors<br>\r\nChapter 9: Regular Expressions<br>\r\nChapter 10: Modules<br>\r\nChapter 11: Asynchronous Programming<br>\r\nChapter 12: Project: A Programming Language<\/p>\r\n\r\n\r\n\r\n<p>Part II: Browser<\/p>\r\n\r\n\r\n\r\n<p>Chapter 13: JavaScript and the Browser<br>\r\nChapter 14: The Document Object Model<br>\r\nChapter 15: Handling Events<br>\r\nChapter 16: Project: A Platform Game<br>\r\nChapter 17: Drawing on Canvas<br>\r\nChapter 18: HTTP and Forms<br>\r\nChapter 19: Project: A Pixel Art Editor<\/p>\r\n\r\n\r\n\r\n<p>Part III: Node<\/p>\r\n\r\n\r\n\r\n<p>Chapter 20: Node.js<br> Chapter 21: Project: Skill-Sharing Website<br> Chapter 22: JavaScript and Performance<\/p>\r\n\r\n\r\n\r\n<p><strong>Marijn Haverbeke<\/strong>\u00a0is a programming language enthusiast and polyglot. He&#8217;s worked on a wide range of software systems, from databases to compilers to editors. He runs a small business around his open source projects.<\/p>\r\n\r\n\r\n\r\n<figure><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/XOmhtfTrRxc\" allowfullscreen=\"\"><\/iframe><\/figure>\r\n","protected":false},"excerpt":{"rendered":"<p>First, let me disabuse you of the notion that &#8220;JavaScript&#8221; and &#8220;Java&#8221; are totally unrelated to each other other than having the word &#8220;Java&#8221; in both. That is a bit of revisionist history that serves no real purpose. On the other hand, JavaScript is not a scripty version of Java by any means. The two &hellip; <a href=\"https:\/\/gregladen.com\/blog\/2019\/01\/21\/learning-and-using-javascript-eloquently\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Learning And Using JavaScript Eloquently<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":31377,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/gregladen.com\/blog\/wp-content\/uploads\/2019\/01\/JavaScriptCode.png?fit=573%2C137&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p5fhV1-8a3","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/posts\/31375"}],"collection":[{"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/comments?post=31375"}],"version-history":[{"count":3,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/posts\/31375\/revisions"}],"predecessor-version":[{"id":31591,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/posts\/31375\/revisions\/31591"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/media\/31377"}],"wp:attachment":[{"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/media?parent=31375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/categories?post=31375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/tags?post=31375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}