{"id":262,"date":"2012-08-02T12:03:33","date_gmt":"2012-08-02T16:03:33","guid":{"rendered":"http:\/\/blogs.law.harvard.edu\/acts\/?p=262"},"modified":"2012-08-02T14:14:26","modified_gmt":"2012-08-02T18:14:26","slug":"javascript-is-a-trap","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/acts\/2012\/08\/02\/javascript-is-a-trap\/","title":{"rendered":"JavaScript is a Trap"},"content":{"rendered":"<p>Note: opinion<\/p>\n<p>JavaScript is the most important part of web development. It&#8217;s what separates web applications from a collection of web pages. <\/p>\n<p>The trap is one that I&#8217;ve fallen into multiple times and I&#8217;ve seen other developers fall into, unable to help them. They have these grandiose ideas and the way they see it working is with a mass of JavaScript. So they get this ridiculous mess of code, and they may not admit it&#8217;s a mess, but the trap with JavaScript is there is no way to write a lot of it without it becoming a mess.<\/p>\n<p>One of my greatest offenses in this has been my use of extjs.  This is a js framework that requires writing the code in a specialized fashion. You end up with classes that sometimes look clean but the more you stray away from exactly what the code was specialized for, the more it becomes a mess.  And this happens fast.     <\/p>\n<p>Sometimes it&#8217;s a necessary mess.  Innovation is often a mess.  The problem is differentiating innovative in terms of JavaScript and otherwise innovative. Lots of people are doing innovative things, but it&#8217;s very rarely innovative in terms of the JavaScript.  <\/p>\n<p>So what&#8217;s the solution?<\/p>\n<p>In my opinion, JavaScript in general should be minimal.  99.9% of what needs to be done for any web application can be done with jQuery, underscore, jQueryUI, and not a lot of it.  I don&#8217;t believe you should ever be writing more than what you can copy paste directly from the jquery documentation. And you can replace &#8220;jquery&#8221; with any major js library.  Don&#8217;t go outside of what the library was designed for, you really don&#8217;t need it most of the time.  Really.<\/p>\n<p>Maybe I should update this to be more about how JavaScript Frameworks are the trap, but it doesn&#8217;t matter if you&#8217;re using a framework or not, the more you write, the shittier it becomes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Note: opinion JavaScript is the most important part of web development. It&#8217;s what separates web applications from a collection of web pages. The trap is one that I&#8217;ve fallen into multiple times and I&#8217;ve seen other developers fall into, unable to help them. They have these grandiose ideas and the way they see it working [&hellip;]<\/p>\n","protected":false},"author":4571,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17295],"tags":[111293,63973],"class_list":["post-262","post","type-post","status-publish","format-standard","hentry","category-javascript","tag-javascript","tag-jquery-2"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/users\/4571"}],"replies":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/comments?post=262"}],"version-history":[{"count":5,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/262\/revisions"}],"predecessor-version":[{"id":265,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/262\/revisions\/265"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/media?parent=262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/categories?post=262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/tags?post=262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}