A Foolish Manifesto

fREWdiculous!

Chapter 7: Open Source

Some of you probably know that I have some opinions, thoughts, and ideas. I actually started this blog because I wanted to write my own (can you guess what?) Manifesto. I chose to write it as a blog because I tend to change my mind. Ask some of my friends and family. They have all observed that I was going to be a math teacher, a psychologist, a biological engineer, a doctor, and a writer. (Take note: I am none of those things.)

I started programming in earnest about 10 years ago, when I purchased Programming Perl. I had done some basic, but I knew that real programmers used perl. I knew I would never use any other language. 6 years later I turned my back on perl when a professor introduced me to ruby. While in ruby-land I learned functional programming, what MVC was, what an ORM is, and the beauty of syntax (I still dig 5.times {…}). I knew that Rails was the One True way to program websites and that Prototype and Scriptaculous were the only way to program javascript.

Then 4 years later someone offered to pay me to write perl. I came back somewhat grudgingly, and I came extremely close to trying to write a certain project with rails. Fortunately (for my current dogmatism) my boss convinced me to stick with perl. Somewhere along the line I learned that perl 6 is truly being developed. I helped some and had some fun. I read the book currently titled The Passionate Programmer. After reading it I decided to start seriously look into switching from IIS to Apache.

After setting up Apache on my personal computer so I could have a useful error log I started researching ORM’s. I found that The One True ORM of any given language is DBIx::Class. I will never use another ORM as long as I live. I have posted about it a few times now. I’ll leave that at that.

Larry Wall says that the three programming virtues are laziness, impatience, and hubris. I agree with his conclusions. The first two often lead to code reuse. Code reuse is an excellent goal. Code reuse is what keeps my current codebase nimble and exciting to work on.

Part of code reuse means using libraries to help you get your job done. Did I mention DBIx::Class? Yeah, it helps me get my job done. Now, when I first started getting paid to code I was told that in a professional context, we don’t waste our time reinventing the wheel. Agreed! Let us not reinvent the wheel.

So instead of reinventing the wheel, we’ll purchase a library that does the job for us find some Open Source library that does (or almost does) the job for us. Before I got further I’d like to make a few points about Open Source software. (Also, let me remind you that I am Holden Caulfield right now so I may be lying, on purpose or accident.)

I do not use Open Source software because I desire or need freedom. My political friends tell me that I am spoiled for saying that freedom is not the highest virtue and that I would not be willing to die for freedom. There are other virtues that I (hope) would be willing to die for, but that’s another chapter.

I do not use Open Source software because I am poor. I purchase indie video games because they are awesome works of art and they are not cheap. I donate to Open Source and otherwise free software that I regularly use because I am glad to pay for the excellent work that someone will do to make my job/life easier. I think that it is fine to ransom features as an Open Source programmer.

I do no use Open Source because I am a communist. There is no reason that a programmer should give you his time and effort for free. Let me redact that statement: there is no reason that a person should give you his time and effort for free. If you view me as a carbon offset to the earth and that everything I do should be given to the poor, that’s fine. We are all wrong sometimes. Let me be clear: I love Ayn Rand as a phiosophess and I agree with her unconditionally.

I use Open Source software because I am a programmer. Jeff Atwood says that “If it’s a core business function, write that code yourself, no matter what.“. I agree Jeff! The problem comes when you purchase an over-the-counter library, it suits your fancy perfectly, and then six months later, as always happens, the customer wants more. The library no longer works for you, so you either pay the Closed Source vendor to implement the features you need, or find another library and port all of your code to that.

This is what happens to me: I use an Open Source library that does what I need. I eventually outgrow it or it doesn’t meet a specific need, I either whine enough to get someone to add the feature I need, or I figure out how to add it myself. I’m not even a very good programmer; I just really like to program.

Let me put it another way: do you have any friends who really like to work on their car? Do they buy the brand new drive-by-wire automatic Toyota that is more black box than car?

This post is pushing up against the thousand word mark and we certainly wouldn’t want to go there, so I’ll repeat myself one more time: I am a programmer. I will continue to use Open Source software because I love to program and because I don’t want any Golden Handcuffs.

