{"id":241,"date":"2009-02-16T09:16:28","date_gmt":"2009-02-16T09:16:28","guid":{"rendered":"http:\/\/dev.gregbueno.com\/wp\/sakufu\/2009\/02\/16\/the_great_code\/"},"modified":"2009-02-16T09:16:28","modified_gmt":"2009-02-16T09:16:28","slug":"the_great_code","status":"publish","type":"post","link":"https:\/\/gregbueno.com\/sakufu\/2009\/02\/16\/the_great_code\/","title":{"rendered":"The Great Code Migration of 2009"},"content":{"rendered":"<p>After three years of building site after site, I crafted what would become my own web framework in 2003. I didn&#8217;t know such a thing was called a framework &#8212; to me, it was just a bunch of code I kept reusing, so I structured it in a fashion I learned on my first job as a web developer.<\/p>\n<p>I called that project <a href=\"http:\/\/vigilante.vigilantmedia.com\/\">Vigilante<\/a>. It&#8217;s a code base that&#8217;s powered every site I&#8217;ve built, including ones I&#8217;ve done for the office. As of today, Vigilante is officially retired.<\/p>\n<p>I spent the past week moving all my sites to <a href=\"http:\/\/codeigniter.com\/\">CodeIgniter<\/a> and <a href=\"http:\/\/jquery.com\/\">jQuery<\/a>. I&#8217;ve had a passing understanding of the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Model-view-controller\">Model-View-Controller pattern<\/a> for a while now, and I even toyed with <a href=\"http:\/\/rubyonrails.org\/\">Ruby on Rails<\/a> very briefly. I liked what Rails had to offer, but I&#8217;m at a point in my life where learning a new language just to use a new framework is a time sink in which I don&#8217;t want to invest.<\/p>\n<p>At the same time, I knew Vigilante was getting creaky, and a shift in my own personal priorities &#8212; i.e., away from coding all the damn time &#8212; made me reluctant to bring it up to speed.<\/p>\n<p>If I were to move to a framework, it would need to be one that would make the transition easy. So I did what I usually do when I&#8217;m stumped about something &#8212; I <a href=\"http:\/\/ask.metafilter.com\/\">asked MetaFilter<\/a>.<\/p>\n<p><!--more--><\/p>\n<p>I&#8217;d heard of <a href=\"http:\/\/cakephp.org\/\">CakePHP<\/a>, but I didn&#8217;t like how it seemed to preclude use of the <a href=\"http:\/\/www.smarty.net\/\">Smarty<\/a> template engine. I moved all my views to Smarty years ago, and I was unwilling to recode all those templates to a new engine. As feature-rich as Cake seemed to be, it felt a bit too much, and I could foresee hours of refactoring code to line up with Cake&#8217;s expectations. I needed something a bit more flexible.<\/p>\n<p>Another suggestion I encountered was <a href=\"http:\/\/codeigniter.com\/\">CodeIgniter<\/a>. In fact, it was <a href=\"http:\/\/ask.metafilter.com\/95185\/Its-a-piece-of-cake-to-bake-a-pretty-cake-if-the-way-is-hazy#1390975\">this comment<\/a> that got me curious. So I <a href=\"http:\/\/codeigniter.com\/download.php\">downloaded<\/a> the code, went through the <a href=\"http:\/\/codeigniter.com\/user_guide\/\">documentation<\/a> and got something working in lickety-split.<\/p>\n<p>What got me sold was the ability to move over a single application at work in a day.<\/p>\n<p>So I embarked on porting perhaps the biggest application I&#8217;ve made which no one else gets to use &#8212; the Vigilant Media administrative interface, which lets me manage the content of this site, as well as <a href=\"http:\/\/www.musicwhore.org\/\">Musicwhore.org<\/a>, <a href=\"http:\/\/www.austin-stories.com\/\">Austin Stories<\/a> and the <a href=\"http:\/\/www.eponymous4.com\/\">Eponymous 4<\/a> official site. I had the sense that if I could successfully move that site over the CodeIgniter, it would essentially prepare the move of the other sites.<\/p>\n<p>I was not mistaken.<\/p>\n<p>With the MVC pattern in place, I could effectively reuse the models between sites and built better libraries out of the old Vigilante code. Vigilante was not object-oriented, and it made maintenance tedious. With CodeIgniter, I was able to modularize that old code even further.<\/p>\n<p>It took about two months to get the Vigilant Media administrative interface done. The lion&#8217;s share was dealing with the Musicwhore.org interface. This past week, I moved all my other sites over. In the past, it would have taken me weeks to relaunch just <em>one<\/em> site. CodeIgniter allowed me to turn around <em>four<\/em> sites much more quickly.<\/p>\n<p>While CodeIgniter took care of the server side, <a href=\"http:\/\/jquery.com\/\">jQuery<\/a> handled the client-side. I&#8217;m no fan of JavaScript development, only because the DOM <em>is<\/em> frustration. It took a while for me to get a hang of jQuery, but when I did, I marvel at how I wish it were around sooner.<\/p>\n<p>I&#8217;m not doing anything spectacular with jQuery &#8212; no special effects &#8212; but the simple things I can do are that much easier. Perhaps what I like most about jQuery is stripping out events in the HTML markup. I&#8217;ve always found it cumbersome to put <tt>onclick<\/tt> or <tt>onsubmit<\/tt> attributes in my layout. jQuery lets the code handle that entirely.<\/p>\n<p>For a long time now, I&#8217;ve been kind of ambivalent about web development. It was just draining to develop both a framework and the sites that run it. I didn&#8217;t want to do it anymore. But I didn&#8217;t want the sites to die either.<\/p>\n<p>Moving to a framework has got me interested again, for now at least. It frees up a lot of time not having to worry about the inner workings of the engine. I can concentrate now on getting the proverbial destination instead.<\/p>\n<hr size=\"1\" width=\"50%\">\n<p>I still have to finish moving over the sites I built for the office.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As of today, Vigilante is officially retired.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6],"tags":[],"class_list":["post-241","post","type-post","status-publish","format-standard","hentry","category-technophilia-professional"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Bkjq-3T","_links":{"self":[{"href":"https:\/\/gregbueno.com\/sakufu\/wp-json\/wp\/v2\/posts\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gregbueno.com\/sakufu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gregbueno.com\/sakufu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gregbueno.com\/sakufu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gregbueno.com\/sakufu\/wp-json\/wp\/v2\/comments?post=241"}],"version-history":[{"count":0,"href":"https:\/\/gregbueno.com\/sakufu\/wp-json\/wp\/v2\/posts\/241\/revisions"}],"wp:attachment":[{"href":"https:\/\/gregbueno.com\/sakufu\/wp-json\/wp\/v2\/media?parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gregbueno.com\/sakufu\/wp-json\/wp\/v2\/categories?post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gregbueno.com\/sakufu\/wp-json\/wp\/v2\/tags?post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}