Old and Busted?

After writing my previous blog post, I got to thinking about why I still use SnakeSkin for personal projects.

It's a valid question. Sure, I had three years of experience with it and I've adapted to its way of thinking. I have a good Linux VPS host, so it's a perfect fit for me. But you can argue that it doesn't do a lot of things that other frameworks do. In fact, lack of community support is probably one of its biggest weaknesses.

Or is it? My website works just fine. It does everything I want it to do for the moment, and it's very possible to add new functionality (I converted my photos section to pull data from Flickr yesterday). Using a framework that has a lot of community support wouldn't necessarily help me at this point. Actually, when I got to thinking about it, it seems like it would merely increase my signal-to-noise ratio.

Let's say I was using ASP.NET. Microsoft has been really good about releasing new features--we just recently saw the launch of .NET 3.5 SP 1, for example. If my website were written in .NET 2.0, I'd be feeling pretty old and busted right now.

I mean, I need to upgrade to .NET 3.5 to get that sweet routing engine!

    page_classes = {
        'sitemap.xml'       : forms.google_sitemap.GoogleSitemap,
        'sitemap.xml.gz'    : forms.google_sitemap.GoogleSitemap,
        'index.html'        : forms.blog.BlogSummaryForm,
        'photos/index.html' : forms.photos.PhotosForm,
        'register/index.html'   :forms.user_registration.UserRegistrationForm,
    }

    regex_mapping = (
        ('^rss/(.*)$',                                  rss_feeds.RSSFeedForm),
        ('^photos/(.*?)/(.*?)/index.html$',             forms.photos.PhotosForm),
        ('^photos/(.*?)/index.html$',                   forms.photos.PhotosForm),
        ('^([^/]+?)/index.html$',                       forms.blog.BlogListingForm),
        ('^([^/]+?)/(\d+)/index.html$',                 forms.blog.BlogPostForm),
        ('^([^/]+?)/create/blog/index.html',            forms.blog.BlogPostForm),
        ('^([^/]+?)/create/page/index.html',            forms.defined.DefinedContentForm),
        ('^([^/]+?)/(.+)$',                             forms.defined.DefinedContentForm),
    )

    # Page for which we have an associated class
    c = db.cursor()
    if page in page_classes.keys():
        app.register_page(page, page_classes[page](page))
    else:

        for (page_regex, page_class) in regex_mapping:
            m = re.match(page_regex, page)
            if m:
                app.register_page(page, page_class(page, *m.groups()))
                break
        else:
            app.register_page(page,forms.default.DefaultForm(page))

And if I'm not using LINQ to SQL, I'm going to have some horribly messy data access code, with SQL queries stuck all over my codebehinds!

        blog_table = models.BlogTable(ctx.request.db, ctx.request.auth.authorized and ctx.request.auth.user['auth_id'] or 0)

        ctx.locals.Paging = site_lib.Paging( ctx.locals.current_page, blog_table.get_record_count(locked_filter=locked_filter) )
        ctx.locals.Paging.change_page(ctx)
        ctx.locals.BlogPosts = blog_table.get_record_list(limit=ctx.locals.Paging.get_sql_limit(),
                                                          offset=ctx.locals.Paging.get_sql_offset(),
                                                          locked_filter=locked_filter)

Don't forget that I need good AJAX support!

And gorrammit, my website is nothing if it isn't in the cloud!

OK, that's enough sarcasm for now. I'm not saying my code is perfect, or that these trends hitting ASP.NET don't matter, or that I was ahead of the curve anywhere along the line. And I'm certainly not saying we all need to live like hermits--especially when it comes to code that isn't a personal project. (Imagine trying to find someone else to maintain my SnakeSkin/Python-powered blog.) But what I am saying is that I find all this bleeding edge stuff somewhat tiring. I don't really have fun hacking around with new stuff unless there's a point to it--I'm happiest when I'm producing something useful, stable, maintainable, and polished.

So .NET is a great choice for a work environment, where I may have to reuse libraries or work with an industry-standard platform. And I'm sure there are a number of "better" web frameworks out there (depending on how you define better: support, maintainability, strict adherence to design patterns, etc.). And in both cases, you can do some pretty awesome stuff with the wealth of libraries and the new stuff that's being released--of course, that's assuming you actually need to use it. (That last part is important. I look at things like Azure and Live Mesh and I see extremely useful technologies--but I also see technologies that people are going to shoehorn into so many applications where they're not really needed, just because they're the new hotness.)

At some point, you have to separate yourself from the kool-aid and the cult of personality and the horrible feeling that you're not up to snuff because you don't use [insert hip technology here], and realize that good enough really is by definition good enough*. And if you don't have the willpower to stop excessively worrying about it on your own volition, then there are ways to deal with it indirectly.


* I picked up this phrase at DevLink, and now I can't stop saying it. I use it partly as a joke (at least I hope I do), because it seems programmers these days are all about mantras like this. Yes, I realize that if someone else were using it as much as I have, I would be a little annoyed and burnt-out on it. Then again, I actually do like it: it speaks directly to the nagging feeling I have (and it's not just limited to my career) that whatever I do is never quite good enough.

