Brent Dax (brentdax) wrote,
Brent Dax

  • Mood:
  • Music:

Skill, knowledge, and time

It's been a long but interesting day. Most of it was spent writing the new Architechies guestbook script. (As you can tell, I asked some friends to put in a few entries; anyone I know is welcome to add an entry too. "Tatiana", btw, is really my sister Devonie, who was born in the same hospital I was, twenty minutes from here.) This script replicates one of my first major CGI projects, the (real) Lauren Royal guestbook.

The original guestbook was quite a project for me. It was two scripts, adding up to a total of 153 lines. Data storage was in a null-delimited file (non-geeks: the different pieces of data were separated by special characters). This file has been corrupted a few times in its life, mostly due to FTP mishaps, and a few entries have been lost--along with several hours spent manually editing the file. I cringe to think what might happen if someone entered a foreign character into it. I kludged something together to strip HTML out and preserve newlines, but it's not exactly something I like to think about over dinner. There's no duplicate entry handling.

The new guestbook is a single 97 line script. Well, not exactly--it's an Embperl script, which means that the HTML drives the page, not the Perl. It's backed by a MySQL database--that's industrial-strength. It recognizes six Asian encodings (all your encoding really are belong to us), along with three Unicode encodings and plain old ASCII. It converts characters to HTML entities when it needs to, and preserves spacing and newlines. It tries to stop the user from accidentally doubling an entry by setting a session variable--and if they do manage to get two entries into the database, the SELECT statement is designed to only display one of them. Essentially, it's a minor masterpiece.

Incidentally, it's also a good deal prettier, and it's built to easily handle multiple sites.

What amazes me is how far I've come in five years. This would have been beyond my capabilites then, but now it takes less than a day to perfect. This is partially because of the tools--Perl didn't have Unicode support, Embperl barely existed, Apache was still in 1.3. But mostly this is the result of my own increased skill. Astounding.

That's not to say that I don't have a long way to go. My commenting habits are atrocious ("if it was hard to write, it should be hard to understand!"), I often don't think far enough ahead, and I have a tendency to shotgun debug. And Perl is by far my best language largely because I'm not very good at anything else. At least I've finally broken my horrible habit of rolling my own solutions when people have already written and debugged better ones.

But still...flat files to SQL, HTML bugs to foreign encoding bugs, to mod_perl. Damn.

  • Paging madlori (and anyone who knows her)

    An interesting thing just happened on Facebook chat. Lori Summers [2:29:44] Got my message ? Brent Royal-Gordon [2:33:45] I did. Lori Summers…

  • guest post

    kate is the best better than the rest the best the best haikus about kate: kate's my favourite i want to lick her ballsack it would taste so…

  • Practice

    This December, I will have been practicing programming seriously for ten years. That will mark the tenth anniversary of me starting to learn Perl. I…

  • Post a new comment


    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.