Personal Programming
Programming in the 21st Century - James Hague - August 28, 2010I’ve mentioned before that this site is generated by a small Perl script. How small? Exactly 6838 bytes, which includes comments and an HTML template. Mentioning Perl may horrify you if you came here to read about Erlang, but it’s a good match for the problem. Those 6838 bytes have been so pleasant to work on that I wanted to talk about them a bit.
I’ve used well-known blogging applications, and each time I’ve come away with the same bad taste, one that’s caused by a combination of quirky rich formatting and having to edit text in a small window inside of a browser. I don’t want to worry about presentation details: choosing fonts, line spacing, etc. It’s surprising how often there are subtle mismatches between the formatting shown in a WYSIWYG editing window and what the final result looks like. Where did that extra blank line come from? Why do some paragraphs have padding below them but others don’t?
I decided to see if I could bypass all of that and have a folder of entries marked-up with basic annotations, then have a way to convert that entire folder into a real site. And that’s pretty much what I ended up with. The sidebar and “Previously” list and dated permalink are all automatically generated. Ditto for the atom feed and archives page. The command-line formatter lets me rebuild any page, defaulting to the newest entry. If I want to change the overall layout of the site, I can regenerate all of the pages in a second or so.
There are still legitimate questions about the path I chose. “Why not grab an open source program and modify it to fit your needs?” “You do realize that you decided to write an entirely new system from scratch, just because you didn’t like a few things in existing programs; surely that’s a serious net loss?”
My response is simple: I did it because it was easy. If I get annoyed with some feature of Microsoft Word, I’m not going to think even for a second about writing my own alternative. But the site generation program just took a bit of tinkering here and there over the course of a weekend. It never felt daunting. It didn’t require anything I’d label as “engineering.” I spent more time getting the site design and style sheet right, something I would have done even if I used other software.
Since then, I’ve made small adjustments and additions to the original script. I added the archive page nine months later. Earlier this year I added a fix for some smaller feed aggregation sites that don’t properly handle relative links. Just today I added mark-up support for block quotes. That last one took ten minutes and four lines of code.
If this suddenly got complicated, if I needed to support reader comments and ten different feed formats and who knows what else, I’d give it up. I have no interest in turning these 6838 bytes into something that requires a grand architecture to keep from collapsing. But there’s some magic in a solution that’s direct, reliable, easy to understand, and one that fits my personal vision of how it should work.
(If you liked this, you might like Micro-Build Systems and the Death of a Prominent DSL.)
Categories: Blogs Programming in the 21st Century
Comments
I don’t want to worry about presentation details: choosing fonts, line spacing, etc. Tiffany Jewellery
Fashional Tiffany & CO. products about all Tiffany Jewellery, like: Tiffany Ring, Tiffany Necklaces, Tiffany Earrings, Tiffany Bracelets,
Tiffany Necklaces
Tiffany Charms
Tiffany Bracelets
Tiffany Earrings
Tiffany Rings
Tiffany
Tiffany and Co
tiffany jewellery from tiffany & co are now on sale on our uk store.
Add comment
Erlang on Twitter
» ivansyahhsn (ivansyah): Iya dewa erlang hbd,awas ya siksamu menanti RT @indrasan: selamat ulang tahun saudara reza erlang @rezasur semoga makin banyak proyek nya ya
» CzarneckiD (David Czarnecki): It was like Mr. Toad’s Wild Open Source Ride here tonight: Erlang, Riak, CouchDB, Ruby and Python. #nofastpassrequired
» yang_yihming (Yiming Yang): @vw009 Which language do you often use in parallel programing? Ocaml? Erlang? C01? Or some other language?
» tengkushara (T Muni Fahtu Zahra): RT @fathiaamandaaa: RT @indrasan: selamat ulang tahun saudara reza erlang @rezasur semoga makin banyak proyek nya ya.
» wolfeidau (Mark Wolfe): Coding in emacs and enjoying it, hell has frozen over.. #erlang #emacs
» bagus_erlang (bagus): SI rizky kocak ♓é² :.. ♓é² :.. ♓é² :..
» ErNugraha7G (ErlAngga™): Enggaa lama bgt balesnya? RT @VanessaaaZM: apose? RT @ErNugraha7G Yah mention erlang gadibales @VanessaaaZM
» bagus_erlang (bagus): Bt nieh!! Di sklh…
» VanessaaaZM (Vanessa Zian M): apose? RT @ErNugraha7G Yah mention erlang gadibales @VanessaaaZM
» VanessaaaZM (Vanessa Zian M): pacar aku abel;D RT @annisaH_Ijem jangan samain kakak aku sama si erlang :;pp RT @VanessaaaZM Kaya abel RT @annisaH_Ijem: ngeledek, liat
Statistics
Number of aggregated posts: 10503
Number of comments: 2136
Most recent article: May 21, 2012
Latest comments
» Jessica on 30 September 2011: Basho Technologies, Erlang Solutions and Trifork AS Announce Big Data and NoSQL R: yeah of course. I just thought that everything will be just alright and I want to have these kind of…
» DRS786 on 25 May 2012: Poznan Erlang User Group Event: I’m going!
» the tantric way in london on TextOne HD for webOS: Interesting articles are published here. By reading it I acquired great deal of knowledge on various subject. Thank you for…