Comments

Good enough

No, you are right on - any change made based on technology alone is a bad one. I wrote my blog in .Net because a) didn't have a blog and b) wanted to get more experience with .Net.

LINQ to SQL is dead btw, EF killed it. Alas, poor L2S, we hardly knew ye!

Yeah.

The main reason for the blog post isn't that I wrote this site in SnakeSkin--I was still using that professionally when I originally coded it. The real reason is that most of my newer projects--Chainsaw Buffet and Sakura Tees (a site for a friend's business, which I haven't even started on) are SnakeSkin, too.

But whether or not I rewrite in the latest .NET/Rails/PHP framework is sort of beside the point. The thing that I figured was really heretical about this blog post was the fact I kind of like using a framework with no community around it (or at least a community that I don't pay attention to). That means I focus on the task at hand rather than whether I'm using all the right methods/technologies/whatever. (The downside, obviously, is that many times I have to reinvent the wheel or accept that certain things won't have a Python library.)

I heard about LINQ to SQL. I don't know much about the Entity Framework, so I can't tell if that's a good or bad thing. Most of my exposure to it was via Shawn Wildermuth's talk at Alabama Code Camp (IIRC)--and his point was that LINQ to SQL was for quick-and-dirty projects while EF was time-consuming, but is really worth the time for more complicated long-term projects.

I met this guy yesterday that said he was a programmer. I simply assumed he was a C# guy and asked and he was actually embarrassed to admit he was a C++ developer! I was like... Holy crap! A C++ developer! How rad! And he was busy apologizing for not using C#. Craziness.

Craziness

I can understand your feelings there. It is easy to get caught up in the constant changes that are going on and one should avoid changing for the sake of change. Once you go down that route, it becomes a very slippery slope. (I have learned that one about 10 times over... lol)

In may case, I love to take on new ideas / techs but I do my very best to keep it in moderation or, at least, only where it makes sense. Obviously, my website is one giant bleeding edge, as I work to try out these new techs in a context that I know very well. This allows me to focus on the new stuff rather than implementation and new stuff, if that makes sense. Although I have a blog, my site is more of a way to have a production entity that I can play with as time allows.

In regards to your site, if it is not broke, don't fix it. Unless you have a purpose in changing you should keep what you have. Now, if it gets to the point where maintenance is long and hairy, hosting is hard to find, or new dev become difficult - that is the time for change.

In regards to Linq 2 SQL... it is not really "dead." I get irritated at this approach b/c it makes everyone start running for the hills, so hold your horses on reading about NHibernate. There is no reason to change any past development that was done w/ L2S. L2S is supported and will remain to be so. M$ is pushing to support the Entity Framework in the long scope and to make it have the same easy features that we see in L2S. To paraphrase their annoucement, "over the long run LINQ to SQL and LINQ to Entities will merge. In the mean time, development work on LINQ to SQL will not end entirely." Also, all L2S work should port rather easily. In fact, your LINQ queries can be used directly against the EF by simply changing the Data Context (assuming the same DB structure). Assuming that you approached L2S with some measure of OO techs, you should not have any worries either way... /end-rant ( Btw, I am fully aware that Mike was being broadly accurate / flippant in his post about L2S, which makes it unfair for me to respond in such a detailed manner, but it is a sore spot for me, lol )

Now, with all this being said, I think .Net is a viable choice for a framework when doing web dev. It, most likely, has the the highest ease of access. In other words, I would not recommend someone firing up Snakeskin for their new website unless they have direct reason to do so (such as being in a development shop that can benefit from rolling their own framework or having had previous experience).

@Gabriel - No joke! C++ devs rock. I have no clue why he would be embarrassed... Kudos to him and I had time to be in his place...

Definitely

Yeah, honestly, your rewrites are part of the reason I think this way. :) I'm not saying I want to rewrite my blog... I'm sort of justifying to myself why I'm still using Snakeskin Chainsaw Buffet or Sakura Tees. Which, as you point out, I wouldn't be using if I thought anyone else would be doing major work--I'd be using ASP.NET (Windows) or PHP (Linux). (In fact, this was one of the things I discussed with Charlie--I wanted to use CakePHP on Sakura Tees, but it got too time consuming to figure out all the little intricacies. That's when I realized that "making it accessible for another developer to replace me" was probably not high on the list of priorities since it's a small business site for a friend.)

But otherwise, it's a bit oppressive to worry more about whether I'm doing things the right way or using the right framework/technology/whatever, than it is to just do it. I'm finding the less I worry about that stuff, the more I like programming in my spare time.

You have to realize, the facade between what I actually think and what I present to the community/employers is very thin. I can't put forth the appearance of "passionate developer" that people seem to expect... well, not without actually being excited. And as everyone who reads this blog probably knows, I don't get excited about much (curse my innate tendency for balance and realism), so I sometimes think something must be wrong with me. Plus, too much of my self-worth is dependent on what I produce, so "not using the 'right' tools and methodologies" ends up translating to "not good enough" depending on what mood I'm in--but at the same time "hacking something together with stuff I don't fully understand yet" also translates to "not good enough."

... I may need to refactor my mind and add in some additional tiers there.