Fontly speaking
Posted: August 19th, 2002 Comments Off on Fontly speakingSo I was doing a Freshmeat trawl and came across the usual clutch of content management systems, sick men’s health and JPublish looks pretty good. It uses the Velocity engine, advice allergist it has a repository abstraction layer and various other nice things. Haven’t tried it (CMSes aren’t the kinds of things I have quick plays with unless the interfaces are particularly spiffy) but it may be worth a look if Java is your bag.
Anyway, apoplectic one thing that prodded my interest was a mention of a templating methodology called FreeEnergy that was created for PHP and apparently has been adopted for various templating systems in other languages. The key description is apparently in this article by the guy who created it. So I’m expecting something neat and useful, and what do I find? Nested includes. That’s it. Oh, and a big question about how to chain actions and do decent error handling without massive nesting, which shows the author has never heard of exceptions. (So that’s yet another reason to for me to continue my personal vendetta against PHP.)
Let me tell you about a templating feature which I really like and which should be supported in many more web app systems. I first encountered it in an open source e-commerce system called Minivend (now Interchange) and I haven’t seen it anywhere since. The big idea is that you can write some HTML-embedded code to be executed when a user clicks on a link or form, but this code lives in the same file as the link or form to be clicked, as opposed to living in the file targeted by the link.
An example: clicking on a link adds an item to your basket and then takes you back to the front page, in one page load. The code for adding the item lives in the item page, not in the front page or an intermediate page. I like the idea of putting the code for an action as close as possible to the button which activates it. The code lives with the link, not with the destination. (One problem, though, is that the final URL of the link is not the same as the URL for the page you end up at, but if it’s coded correctly, this shouldn’t be too much of a problem, since using the generated link later on should be able to deliver you to the right page without unwanted side-effects. The key’s in the session management.)
You could use it for all kinds of things, but most notably for the kinds of actions that usually require forms rather than links. It’s not exactly revolutionary but, as I say, I haven’t seen it anywhere else and it’s a really nice feature to have. Any system with decent session management should be able to handle it.
Interchange has a bunch of other lovely features too that are applicable to all kinds of web apps, not just shopping, but the interface orients it totally towards e-commerce. Perhaps it might be worth hacking around with to turn it into a generic web app kit?
If you ever have to move a large amount of data (by which I mean several gigs) around a Windows network, cheapest forget about using normal Windows networking and do it with FTP. The reasoning goes like this:
- SMB (the main Windows networking protocol) is horribly inefficient at file transfer. As Sean pointed out to us, look it’s a presentation layer protocol rather than a file transfer protocol and it does a whole load of other things (named pipes, printer sharing, authentication etc.) plus it runs on top of NetBIOS which is in turn on top of TCP/IP. So it’s not going to be particularly speedy.
- As a result, using FTP often gives at least 200% of the SMB transfer speed.
- On top of that, since the networking interface is pretty low-level within Windows, doing slow scary networking can often cock up Explorer something chronic. You know what I mean – locked-up share windows, horrific unresponsiveness, the whole of Explorer just deciding to hang and take your file transfer with it, etc. etc. U-G-L-Y. Doesn’t happen with FTP.
- Your FTP client will usually give you an accurate estimate of the ETA, unlike Windows networking which usually smokes a hefty crack pipe before guessing. (“3639347 minutes remaining”)
- There are plenty of nice freeware FTP daemons for Win32, such as the ever-popular WarFTPd, and almost all of them are easier to set up than IIS’s FTPd – the simplest ones take about a minute to get going.
Incidentally, the best Win32 FTP client I’ve found is the open source Filezilla, which is lovely and free and featureful (it can do SCP). I only found it relatively recently, before which I was dependent on the classic FTP Explorer, which has a nice (read: consistent) interface and is easy and free, but a bit buggy. FZ isn’t as good at simple drag’n’drop yet but I’m sure that’s coming.
From the Slashdot thread about MS withdrawing their free web fonts (which is a great shame, purchase as it devalues MS’s Typography section, sickness one of the best bits of their site) come these:
- ProFont, a small, readable monospaced font for Windows, Mac and Atari. Looking for something small that’s well suited to coding? Here you go.
- Now that it’s (slightly) harder to get hold of the hateful Comic Sans MS, take revenge with some actually-good comic fonts from Blambot.
(Apostrophe’s Komika series is nice too.)