115 lines
6.9 KiB
HTML
115 lines
6.9 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html lang='en'><head><meta charset='utf-8' /><meta name='pinterest' content='nopin' /><link href='../../../../static/css/style.css' rel='stylesheet' type='text/css' /><link href='../../../../static/css/print.css' rel='stylesheet' type='text/css' media='print' /><title>Going Open Source / Steve Losh</title></head><body><header><a id='logo' href='https://stevelosh.com/'>Steve Losh</a><nav><a href='../../../index.html'>Blog</a> - <a href='https://stevelosh.com/projects/'>Projects</a> - <a href='https://stevelosh.com/photography/'>Photography</a> - <a href='https://stevelosh.com/links/'>Links</a> - <a href='https://stevelosh.com/rss.xml'>Feed</a></nav></header><hr class='main-separator' /><main id='page-blog-entry'><article><h1><a href='../../../entry/2009/1/13/going-open-source/index.html'>Going Open Source</a></h1><p class='date'>Posted on January 13th, 2009.</p><p>Well, I've finally taken the plunge and made this site open source. It's held
|
||
|
in a <a href="http://mercurial-scm.org/">Mercurial</a> repository, but you can view or download the source code
|
||
|
from <a href="http://bitbucket.org/sjl/stevelosh/">http://bitbucket.org/sjl/stevelosh/</a> without any special tools.</p>
|
||
|
|
||
|
<p>The site was built with the <a href="http://djangoproject.com/">Django</a> framework. If you want to know more
|
||
|
check out the <a href="https://stevelosh.com/projects/stevelosh-com">project page</a>. This post isn't going to duplicate what's
|
||
|
there; instead I want to write about why I made the site open source at all.
|
||
|
There are a couple of main reasons, and not <em>all</em> of them are selfish!</p>
|
||
|
|
||
|
<h2>I Get More Traffic</h2>
|
||
|
|
||
|
<p>The first reason to make a site open source is to try to get more hits. You
|
||
|
certainly don't <em>lose</em> any hits from doing it, and when developers find your
|
||
|
link on places like <a href="http://djangosites.org/">DjangoSites</a> they might be more inclined to visit if
|
||
|
they knew they could look at the source code later.</p>
|
||
|
|
||
|
<p>You also have the chance to post on <a href="http://twitter.com/">Twitter</a>, <a href="http://tumblr.com/">Tumblr</a>, or other places
|
||
|
about the source code of the site. Each of those posts can expose more people
|
||
|
to the website. It's easy to overdo this though. I heartily agree with the
|
||
|
sentiments of <a href="http://howtousetwitterformarketingandpr.com">howtousetwitterformarketingandpr.com</a> on that issue.</p>
|
||
|
|
||
|
<p>Don't worry, I won't be obnoxious about it.</p>
|
||
|
|
||
|
<h2>I Can Give Back to the (Programming) Community</h2>
|
||
|
|
||
|
<p>Yeah, I know. It sounds cliched, but it's true. </p>
|
||
|
|
||
|
<p>The open source community has produced a <em>ridiculous</em> amount of software, some
|
||
|
of which we use every day. Software like <a href="http://apache.org/">Apache</a>, <a href="http://djangoproject.com/">Django</a>, and countless
|
||
|
others simply wouldn't exist in anything remotely close to their current
|
||
|
forms.</p>
|
||
|
|
||
|
<p>Being able to look at the source code for a particular project can be
|
||
|
extremely helpful to someone trying to learn how to do something similar.
|
||
|
Instead of firing up an email client and sending a message to the creator they
|
||
|
can simply look at how it works themselves. They can download it, tweak it,
|
||
|
break it, and figure out what makes it tick. There's no substitute for that.</p>
|
||
|
|
||
|
<p>I strongly believe that the world would be a better place if everyone shared
|
||
|
their knowledge (in all fields) and we all learned from each other. In some
|
||
|
cases it's simply not practical, but more often than not I think people want
|
||
|
to horde their knowledge and feel superior. Sure, that might be nice for your
|
||
|
ego, but does it really make the world a happier, more beautiful place to
|
||
|
live?</p>
|
||
|
|
||
|
<h2>I Might Get Free Code!</h2>
|
||
|
|
||
|
<p>Well, probably not, but who knows? Maybe some developer has a lot of free time
|
||
|
on his or her hands?</p>
|
||
|
|
||
|
<p>Distributed version control systems like <a href="http://mercurial-scm.org/">Mercurial</a> make it extremely easy
|
||
|
to help out with open source projects. For example, if you were looking
|
||
|
through my code and saw a bug that you wanted to fix, you could do the
|
||
|
following:</p>
|
||
|
|
||
|
<ul>
|
||
|
<li>Clone the repository to your own machine.</li>
|
||
|
<li>Fix the bug in that local copy, committing to your local repository as you
|
||
|
go.</li>
|
||
|
<li>Go back to the website and click the "Pull Request" button.</li>
|
||
|
<li>I review the changes.</li>
|
||
|
<li>If I like them I press a button to merge them into the main repository.</li>
|
||
|
</ul>
|
||
|
|
||
|
<p>Once the changes are in the main repository I just run a single script to
|
||
|
redeploy the site as usual and the changes are live. It's really an almost
|
||
|
painless process. Compare that to something like Subversion or (ick) CVS:</p>
|
||
|
|
||
|
<ul>
|
||
|
<li>Check out the repository to your own machine.</li>
|
||
|
<li>Fix the bug in that local copy, without committing (don't mess up!).</li>
|
||
|
<li>Create a patch using diff or something similar.</li>
|
||
|
<li>Email me the patch.</li>
|
||
|
<li>I review the changes.</li>
|
||
|
<li>If I like them I check out a fresh copy of the repository.</li>
|
||
|
<li>I apply the patch to this copy.</li>
|
||
|
<li>I merge the patch back into the main repository.</li>
|
||
|
</ul>
|
||
|
|
||
|
<p>It's much more difficult because I don't want to just give any anonymous
|
||
|
person commit access to my repository.</p>
|
||
|
|
||
|
<h2>It Makes Me Fix My Damn Code</h2>
|
||
|
|
||
|
<p>This is probably the most tangible and important benefit of my open sourcing
|
||
|
this site. It forced me to rewrite parts of the code that weren't secure and
|
||
|
do it the right way.</p>
|
||
|
|
||
|
<p>Passwords stored in source control? Yeah, <em>definitely</em> a bad thing.</p>
|
||
|
|
||
|
<p>Of course, it <em>was</em> kind of a pain in the ass to refactor a bunch of stuff.
|
||
|
Really, though, the main problem I had was my own procrastination and going
|
||
|
open source was a good nudge. Plus when I start work on another site I'll know
|
||
|
how to do it right the first time.</p>
|
||
|
|
||
|
<p>Aside from major security and privacy issues, it also gives me a big incentive
|
||
|
to clean up my code and make it more elegant. Clean, elegant code makes me
|
||
|
happy. It's less likely to have bugs (because there are fewer places for them
|
||
|
to hide) and it's far easier to maintain in the long run.</p>
|
||
|
|
||
|
<p>It's also simply more fun to read and work with.</p>
|
||
|
|
||
|
<h2>You Should Probably Try It</h2>
|
||
|
|
||
|
<p>Obviously not all software is appropriate for open sourcing, but if you've got
|
||
|
a pet project that you've been working and you think it might benefit from a
|
||
|
few more sets of eyes, try it!</p>
|
||
|
|
||
|
<p>You don't need to spend money or configure much of anything to share your
|
||
|
code; sites like <a href="http://bitbucket.org/">BitBucket</a> and <a href="http://github.com/">GitHub</a> offer free hosting and great
|
||
|
interfaces for repositories of open source code.</p>
|
||
|
|
||
|
<p>If you have any questions or comments I'd love to hear them!</p>
|
||
|
</article></main><hr class='main-separator' /><footer><nav><a href='https://github.com/sjl/'>GitHub</a> ・ <a href='https://twitter.com/stevelosh/'>Twitter</a> ・ <a href='https://instagram.com/thirtytwobirds/'>Instagram</a> ・ <a href='https://hg.stevelosh.com/.plan/'>.plan</a></nav></footer></body></html>
|