I'm going to start posting the random bits of awk code that I come up with.
For a project about which I'll be writing more in a bit, I needed the ability to quickly produce long strings - on the order of a few dozen, and in some case a few hundred, mebibytes. I went through several iterations before I came up with a version that I liked. That version is called
Ah, the LJ cut. Let me first explain why I hate it and have avoided it, and then explain why I'll start using it.
For starters, I moved to LiveJournal from my original Blosxom-based weblog purely for the comments. Anyone at all can build a static site and publish a set of HTML files, and anything with a processor in it ought to be able to serve that up fast enough to saturate the link. I really liked to use Blosxom for this because it was tiny, simple, fast and fun. I especially liked how its well-defined template system allowed me to do very interesting things with metadata on the back end and then choose how to display it later in the rendering process, if at all. Sometimes well over half the byte length of my posts went to ancillary information like click paths, attribution, extensive link content descriptions, extra writing in the comments and so on. I really enjoyed exploring and pushing the edges of the HTML weblog format.
Unfortunately Blosxom's comment ("writeback") system fell over again and again under spam load, and I had to kill it. I can't port my old content into the current incarnation of LiveJournal without abandoning a lot of the extra work and depth that I put into the original posts. That's a shame, but it's not too suprising. I can, though, deal with the very minimal spam load. That's an enormous plus.
Cuts, though, are evil. There are any number of ways of marking up a piece of HTML as collapseable - a div with an appropriate class declaration is the simplest solution I can imagine. Instead, you've got to dump completely non-standard markup into what would otherwise be clean and correct HTML. It's irksome. It also commits you to either sticking with LiveJournal rather than retaining your ability to grab your data and port it someplace else, or to spend a bunch of effort filtering out its non-standard crap when you do simply because they couldn't be bothered to play by the rules.
That reminds me: I owe you a writeup about how to install and use the the Perl LJ export tool. I'll get on that.
As for the utility of hiding text, I agree; but this is a task that belongs at the rendering level. The smallest "normal" TCP/IP packet that gets shuffled around is just under 1500 bytes. Factor in the overhead of the normal HTTP header and your LJ authentication cookie, and the typical size of the text behind a cut, and you're looking at the bandwidth equivalent of shipping a pencil in a shoebox. It's just silly.
Furthermore, a simple Greasemonkey script - or an arbitrarily complex and sophisticated one - can easily and quickly take on this kind of reformatting task. And yes, there are similar facilities in Internet Explorer, Opera and Safari; I believe that even elinks includes some kind of optional programmatic post-processing. Client code can easily conceal extra information, but fetching and patching it into an already-rendered document is a far more onerous task. In general, splitting up an otherwise atomic unit like a full post across several transmissions complicates both the upstream and the downstream components, for little - I would argue no - gain. It's pure waste!
That said, it's presumably less onerous for me to grub through my data programmatically in the future than it is to force everyone to scroll past several pages of my self-indulgent code crap. Sorry about that. I'll put them behind cuts in the future.