<?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>DEV_MEM.dump_to(:blog) - Multimedia systems blog &#187; Advice Series</title>
	<atom:link href="http://blog.mmediasys.com/category/advice-series/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mmediasys.com</link>
	<description>Compartiendo fragmentos de código con el mundo.</description>
	<lastBuildDate>Thu, 29 Jul 2010 16:32:42 +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>GUAS: Giving Unwanted Advice Series #2</title>
		<link>http://blog.mmediasys.com/2008/12/29/guas-giving-unwanted-advice-series-2/</link>
		<comments>http://blog.mmediasys.com/2008/12/29/guas-giving-unwanted-advice-series-2/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 01:42:45 +0000</pubDate>
		<dc:creator>Luis</dc:creator>
				<category><![CDATA[Advice Series]]></category>

		<guid isPermaLink="false">http://blog.mmediasys.com/?p=105</guid>
		<description><![CDATA[Hello everybody. Today is time for another Advice Series post.
On previous article I&#8217;ve focused mainly on cross-platform things, and for that purpose, I&#8217;ve released rake-compiler
This time, I&#8217;ll focus in attitudes instead of code, and how these affect the public image of your projects.

Attitude and project image
Again, because you&#8217;re working on a OSS, it has a [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everybody. Today is time for another Advice Series post.</p>
<p>On <a href="http://blog.mmediasys.com/2008/10/21/guas-is-giving-unwanted-advice-series-1/">previous article</a> I&#8217;ve focused mainly on cross-platform things, and for that purpose, I&#8217;ve <a href="http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/405254349ea7506f">released</a> <a href="http://github.com/luislavena/rake-compiler">rake-compiler</a></p>
<p>This time, I&#8217;ll focus in attitudes instead of code, and how these affect the public image of your projects.</p>
<p><span id="more-105"></span></p>
<h4>Attitude and project image</h4>
<p>Again, because you&#8217;re working on a <acronym title="Open Source Software">OSS</acronym>, it has a public image &#8212; even if you don&#8217;t want it &#8212; so don&#8217;t be narrow-minded and say <em>I don&#8217;t care</em>, because <strong>you should</strong>.</p>
<h4>Keep all your users aware of the changes</h4>
<p>I can start this with a <em>mea culpa</em><sup class="footnote"><a href="#fn1">1</a></sup>. While working on <acronym title="Open Source Software">OOS</acronym>, you need to keep everyone that uses or contributes to the project aware of the changes.</p>
<p>Why? because a change introduced can break lot of development or production environments, not to say take away the joy of using Ruby at all!</p>
<p>I said <em>mea culpa</em>, because I neglected One-Click Installer (read <a href="http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/168dfea4bb153858/">ruby-talk post</a>). I&#8217;ve released second candidate and commented the current situation why there wasn&#8217;t a new release <a href="http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/5c5a2e718a3ae8bd">here</a></p>
<p>Now I realize how important is keep your users up to date on what&#8217;s happening with the projects that affect their work.</p>
<p>Why I&#8217;m saying all this? Because the <em>new trend</em> is do announces on Twitter, even when you&#8217;re subscribed to the <strong>devel</strong> mailing list of the project&#8230; you need to stalk the project developers to get news.</p>
<p>Of course, you can avoid all this spending 4 to 8 hours a day on #IRC channels, where most of the big and compatibility breaking changes are introduced and decided.</p>
<p>Just to give you an examples&#8230;</p>
<h5>Merb</h5>
<p>Previous release of 1.0, most of the 0.9.x versions included release notes with changes. Proof is here for <a href="http://groups.google.com/group/merb/browse_thread/thread/784c0524fefdfa7c">0.9.5</a><br />
, <a href="http://groups.google.com/group/merb/browse_thread/thread/72206b2fb82a6c56">0.9.6</a>, and <a href="http://groups.google.com/group/merb/browse_thread/thread/ec6c51bef7508448">0.9.7</a>, but seems that ended there, with no announce for 1.0 (Final or release candidates). Even no changes that you can see on <a href="http://rubyforge.org/frs/shownotes.php?group_id=2383&amp;release_id=29910">RubyForge</a>.</p>
<p>This is something I&#8217;ve commented to the developers several times and keep poking them about it, as I commented on <a href="http://yehudakatz.com/2008/11/23/10-spec-change/">this blog post</a> about something will change in new release that wasn&#8217;t announced in the mailing lists (neither users or devel one). But guess has no effect, since release announcements happens on Twitter mostly: <a href="http://twitter.com/merbivore/status/1059937589">here</a>, <a href="http://twitter.com/merbivore/status/1060326628">here</a>, and <a href="http://twitter.com/merbivore/status/1061323058">here</a></p>
<p>Taking in consideration all that background, no head&#8217;s up any of the releases release were announced (at least not on the mailing list I&#8217;m subscribed to), so I couldn&#8217;t test all these cross platform things beforehand.</p>
<h5>Sqlite3-ruby</h5>
<p>There was a pair of messages on Twitter (tweets?) requesting help on getting sqlite3-ruby project working on Windows (<a href="http://twitter.com/jamis/statuses/1043062398">here</a> and <a href="http://twitter.com/jamis/statuses/1047308969">here</a>). Again, you should be stalking that user and of course, have the time to read all these tweets.</p>
<p>Anyway, I left my <acronym title="Point of View">POV</acronym> in the comments of his blog <a href="http://weblog.jamisbuck.org/2008/12/7/sqlite3-ruby-windows-builds/">here</a> and proof of my results in my sqlite3-ruby fork <a href="http://github.com/luislavena/sqlite3-ruby/tree/master">here</a></p>
<p>A quick resume of this: sqlite3-ruby 1.2.4 was released, with <a href="http://rubyforge.org/frs/shownotes.php?group_id=254&amp;release_id=25302">this</a> release notes:</p>
<blockquote><p>This release only updates the generated C file to reflect the compatibility changes that were made to the <span class="caps">SWIG </span>file. Binary builds (e.g., Windows) are not affected, and need no update. In general, you will not need this update unless you are using a version of Ruby prior to 1.8.6. </p>
</blockquote>
<p>The thing is that any new gem release will affect <code>gem update</code>, so if no binaries for Windows exist for <strong>1.2.4</strong>, Windows users will installation errors, like the ones listed <a href="http://stackoverflow.com/questions/43778/sqlite-ruby-gem-failed-to-build-gem-native-extension">here</a></p>
<p>As I left on blog the comments, I&#8217;m not against on a developer dropping the support for a platform (humans beings are really hard to please).</p>
<p>I suck at release management <strong>too</strong>, as I mentioned when started this article, but a small blog post with a head&#8217;s up or quick announcement will not hurt anyone, right?</p>
<p>Anyway, if you want to automate the news announcement to RubyForge, take a look at <a href="http://github.com/luislavena/rake-compiler/tree/master/tasks/news.rake">this</a> (look ma, no Hoe, Echoe or anything, just plain Ruby!).</p>
<h5>DataMapper</h5>
<p>DataMapper suffered from <em>gemitis</em> like Merb (too many gems to release each time), so verify all those moving parts on every release is time consuming.</p>
<p>I&#8217;ve shared my comments on this on Lighthouse and the mailing list, and also contributed back some patches for a project I currently don&#8217;t use.</p>
<h4>My take (my conclusions)</h4>
<p>You can agree or agree to disagree with me on this, is up to you.</p>
<p>I&#8217;ve spent up to 10 hours of <acronym title="Quality Assurance">QA</acronym> per each release of One-Click Installer, because I care not to break stuff (and that&#8217;s why I do RC instead of final versions).</p>
<p>I came from a industry (broadcast video) were all those mistakes cost thousand of dollars per second since they play back advertisements. The systems must be running 24&#215;7 or they loose money.</p>
<p>Those are not pet projects anymore, and as such they should invest time on structure instead of hacking a new cool functionality and tweet about it.</p>
<p>Performing a <code>gem update</code> hurts all, they are silently releasing stuff into Rubyforge which is the default gem repository for users. The funny thing is that I&#8217;m not talking just for Windows users, but Jruby too.</p>
<p>The problem is not technology or a platform limitation, is people.</p>
<p>People said that I&#8217;m a whiner, I just rant out loud and do nothing&#8230;</p>
<p>Well, when you try to something and people doesn&#8217;t care, no matter how much you do, never will be enough.</p>
<p class="footnote" id="fn1"><sup>1</sup> Wikipedia article about <a href="http://en.wikipedia.org/wiki/Mea_culpa">mea culpa</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mmediasys.com/2008/12/29/guas-giving-unwanted-advice-series-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>GUAS: Giving Unwanted Advice Series #1</title>
		<link>http://blog.mmediasys.com/2008/10/21/guas-is-giving-unwanted-advice-series-1/</link>
		<comments>http://blog.mmediasys.com/2008/10/21/guas-is-giving-unwanted-advice-series-1/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 00:15:16 +0000</pubDate>
		<dc:creator>Luis</dc:creator>
				<category><![CDATA[Advice Series]]></category>

		<guid isPermaLink="false">http://blog.mmediasys.com/?p=85</guid>
		<description><![CDATA[Hello everybody, I&#8217;ll like to start a new category of post on this site: GUAS.
The subtitle of these series will be how not to be dumbass while being cross-platform friendly.
With this series, I&#8217;ll like to bring what I&#8217;ve learned using a not so popular platform and how to properly interact with others, without being a [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everybody, I&#8217;ll like to start a new category of post on this site: <acronym title="Giving Unwanted Advice Series">GUAS</acronym>.</p>
<p>The subtitle of these series will be <em>how not to be dumbass while being cross-platform friendly</em>.</p>
<p>With this series, I&#8217;ll like to bring what I&#8217;ve learned using a not so popular platform and how to properly interact with others, without being a dumbass, obtuse or something similar.</p>
<p><span id="more-85"></span></p>
<h4>Hard coded paths</h4>
<p>The year is 2008, 2009 is around the corner and I keep seeing people sharing scripts, building libraries for others (distributed as <a href="http://rubygems.org/">gems</a> or recipes) still hard code paths in those.</p>
<p>We are not just talking about Windows with drive letters, but also these scripts break between distributions&#8230; change something from <code>/usr/bin</code> to <code>/usr/local/bin</code> and boom. I&#8217;ve seen that happen.</p>
<p><strong>Never assume all the other users have your same OS distribution</strong> (hey, they could not have the same OS brand, kernel or whatever).</p>
<h4>Was &#8216;which&#8217; or &#8216;where&#8217;?</h4>
<p>Trying to find something? Did you succeed? Sure? try again, but now on other distro. I found myself under some distros that lack <code>which</code> and instead provided something called <code>where</code> (couldn&#8217;t remember the distro name right now).</p>
<p>In my job (video broadcasting) we tend to never assume your environment, never trust on it since it could fail, and when it fails your company loose piles of money.</p>
<p>Until I found this issue, always relied on this functionality. When switched back to Windows, found there was no <code>where</code>, neither <code>which</code>, so I found myself in a complicated situation, my next point will add a picture for you.</p>
<p>Almost everything that is done with pure Ruby can be done on Windows, the few cases it couldn&#8217;t, need to be handled properly.</p>
<p>Like on previous example, there is no <code>which</code> functionality on Windows. You can rely on <code>PATH</code> or you can split <code>ENV['PATH']</code> and perform the search in Ruby code, at the end, both do the same, right?</p>
<p><strong>Wrong</strong>. Doing <code>`which ruby`.chomp</code> could look right, but it&#8217;s an expensive call. Every time you call it a new environment is spawned where bash/tsh/sh is executed and the output is captured. This context switch can be expensive, more if done several times in the life cycle of your application.</p>
<p>Maybe not clear enough:</p>
<p><script src="http://gist.github.com/18458.js"></script></p>
<p>I know, I&#8217;m such a freak when talking about performance&#8230;</p>
<p>Even if run it just 1 time, is more portable, don&#8217;t you think?</p>
<h4><span class="caps">RUBY</span>_PLATFORM, To regexp, or not.</h4>
<p>Under certain circumstances, you want to exclude something for being executed under some platforms, for example: Windows.</p>
<p>One way to do it is ask the OS about your platform&#8230; <strong>wrong</strong>, this is like relying on OS specifics, as mentioned in previous point.</p>
<p>I&#8217;ve seen too many <code>`uname -a`...</code> in such useless ways&#8230; when they should have relied on <code>RUBY_PLATFORM</code> instead.</p>
<p>It is your friend, let me show you&#8230;<br />
<script src="http://gist.github.com/18481.js"></script></p>
<p>So subtle, but so simple change that just <em>skip</em> all the platform specific stuff if no <code>darwin</code> platform is found.</p>
<p>Another nice detail that noone cares about is that relying in system calls breaks cross-compilation.</p>
<p>For example, using MinGW on <span class="caps">WINE </span>to target Windows will be useless if you rely on system calls instead of <code>RUBY_PLATFORM</code></p>
<p>So, play nice with others, you can do it.</p>
<h4>Bundling platform specific files (that includes binaries).</h4>
<p>Bundling share libraries, <code>.so</code> files or even <code>.dll</code> can turn the end-user life a nightmare. I remember a while back when some gem developers released a gem with a pre-built <code>Makefile</code>&#8230;</p>
<p>Yeah, just a <code>Makefile</code>, a simple text file that was not automatically regenerated during gem installation and caused lot of pain to many Linux users (since the gem was built on <span class="caps">OSX </span>and was pointing to wrong paths, wrong extensions for the shared libraries&#8230;)</p>
<p>Those files should be excluded from your repositories. Adding those warrant you that doing multi-platform gem releases will became a issue (cross-compilation and such) and also will add noise to mailing list from people asking for support since these extensions cannot be loaded by their Ruby interpreter. </p>
<p>Go figure something so simple can cause that amount of pain.</p>
<h4>Disclaimer</h4>
<p>No developer, neither Windows, Linux or <span class="caps">OSX </span>was injured during the creation of this post. Please use my comments for good, not for evil.</p>
<p>You can consider this series of articles as rant, or consider them as what they are: advice.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mmediasys.com/2008/10/21/guas-is-giving-unwanted-advice-series-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