So programmers, ask and it will be given to you; seek and you will find; untar and the code will be opened to you. Suits: feel free to purchase black boxes as Golden Handcuffs. Thank you and have a nice weekend.

  • 3 Comments
  • Filed under: Uncategorized
  • Community Differences

    I watched this keynote from frozen perl this weekend and it was pretty great. There are plenty things to take from this presentation, but the thing I want to mention comes from slides 66-77. Consider that mandatory reading to understand this blog post.

    Now read this, this, and almost any of these.

    Caveat Lector: All of those links may be outliers. I am certainly not reading a statistically valid sample of The Webternet; so maybe just consider this some random observations from this random dude.

    Also: All of the above linked people are smarter and more motivated than I am. I would not criticize their intelligence in the least and their technical skills has my respect for sure. What have I done? A job? Helped move some books to people that needed them at school? Some stuff at a hospital? Compared to Rails, Mongrel, and Archeo- whatever. Compared to those guys I am nothing. Keep that in mind.

    I just think it is important that in the perl world we have keynotes where people say: “Be Excellent to Each Other.” People say that perl is dead. I disagree. You should see how many blog posts there are out there saying, “no, perl is not dead!” But I would much rather perl be dead than perl be a bunch of jerks.

    Basically this boils down to the difference between me and those other programmers. I think that our priorities should be:

    1. others
    2. ourselves
    3. everything else

    Even if you aren’t a Christian I still think that exactly that priority list matters: Code is useless without users. Maybe they think they are exceptions because they are the users. Fine. I just know that if I see Giles, Zed, or DHH in real life I will be like, “Wow, what a great coder! Probably don’t want to actually hang out with them for more than 10 minutes though…”

    Maybe I’m wrong though. Maybe the internet is just not a place for being nice. I just know that I am going to try to do my best to “Be Excellent to Each Other.”

  • 2 Comments
  • Filed under: community, perl
  • Using “Rails” wisdom in Perl

    Ok so that may be a sensational title, but really the point is this: Rails people talk a lot, perl people just get stuff done. I am ok with getting stuff done, but I don’t know how perl people do it because they don’t talk about it as much.

    Anyway, with that in mind my company (MTSI) is starting a new project next week. I get to be a big part of the planning and I am pretty excited. Normally our code is just perl scripts that use SQL and string interpolation or template toolkit. The use of TT is a big, fairly recent step forward. I recently turned a utilities file into a full on module, so that’s good too.

    But really we aren’t where we should be. The state of the art with web applications has moved forward significantly in the past few years (and I think a lot of that is because of some smart people that use rails,) and there is no reason that we cannot use this knowledge in perl.

    I originally looked at Catalyst, but decided against it because my boss thought it was a pretty big commitment for something none of us have experience with. So I decided to look at CGI::Application (which we used for TOME.)

    Before I get into that I just want to say that we have decided on DBIx::Class as an ORM. I looked at Rose::DB::Object but DBIx::Class just seems to have more polish and support. Plus they support SQL Server which we use (no comment.) DBIx::Class is fairly easy to use and next time I’m at work I’ll post a snippet of how to do various things we want to do.

    The main reasons I went with CGI::Application are these:

    1. It’s a fairly small framework, so easy to understand what’s happening.
    2. It will give us a better, more solid organization of our code.
    3. It will let us switch to mod_perl (from IIS…no comment.)

    The biggest issue with CGI::Application that I initially had was this: how can I have multiple controllers? In TOME we only had one controller but I think we should have had at least two, maybe three. Anyway, after some research I found this: Re: Re: Re: Why CGI::Application?. Basically he does what I thought that you are supposed to do, except with some excellent OO goodness.

    I was thinking that you would just have like, 5 CGI::Applications and those would be the controllers. Well, instead of that you have 5 CGI::Applications that subclass a main one which has basic functions (logging in etc) that all the other ones need. If a controller gets too big you either split it into a couple or you subclass it for a couple related controllers.

    Hopefully it goes as well in my mind as it should :-)

  • 1 Comment
  • Filed under: Uncategorized