I’ve got a small number of computer games, and I play practically none; last time I verged on addiction was probably in University, when I stayed home for a day playing Civilization (that should date me). Which might explain why I like this article, Designing Games for the Wage Slave, which argues that game makers need to make games more playable for people with no time.
Category: Software and Programming
Making Perl faster
When perl is not quite fast enough
Most modules are able to export lots of their functions and other symbols into your namespace to save you typing. If you have only one argument to use, such as
use POSIX; # Exports all the defaults
then POSIX will helpfully export its default list of symbols into your namespace. If you have a list after the module name, then that is taken as a list of symbols to export. If the list is empty, no symbols are exported:
use POSIX (); # Exports nothing.
You can still use all the functions and other symbols – you just have to use their full name, by typing POSIX:: at the front. Some people argue that this actually makes your code clearer, as it is now obvious where each subroutine is defined. Independent of that, it’s faster:
use POSIX; use POSIX ();
0.516s 0.355s
use Socket; use Socket ();
0.270s 0.231sPOSIX exports a lot of symbols by default. If you tell it to export none, it starts in 30% less time. Socket starts in 15% less time.
Round-up of weird links:
- Jungle girl vs. the Shmoes – a really bad comic, recapped, with pics.
- Isaac Hayes’ Three Laws of Robotics (via jwz).
- Also from Jamie Zawinski, a page where he’s collected a list of “inappropriate language” the lawyers removed from the Netscape Communicator source code for its release. As a bonus, he adds the comparable lines from the Navigator 3.x source. Sample gems:
/* "Object oriented? Fuck that shit! Pabst Blue Ribbon!" --Dennis Hopper */
// They'll never fix the damned warnings. To hell with quality:
// to make Symantec Cafe function properly -- piece 'o crap compiler)
// ok, we are formatting an image. turn off the buggy piece of crap feature
PissOnThisDocument(fHContext);
/* This function is a complete piece of shit - it takes a billion flags */
# define rename hpux_sucks_wet_farts_from_dead_pigeons
// Read in the user's sig and do Jamie pacifying crap to it
I could go on…
- A directory of heavier-than-air flying machines in western Europe, 850 B.C. – 1783 A.D. by Clive Hart lists various attempts at flight by hopeful fools jumping off castle walls with Chicken feathers glued to their arms, and such.
Compare It! is a shareware file compare and merge tool, and probably worth supporting if you can’t find someone to pay $129 for a copy of Araxis Merge. Yeah, for work it’s probably fine to keep installing the evaluation copy of Araxis Merge whenever you need to merge a big source code tree, for example, but for small jobs, like merging two versions of an ImageReady-sliced HTML page, you want something you don’t need to re-install every time you dust it off.
Compare It! seems to have picked up Araxis Merge’s use of softer colors, which is a definate improvement over the Windiff-style garishness of various freeware efforts I remember.
Why am I merging ugly generated HTML pages? Because I’m preparing an update of Guy’s site…