<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Loosely Typed in Ohio &#187; Software</title>
	<atom:link href="http://www.innova-partners.com/blog/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.innova-partners.com/blog</link>
	<description>Innova Partners, software, networking, and websites.</description>
	<lastBuildDate>Wed, 20 Apr 2011 15:11:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GitHub Saves The Day</title>
		<link>http://www.innova-partners.com/blog/2009/07/31/github-saves-the-day/</link>
		<comments>http://www.innova-partners.com/blog/2009/07/31/github-saves-the-day/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 15:35:44 +0000</pubDate>
		<dc:creator>Jon Canady</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[grackle]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twitter-async]]></category>

		<guid isPermaLink="false">http://www.innova-partners.com/blog/2009/07/31/github-saves-the-day/</guid>
		<description><![CDATA[In the dark times (a few years ago) if Innova decided to make use of a third-party library that had bugs, we essentially had three options:


App-specific workarounds: sometimes feasible, sometimes not
Local modifications: wherein we dork around with the library code on our end, fix the bugs, and then maintain our own separate branch of the [...]]]></description>
			<content:encoded><![CDATA[<p>In the dark times (a few years ago) if Innova decided to make use of a third-party library that had bugs, we essentially had three options:</p>

<ol>
<li><strong>App-specific workarounds</strong>: sometimes feasible, sometimes not</li>
<li><strong>Local modifications</strong>: wherein we dork around with the library code on our end, fix the bugs, and then maintain our own separate branch of the library. These made merging in new changes from upstream <em>fun</em> (in that <em>why was I programmed to feel pain</em> kind of way).</li>
<li><strong>Find/Write a replacement</strong>: You&#8217;d be shocked at how often we didn&#8217;t do this. Or, alternatively, underestimated how difficult a particular issue is.</li>
</ol>

<p>In the last few weeks alone, GitHub&#8217;s changed that.  Now, the libraries I want are on GitHub as rubygems or PHP tarballs or what have you.  And when we encounter issues, the process is <em>smooth</em>:</p>

<ol>
<li>Fork project.  GitHub has a button for this.</li>
<li>Get our fork, make local changes, commit and push up to GitHub.</li>
<li>Send a &#8220;pull request&#8221; to the original author to let them know we have patches that they may want.  GitHub has a button for this.</li>
</ol>

<p><a href="http://github.com/joncanady">My contributions</a> are available for whoever wants them.</p>

<p>Now, if the original project checks in a few bugfixes I want, I can cleanly merge them in <em>and</em> keep my local fixes. And if upstream wants my fixes for the &#8220;canonical&#8221; repository for a project, then they&#8217;re welcome to them whenever they like.  Git makes the magic happen, and GitHub makes the magic ridiculously easy.</p>

<p>How the hell did we develop software before this?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.innova-partners.com/blog/2009/07/31/github-saves-the-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Undoing Commits in Git</title>
		<link>http://www.innova-partners.com/blog/2009/03/04/undoing-commits-in-git/</link>
		<comments>http://www.innova-partners.com/blog/2009/03/04/undoing-commits-in-git/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 15:18:47 +0000</pubDate>
		<dc:creator>Jon Canady</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[commits]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.innova-partners.com/blog/2009/03/04/undoing-commits-in-git/</guid>
		<description><![CDATA[Some days, more than others, I love having moved to Git.

Kent had pulled some changes from our central git repository to a staging environment.  These changes weren&#8217;t tested very well in IE6, so he wanted to remove them entirely from the staging environment.  In Subversion, we&#8217;d have done something like svn update -r120 [...]]]></description>
			<content:encoded><![CDATA[<p>Some days, more than others, I love having moved to Git.</p>

<p>Kent had pulled some changes from our central git repository to a staging environment.  These changes weren&#8217;t tested very well in IE6, so he wanted to remove them entirely from the staging environment.  In Subversion, we&#8217;d have done something like <code>svn update -r120</code> if we were on revision 121.</p>

<p>After a little digging – Kent says I only roll 3d20 for Source Control now, because we&#8217;re <em>geeks</em> – I found that Kent could go into the staging environment and do <code>git reset --hard HEAD^</code>; that is, revert everything in this repository to the state it was in one commit before the current HEAD.  Then, after making a second commit from dev and pushing it, we can do a normal <code>git pull</code> and it will fast-forward us to the new commit.</p>

<p>So <em>this</em> isn&#8217;t much different from Subversion so far.  What you <em>can</em> do that SVN explicitly is designed to <em>not</em> let you do, is use that in your dev environment.  If you haven&#8217;t yet pushed the changes to a remote repository, you can willy-nilly undo commits you&#8217;ve made.</p>

<p>Did you accidentally add and commit a file that shouldn&#8217;t be in the repository at all?  <code>git reset --hard HEAD^</code>, just like before.  Did you commit a little prematurely?  <code>git reset HEAD^</code>, which does a <em>soft</em> reset, which leaves all the changes intact but removes them from the repository like they were never committed.</p>

<p>Put <em>that</em> in SVN&#8217;s pipe and smoke it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.innova-partners.com/blog/2009/03/04/undoing-commits-in-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In PHP, Bugs Aren&#8217;t Bugs</title>
		<link>http://www.innova-partners.com/blog/2009/01/29/in-php-bugs-arent-bugs/</link>
		<comments>http://www.innova-partners.com/blog/2009/01/29/in-php-bugs-arent-bugs/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 18:55:18 +0000</pubDate>
		<dc:creator>Jon Canady</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.innova-partners.com/blog/2009/01/29/in-php-bugs-arent-bugs/</guid>
		<description><![CDATA[Today is 29 January 2009.  Ask someone today what next month is.  

Their answer is &#8220;February&#8221;.

Ask PHP:  print date('m/d/Y', strtotime('next month'));  (In english: PHP, please give me a date that looks like MM/DD/YYYY for next month.)

03/01/2009 (1 March 2009)

As it turns out, like all things with computers, you&#8217;re asking it wrong. [...]]]></description>
			<content:encoded><![CDATA[<p>Today is 29 January 2009.  Ask someone today what next month is.  </p>

<p>Their answer is &#8220;February&#8221;.</p>

<p>Ask PHP:  <code>print date('m/d/Y', strtotime('next month'));</code>  (In english: PHP, please give me a date that looks like MM/DD/YYYY for next month.)</p>

<p><code>03/01/2009</code> (1 March 2009)</p>

<p>As it turns out, like all things with computers, you&#8217;re asking it wrong.  You <em>should</em> write <code>print date('m/d/Y', strtotime(date('Y-m') . '-01 next month'))</code> which is a convoluted way of saying &#8220;Give me a date, MM/DD/YYYY, for next month calculated from the first of this month.&#8221;</p>

<p>Okay, but this is a <em>bug</em>, right?  I mean, php has a <a href="http://php.net/strtotime"><code>strtotime()</code></a> function <em>for the purpose of</em> letting people write english statements and parsing them into real time values, and it&#8217;s acting incorrectly.</p>

<p><em>Wrong-o.</em></p>

<p>According to the PHP devs on <a href="http://bugs.php.net/bug.php?id=33013">numerous</a> <a href="http://bugs.php.net/bug.php?id=43999">occasions</a> this is purely correct behavior, and they even cite the <a href="http://www.gnu.org/software/tar/manual/html_node/tar_113.html">GNU date format documentation</a> as proof: </p>

<ul>
<li>PHP says &#8220;add one to the month on the date you gave us&#8221;</li>
<li>You get 31 Feb 2009</li>
<li>PHP says &#8220;that doesn&#8217;t exist!&#8221; and rolls it up to the next available real date, 1 March 2009</li>
</ul>

<p>Except <em>this is bullshit</em>.  </p>

<p>By their own admission (in the second linked bug above), the PHP developers get a bunch of bug reports because this doesn&#8217;t work as expected.  Waving your hands and pointing at the GNU guys doesn&#8217;t make it okay, that&#8217;s passing the buck.  Pointing back at the PHP manual in your standard form reply to these doesn&#8217;t help either: the manual page for <code>strtotime()</code> mentions <em>nothing</em> of how it might not work the way you expect it to. </p>

<p><strong>Lesson to be taken away</strong>: if your users think it&#8217;s a bug, take a good look at it.  It might be a bug.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.innova-partners.com/blog/2009/01/29/in-php-bugs-arent-bugs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stop Asking Now</title>
		<link>http://www.innova-partners.com/blog/2008/12/23/stop-asking-now/</link>
		<comments>http://www.innova-partners.com/blog/2008/12/23/stop-asking-now/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 22:19:46 +0000</pubDate>
		<dc:creator>Jon Canady</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[empty]]></category>
		<category><![CDATA[Fail]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sucks]]></category>
		<category><![CDATA[trim]]></category>

		<guid isPermaLink="false">http://www.innova-partners.com/blog/2008/12/23/stop-asking-now/</guid>
		<description><![CDATA[I&#8217;m vocal about how PHP sucks.  I make no bones about it, and try to hasten the company&#8217;s move to better languages.  Occasionally I&#8217;m challenged on this.  I submit for your approval the following code:


    if (empty(trim($string)))


This will exert a Fatal Error every single time.  With a horrible [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m vocal about how PHP sucks.  I make no bones about it, and try to hasten the company&#8217;s move to <a href="http://python.org">better</a> <a href="http://ruby-lang.org">languages</a>.  Occasionally I&#8217;m challenged on this.  I submit for your approval the following code:</p>

<p><code>
    if (empty(trim($string)))
</code></p>

<p>This will exert a Fatal Error <em>every single time.</em>  With a <em>horrible</em> message: &#8220;Can&#8217;t use function return value in write context.&#8221;  </p>

<p>WTF?</p>

<p>Sympathizers: I know what you&#8217;re about to say.  <code>empty()</code> is a language construct that specifically looks at a <em>variable</em>.  You just have to assign the <code>trim()</code> result back to a variable first for this to work.  If you&#8217;d read the <a href="http://php.net/empty">manual entry for <code>empty()</code></a> you&#8217;d know that!</p>

<p><span style="background: black; color: black;">Fuck</span> that noise.  I don&#8217;t care if it&#8217;s <em>well documented</em>.  I don&#8217;t care that <em>technically speaking</em> the <code>empty()</code> construct can only check variables.  It does not <em>matter</em>.  This is <em>shit behavior</em>.  </p>

<p>Sympathizers: grow some <del>balls</del> backbone.  PHP <em>sucks</em>.  It&#8217;s okay to admit it.  Yeah, it has some redeeming value, else we wouldn&#8217;t be discussing it now.  But you&#8217;re letting the PHP developers get away with <em>murder</em> here.  </p>

<p>PHP Core Developers: Yes, the language you write powers a metric shit-ton of awesome businesses, Innvoa included.  That doesn&#8217;t give you a free pass to do <span style="background: black; color: black;">fucking</span> idiotic things like this.  <a href="http://www.hulu.com/watch/40678/saturday-night-live-update-freds-mapfix-it">Fix it!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.innova-partners.com/blog/2008/12/23/stop-asking-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tangible Rails Benefits</title>
		<link>http://www.innova-partners.com/blog/2008/12/10/tangible-benefits-of-ruby-rails/</link>
		<comments>http://www.innova-partners.com/blog/2008/12/10/tangible-benefits-of-ruby-rails/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 21:34:23 +0000</pubDate>
		<dc:creator>Jon Canady</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.innova-partners.com/blog/2008/12/10/tangible-benefits-of-ruby-rails/</guid>
		<description><![CDATA[We&#8217;re nearly to the launch of our first Rails application for our largest client, which means it&#8217;s about time for me to write a rah-rah style post about how awesome developing the application was.

First blood, so to speak, goes to a Facebook App Chad wrote in Rails, but this app is more of a classic [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re nearly to the launch of our first Rails application for our largest client, which means it&#8217;s about time for me to write a rah-rah style post about how <em>awesome</em> developing the application was.</p>

<p>First blood, so to speak, goes to a Facebook App Chad wrote in Rails, but this app is more of a classic pattern for Innova: we get some data from a client, import it into Microsoft SQL Server, and clean things up as we go.  These things don&#8217;t necessarily scream &#8220;Rails,&#8221; but she was up to the task nonetheless.</p>

<p>Coming from PHP development, there are several things that rocked my house as I was developing this app, things that our old Zend Framework or PHP simply couldn&#8217;t do:</p>

<ul>
<li><p><strong>script/console</strong> Being able to spawn an interactive session inside your application&#8217;s environment is ridiculously helpful.  I had the basic application logic finished the first day because I was able to fire up a console and run some quick ActiveRecord commands to see what worked.  And if something broke, I was able to fire up a console and start firing off commands and inspecting results.  Much quicker than the var_dump then die style of PHP development we were using.</p></li>
<li><p><strong>Plugins, esp. will&#95;paginate</strong> Rails plugins are drop-in chunks of code that give you functionality you didn&#8217;t have before.  In my case, I needed to paginate a set of database rows, which isn&#8217;t the most fun task.  After I installed will&#95;paginate, the work was done.  I had an easy way to get paginated results from my models, and a one-step way to generate the page selection HTML.  A lot of people cry about Ruby&#8217;s open classes, but things like this wouldn&#8217;t be possible otherwise.</p></li>
<li><p><strong>Routes</strong> In PHP, we had to write several library functions to generate URLs for our site, for use in HTML links.  Rails&#8217; built in named routes and <code>link\_to</code> helper meant I never had to write any kind of setup code beyond the initial route.</p></li>
</ul>

<p>That last one might seem like I&#8217;m really scraping the bottom of the barrel, but that&#8217;s just one example of a pattern I&#8217;ve noticed in Rails.  <code>link_to_unless_current</code> is another: \writing a function that either generates a link or some non-link text based on what page you&#8217;re on isn&#8217;t hard, but since almost every web application does this <em>you don&#8217;t have to write it.</em>  The number of times I&#8217;ve said something like &#8220;Crap, Rails has a built-in feature that handles that&#8221; or &#8220;oh, I just need this plugin, it takes care of it&#8221; is really astonishing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.innova-partners.com/blog/2008/12/10/tangible-benefits-of-ruby-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

