kai_mactane: (Default)

If you’re going to reinvent the wheel, you should at least make sure your new version is somehow better than the previous kind. Reimplementing standard UI and OS widgets is one of the most common ways developers reinvent the wheel these days — it started with Flash developers building their own controls, and has now spread to Adobe AIR and Silverlight.

It might be a welcome trend, if the replacement widgets people were building had more functionality than the OS-native ones that are available for free in any other context. But usually, the widgets I see in these frameworks have less than half the functionality of the things they try to replace. I’m going to pick on scroll bars for now, because I’ve seen them horribly mangled too many times.

To start with one aspect of scroll bars that we often take for granted: Can you guess which of these text boxes contains more text?




Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

According to Google CEO Eric Schmidt: “If you have something that you don’t want anyone to know, maybe you shouldn’t be doing it in the first place.” This is the same stupid excuse we always hear from people who want to invade everyone’s privacy, and I’m sick of it.

Incidentally, we need a good term for the privacy invaders. Folks like the EFF, EPIC’s Marc Rotenberg, Philip Zimmermann and so on get rightly called “privacy activists”. What should we call the people who make the bogus claim that privacy is a sign of guilt, and is something you should give up to prove your purity?

Funny how those folks never seem to want to give up their own privacy, isn’t it? The “If you’re innocent, then you have nothing to hide” brigade never seem to want their own private lives examined. If only someone could have looked into J. Edgar Hoover’s private life… And Eric Schmidt? When c|net published some public information about his salary, neighborhood, hobbies and political donations — all of which it obtained through Google searches — Schmidt was so incensed, he ordered his entire company to stop speaking to c|net for a year.

Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

For backward-compatibility testing, I’ve just installed a few versions of WordPress ranging back to version 2.0. It’s kind of fascinating to see a sort of fast-rewind retrospective of the software. Even just looking at the installation experience, it’s like watching HAL 9000 descend into childish incoherence as Dave Bowman yanks his memory chips.

By the time you get back to WordPress 2.0 and try hitting the blog installation directory in your web browser, all you get is a plain, unstyled page that says:

It doesn’t look like you’ve installed WP yet. Try running install.php.

The funny thing is, that page works just fine. You click the link, it takes you to install.php, and… that’s really just a splash page, which talks about what you’re going to do, and requires that you click on a big link that says “First Step” in order to proceed. So, while it does “work”, it does so at the expense of making the user click the mouse twice, unnecessarily.

In the past 4 years, the WordPress team has made the install process look sleeker and more styled. But I think the real improvement in user experience isn’t the visuals — it’s the removal of those two unnecesary, time-wasting mouse clicks.

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

The more I play with OpenOffice.org’s Writer, the more confused I am by some of the odd UI/UX warts in it. Here are the ones that are on my mind this morning:

  • When I press F11 to bring up the Style Picker list, why does typing letters not navigate me through that list? Why do I have to use the down-arrow to navigate to “Heading 1″, rather than just typing “he” and then Enter?
  • Once I do hit Enter to apply the style I’ve chosen, why does the picker window remain open even though my cursor focus has returned to the document? This is the worst of both worlds: part of the document I’m working with is obscured by the picker window, and now I have to hit F11 twice in order to apply another style. If the window went away, I could just hit F11 once to bring it up the next time I wanted to apply a style.

    Read the rest of this entry »

    Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

Let’s say one day you decide to add a feature to your software or service. For example, you need a new flag on user accounts, so that different types of users get different features. (These don’t even have to be tiered account levels; maybe accounts of type “music lover” get a widget in the sidebar with suggestions for bands they might like while “sports fan” accounts get a sports scores widget instead.)

So, following good software development processes, you first write a couple of tests:

Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

Yesterday, a wonderful person who goes by the handle of pzil on the Palm Prē forums gave me a solution to my “You are signed out, there is no escape” woes. You can read pzil’s solution as posted on the Palm forum, but just in case, I’m also reproducing the meat of it here, in case it helps anyone else.

Again, I take absolutely no credit for this one; all credit goes to pzil.

Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

We’ll see if anything useful comes of this… I wasn’t too happy with the rep’s cluefulness at 2:55, I must admit.

2:50 PM Connecting to Rescue Gateway: control.app51.logmeinrescue.com…
2:50 PM Connected to Rescue Gateway. A support representative will be with you shortly.
2:51 PM Support session established with Kade.

2:51 PM Kade: Hello.
2:51 PM Kagan MacTane: Hi.
2:51 PM Kade: I understand that you are getting signed out and erase all data screen.
2:51 PM Kade: Am I correct ?
2:51 PM Kagan MacTane: Yes.
2:51 PM Kagan MacTane: And when I press “Just Restart”, the phone restarts and then shows that same “Signed Out” screen again.

Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

The following is a copy of what I just posted on the Palm Prē forums:

I woke up this morning to find that the webOS 1.2 upgrade had been pushed to my Prē automatically. I was happy, until the reboot finished and I saw:

Signed Out

You are no longer signed in to your Palm Profile on this phone.

If you plan to use this phone again, you can leave the files on your USB drive intact.

If you’re done using this phone, you can erase all your data on the phone and return to its factory default.

[Just Restart]
[Erase All Data]

The [things in brackets] represent buttons.

Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

A while back, when I was writing Hummingbird, I needed to look for Twitter usernames in various strings. More recently, I’m doing some work that involves Twitter at my new job. Once again, I need to find and match on Twitter usernames.

Luckily, this time, Twitter seems to have updated its signup page with some nice AJAX that constrains the user’s options, and provides helpful feedback. So, for anyone else who needs this information in the future, here’s the scoop:

  1. Letters, numbers, and underscores only. It’s case-blind, so you can enter hi_there, Hi_There, or HI_THERE and they’ll all work the same (and be treated as a single account).
  2. There is apparently no minimum-length requirement; the user a exists on Twitter. Maximum length is 15 characters.
  3. There is also no requirement that the name contain letters at all; the user 69 exists, as does a user whose name I can’t pronounce.

If you want a regex to match on this, /[a-zA-Z0-9_]{1,15}/ would be nice and safe for use in both POSIX and Perl-style regex syntax. (If you’ve got Perl-compatible regexes, /\w{1,15}/ is quick and easy.)

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

A good long while ago, I tried doing an exercise that I was considering making into a standard job interview question: “For each of your ‘languages of choice’, tell me 5 things you like about the language, and 5 things you dislike about it.” My languages of choice at the time were Perl, PHP, and JavaScript, and my answers quickly showed me why this was not the best interview question:

It was far too easy to come up with dislikes, and not so easy to come up with likes. It was a perfect example of the adage that “Every programming language sucks, but some of them suck more.”

That said, the one language that scored more likes than dislikes, for me, was Perl. Here are some of the things I like about Perl:

Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

I’ve always questioned the wisdom of building a startup company based around someone else’s platform, like Facebook games or Gmail inbox add-ons. You’re totally at the mercy of the other company. (Many people have found out how silly it was to go up against Microsoft or Apple in just the same way.)

And yet, here I am with Hummingbird, which is totally dependent on Twitter’s bandwidth. (In my own defense, I can only point out that: a) I wrote it because I needed the functionality; and b) I’m not building a money-making company around Hummingbird. I’m just giving it away.)

In the past couple of weeks, I’ve noticed that Twitter can sometimes take an astonishingly long time to provide an update. Hummingbird works by requesting URLs like http://twitter.com/statuses/user_timeline/kmactane.xml?count=25, and (up until now) it worked on the assumption that Twitter couldn’t possibly take longer than 10 or 15 seconds to respond to such a request.

That turns out not to be the case.

In fact, my recent tests have shown that Twitter can sometimes take over 5 full minutes to finish responding to such a request. This is a problem, because the default installation of Hummingbird tries to update its cached data once every 5 minutes. And since I assumed the request would be fulfilled in, at most, 10% of that time, I didn’t bother building in any concurrency checking.

I’ve just completely reorganized most of Hummingbird’s architecture. The interface that a blog owner sees (in the sense of the configuration variables in hummingbird.php, and the calling syntax for blog pages and cron jobs) is still the same. However, all of the code for retrieving data from Twitter has been spun off into a new hummingbird-cache.php file, which can be launched into the background by the rest of Hummingbird, so that it can patiently take as long as it needs to in order to update the blog’s tweets cache.

The Major Change This Causes

In Hummingbird’s previous incarnations, it would freshen an out-of-date cache before displaying it. The assumption was that every once in a while, someone might have to wait a few more seconds before seeing your blog page. However, everyone would always see an up-to-date record of your tweets. (Where “up-to-date” means “no more than 5 minutes old, absolute tops”. If you tweet so relentlessly that that’s a problem, you probably don’t have enough time to keep up your blog…)

Now that we know that Twitter can take over 5 minutes to give you the data needed to freshen your tweets cache, that design is not acceptable. Instead, Hummingbird is now committed to showing the contents of your tweets cache as quickly as possible, and only then does it fork the cache-update process into the background.

This means that, if you’re not using cron or some other automatic job-scheduling facility to run Hummingbird every 5 minutes, visitors who arrive at your blog after a period of inactivity will see an out-of-date, stale listing of your tweets.

If you have a cron job set to keep Hummingbird fresh, you’ll be fine. (A page view will also trigger an update, so if you get so much traffic that there’s never a 5-minute period during which your page doesn’t get hit, you’ll also be fine.)

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

So, Palm was recently caught spying on its users. Major kudos, by the way, to Joey Hess, who initially broke this story. For those who haven’t kept up, various other news outlets and blogs have also been reporting on it.

Palm’s response to this problem is a single paragraph of corporate PR-speak:

Palm takes privacy very seriously, and offers users ways to turn data collecting services on and off. Our privacy policy is like many policies in the industry and includes very detailed language about potential scenarios in which we might use a customer’s information, all toward a goal of offering a great user experience. For instance, when location based services are used, we collect their information to give them relevant local results in Google Maps. We appreciate the trust that users give us with their information, and have no intention to violate that trust.

The problems with this statement are:

  1. There is no indication of how to turn off this particular piece of data collection. Not on Palm’s web site, not in the user manual that came with the Prē, and not in the Prē’s user interface.
  2. For all the “detailed language” in Palm’s privacy policy, there is no slightest indication — anywhere — that they collect information about what applications the user runs.

It’s particularly interesting to look at the “On-Device Services” part of the privacy policy: It mentions types of data that will be collected “If you use services we provide” (emphasis added). For example, they say, “When you use a remote diagnostics or software update service, we will collect information related to your device (including serial number, diagnostic information, crash logs, or application configurations)”. This is the only mention of collection data about a user’s applications, and it clearly starts with “when you use a diagnostic service”.

It doesn’t say “once per day, no matter what”.

Other items under “On-Device Services” start with “When you use a back-up and restore service…” and “When you use location based services”.

All of this suggests that users have some sort of control over what gets sent and when. The Palm Prē’s “Location Services” preferences item has a control labeled “Background Data Collection”, with the caption: “Allows Google to automatically collect anonymous location data to improve the quality of location services.” (This is after other controls labeled “Auto Locate”, “Use GPS”, as shown at right. If you turn on Auto Locate, you also get a control labeled “Geotag Photos”.)

It doesn’t say that Google (or anyone else) will collect data on what apps a user is running. And it strongly implies that this data will only be collected when I actually run an app that uses location services — for example, Google Maps, or OpenTable (which wants to know where I am so it can try to find nearby restaurants).

And it blatantly claims that if I turn off that switch, it won’t send my data off to big corporations any more.

So far, I’ve verified a few things:

  1. The application data log includes installs, uninstalls, and launch and close times for all apps, not just Palm’s official ones. Homebrew and third-party apps are included.
  2. Flipping the Background Data Collection switch does not turn off the contextupload process that’s responsible for sending the information to Palm’s servers.
  3. Nor does it stop logging application launch and close times. I’ll repeat that: My Prē is still logging application launch and close times into /var/context/contextfile, even though I have Background Data Collection turned off.

We in the technology business have a technical term for what Palm is doing when it claims that it “offers users ways to turn data collecting services on and off” in the context of this particular data. That term is: lying. Palm is lying to us, pure and simple.

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

Last week, I wrote that I’d been working on a script to easily install homebrew apps on the Palm Prē. It now looks like there are much better ways to handle such things — I’ve become quite a fan of fileCoaster, myself, and of course webOSQuickInstall is a wonderful piece of work, as well. But just in case anyone might find this shell script useful, I’ll release it for general use.

Assumptions

  1. You have a web-accessible server where you put your development .ipk files.
  2. You can ssh into your Prē.

Download

You can download the script at http://kai.mactane.org/software/libraries/download/homebrew.sh.

Installation

Just drop the shell script into your home directory and make it executable. If you want to be able to use the “my” argument, you’ll also need to edit the three configuration variables at the beginning: MY_HOSTNAME, STDPATH, and STDVERSION.

Usage

For most purposes, you’ll just want to install your own package that you’ve been working on. Assuming you’ve set the config variables correctly, you can just type ./homebrew.sh my appname, where the appname is the base name of your package.

If you’re installing multiple .ipks and you don’t need to restart the GUI manager for each one, you can use the “skip” command on all but the last:

./homebrew.sh skip my foo

./homebrew.sh skip my bar

./homebrew.sh skip my baz

./homebrew.sh my quux

You can also supply a complete URL: ./homebrew.sh http://forums.precentral.net/spe_attachment/download-23971-com.palm.net.precoder.fcoaster_1.0.2_all.ipk will download and install fileCoaster, so you won’t have to mess with my script any more.

What It Does

It automates the process of installing homebrew apps with a rooted Prē, as described on the webOS Internals wiki. Basically, it remounts the root partition in read-write mode, wgets your .ipk file, installs it, does the “Good Housekeeping” backup, remounts the root partition in read-only mode again, and then restarts the GUI manager.

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

In his latest entry on Coding Horror, “Windows 7: The Best Vista Service Pack Ever”, Jeff Atwood says:

I want the world to get the hell off Windows XP. A world where people regularly use 9 year old operating systems is not a healthy computing ecosystem.

I find this terribly, painfully wrong. The unintended consequence that comes from that mindset is: “Let’s make all the user’s hard-won experience and knowledge totally useless every few years.”

There are lots of reasons why I didn’t bother upgrading to Windows Vista (if you can call it an “upgrade”), but the one that’s relevant for this article is simple: I already know how to use Windows XP. I know how to use applications with menu bars. I don’t know how to use the Ribbon, and I don’t feel that I need to throw away my existing skills.

Maybe that means I’m not on the leading edge of the tech curve any more. Fine, so be it, but retraining habits and muscle-memory is an annoying, inconvenient task. There are times when the benefits are worth it.

Nobody has made a convincing case that Windows Vista’s blithe discarding of one of the four pillars of GUI design that’s been stable since the early ’80s — windows, icons, menus, and pointers — is one of those cases. In fact, the legions of people who bought computers with Vista pre-installed, and then paid more money just to use XP instead, argues pretty convincingly against such a move.

Mr. Atwood posits a world where people don’t use operating systems for more than, say 7 or 8 years. I’d like to counter with a world where the basic design of your car’s controls and interface changed every 7 years. Instead of a steering wheel, a pair of foot pedals, and a shift lever, suppose that the 2010 line of cars used a tiller lever and a single forward/back foot-slider. Or a joystick and throttle system, like a jet fighter.

Do you suppose the accident rate might spike?

I don’t know of any field besides computing where people think that it’s acceptable to completely redesign user interfaces every couple of years. In the terms of Kathy Sierra’s wonderful post, “Attenuation and the Suck Threshold”, redesigning your interface is a way of forcibly smacking all your users back down under the suck threshold. Instead of being able to continue to use your program, and gradually learn the new features, they have to drop everything they were planning on doing this week, and instead devote their time to re-learning how to use something they already learned before.

This is simply cruel. Please, don’t do it to your users.

There is a kind of fool who says, “This is old, and therefore good.” And another type of fool who says, “This is new, and therefore better!” But what kind of fool does it take to want everything to be new, or renewed, every few years?

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

I’ve actually made some progress on coding projects this weekend. My Palm Prē “Magic 8 Ball” application now responds to the Prē’s accelerometer: if you rotate the Prē, the app stays right-side up (including readjusting the position of the backdrop image). Even cooler, you no longer have to tap a button to trigger the fortune; now you shake the phone instead. (Last Saturday night, a friend expected to be able to shake the phone and have it “shake the magic 8-Ball”. But that wasn’t actually possible for third-party devs like me at the time; the accelerometer support only arrived in the webOS 1.1.0 update, which came out on Thursday.)

I’ve also got a reasonably good script for installing, updating, and uninstalling homebrew apps for the Prē. Instead of the annoying, six-step process for installing homebrew apps on a rooted Prē, I just shell in and type ./homebrew.sh my 8ball, and the homebrew.sh script does it all for me. I need to publish that thing, now that I’ve got it working fairly well.

Additionally, my Japanese sentence generator, called “J-Babble”, now does proper plain past tenses (the -ta and -nakatta forms), which will make it more useful for me as a tool to keep me from backsliding when I’m busy. I’d link to that, but it’s not really a general-use tool yet. It’s more just for me. Maybe some day, I’ll give it the option for people to customize what vocabulary and grammatical forms they know, so it can just generate stuff they have a chance of understanding. For now, though, its use is just for me: when my life gets too busy for me to read my Japanese textbook and try to make new progress, I can at least bring up J-Babble once a day and get 25 randomly-generated, but grammatically correct and semantically sensible, sentences in Japanese. It’s just enough to keep the neural pathways from atrophying; it allows me to hold my place instead of losing ground.

(I’ve gotten some housework done, too, but this isn’t the place to talk about that.)

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

I’ve just upgraded Hummingbird from version 0.5 to its new version: 0.51. Since I recently starting using the #PalmPrē hashtag in my tweets, I suddenly noticed that Hummingbird didn’t make hashtags clickable.

Well, now it does.

The change is pretty minimal, but it also incurred some overhead in my web site: the Hummingbird web page needed to be updated to match the new feature. And since that feature meant adding a new CSS class, I had to update the “CSS Styling” section as well as the “Features” section… and add a new “Version History” section…

All in all, it was harder to update the documentary web page than to update the software itself. In a way, that implies that my code was pretty clean. If you want, you can download the new version here.

See, I’m not neglecting everything to work on Palm Prē programming! (I’m also doing some contracting, which is taking up even more time.)

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

Note, Added A Few Days Later: This post does not tell the whole story. This is a wail of anguish, and is not intended to be balanced. For a more balanced look at the Palm Prē, read my later, and broader, evaluation of it as well as this post.


There are a lot of good things about the Prē, but right now, they’re almost all being overshadowed by the catastrophic mistake the webOS developers made with the Memo Pad and Task List. They appear to have been swayed by the general Google-based philosophy that “If you’ve got really good search, you don’t need any internal structure or divisions.”

This idea is completely wrong.

Not allowing me to divide things into categories and subcategories is a painful thing. The excuse that “you can find anything you want, just by searching”, misses the point that I don’t always want to search at all — sometimes I want to browse.

Sometimes, I don’t want to select a single item. Instead, I want to see which items are available. Dividing things into categories is also an exploration of the ways that things are connected to one another. Allowing access only by searching demolishes those interconnections.

The only thing that’s more wrong than denying the user the ability to sort things into categories from the beginning, as Gmail does, is to take away the categories a user has already set up. And that’s what the Memo Pad and Task List in webOS did with my imported data from PalmOS.

I used to have 237 memos, sorted into 11 different categories that relate to various hobbies and interests, projects I’m working on, my girlfriend, and so on. And within each category, memos were automatically sorted alphabetically by title. And I had 50 To-Do items arranged in 11 other categories, these ranging from locations (i.e., “things that can only be done at home”) to types of shopping trip (e.g., “things to pick up at the supermarket” vs. “things to pick up at Fry’s”).

These internal divisions are now completely gone. My 237 memos are now arranged in the order they were created in, which is absolutely useless to me. I can, apparently, assign each memo one of four colors, and I can drag them to reorder them, but I’d still be stuck trying to deal with a list of 237 items, where previously no category had more than about 2 dozen. This is the difference between a manageable list, and one that is completely unmanageable.

(As you might guess, I also had a bunch of categories in my Date Book — only 10, as it turns out. But categories aren’t quite as indispensable there, because a calendar app has a natural way of organizing data that’s more primary. Months and weeks even subdivide time for you automatically. So while I sorely miss the categories in my Date Book, their lack isn’t a complete, crippling, deal-breaker.)

To add to the difficulty of a 237-item list, webOS doesn’t seem to have scrollbars. The content will scroll just fine, but there’s nothing to indicate where you are in the list. Are you right at the top? Halfway through? There is no way to know. There is also no way to go quickly or easily from one end to the other; you have to laboriously traverse all the territory in between.

Confronted with such a nightmare, my first thought is, “What if I just throw away all my old memos and start fresh?” Admittedly, there is some cruft in there. (In fact, I do occasionally archive stale memos to my computer’s hard drive and then delete them. It could be worse; it’s not like I’ve kept everything.)

The mere fact that I’m considering nuking all my old data, just because the new system can’t handle it, is a tragedy of poor software design and backward incompatibility. But honestly, even that wouldn’t really help:

The very nature of the new memo pad means that it cannot handle very many memos before it becomes unwieldy. With no scroll bar and no way to filter the view, the user is forced to confront all of the information that’s present, instead of having any way of interacting with a reasonable subset of it.

Once there are more than, say, three or four dozen memos in the new memo-pad system, it will be unusable again.

And this means I’m going to have to find a new way to organize my stuff. My notes. My thoughts. My ways of remembering stuff when I’m on the go.

Maybe Palm will eventually put categories back in. I dearly hope so, because their lack is a calamity for me. But by the time they do such a thing, I’ll probably have found some completely new way to keep myself organized.

I am very upset right now. And this has all just been about one particular problem; it’s not like the Prē doesn’t have some other flaws. (The lack of a D-pad is pretty annoying.)

It has some nice features, and I really ought to write about them at some point, just for balance. But right now, confronting the complete breakdown of my organizational system, it’s hard for me to see any of the good stuff that lies beyond.

Edited to Add: It seems the To-Do List or Task List app actually does have a feature that effectively allows a single-level category grouping. It’s just somewhat easy to overlook at first. The Calendar will color-code items based on their source — for example, all items derived from Google Calendar might be blue, while ones from MS Exchange might be red. I think this is silly; I’d rather have, for example, parties in red, work tasks in blue, social appointments in green, and what-have-you.

Right now, all my items are green, indicating that they all came from the same source. I really hope later ones don’t pick up some other color; I’d rather have no categorization than color-coding that doesn’t match my thoughts and that I can’t turn off.

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

My latest project is something I call “LJ Content Sieve”: a Greasemonkey script to filter out content on one’s Livejournal views based on nearly any attribute of a post or comment.

However, Livejournal is very customizable. It has 31 different “layouts”, each of which can then be further “themed” by application of CSS. This means that a user viewing a given journal, community, or single post, at a given time, may receive an HTML document containing any of 31 different DOM structures.

This means that finding a post’s author, or title, or even just a single post or comment, is not a straightforward process. I’ve set myself up a Ruby script that downloaded my “friends” view, a representative entry with lots of comments, and my own journal view, thus giving me a set of 93 fixtures that I can test against. The Ruby script also tweaked each fixture in the process of spooling it to my hard drive, by adding the proper calls to JSUnit files.

At the end of each document’s <head> element, there’s a call to jsUnitCore.js. Then, at the end of each <body>, I add a call to the lj-content-sieve.user.js script itself, as well as a set of test files that depends on which fixture this is. Every fixture gets an ljcs-global-tests.js call added to it — that file contains tests that should work anywhere, regardless of what sort of page you’re on.

Then all the “friends” page fixtures get an ljcs-friends-tests.js file, which tests operations that should happen on every friends page. For example, determining which entries need to be deleted. (In contrast, single-entry pages get ljcs-entry-tests.js, and the page from my own journal — which stands in for a view of a community — gets ljcs-self-tests.js.)

Finally, each fixture page gets a test file based on its layout: the “3 Column” layout gets ljcs-3 Column-tests.js, while “Cuteness Attack” gets ljcs-Cuteness Attack-tests.js. (Hey, I didn’t write or name the layouts; I just have to make sure LJCS works with all of ‘em.) These files will test that the actual DOM manipulations work properly.

Without test-driven development and automated testing to ensure that each layout and page-type is being handled properly, I don’t think this project would be manageable at all.

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

I’m at a one-week contract this week, and the client uses only Macs. So I’m using an unfamiliar Mac keyboard — the kind with the transparent plastic casing, and the really stiff keys (by my standards, anyway).

I am starting to get used to the propeller key already, and getting sort of used to using Meta-K instead of my usual Meta-E to access the search bar/field in Firefox. But one nice thing…

Because of the weird keyboard, I’m hoping that I can avoid transferring these habits back to my normal, PC-keyboard typing. Maybe I’ll be able to turn this drawback into a minor advantage. (Which would be nice, because reaching for the propeller key on my home computer would be seriously annoying to me.)

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

I don’t want to optimize this code prematurely. And “while you’re still writing it” is probably premature. On the other hand, totally ignoring algorithmic complexity is a sure route to a Shlemiel the Painter’s algorithm.

Do I really want to just write the whole thing, and then start profiling it to see where the hot spots are, and then possibly have to re-design the whole thing? That seems like the complete opposite of “work smarter, not harder”. Then again, it doesn’t matter if you write an O(n2) or even O(n!) algorithm if n is always going to be small… and in this application, I expect low-to-middling n values.

Of course, even if n will always be small, and increasing CPU power is my friend… even if it performs fast enough to make users happy, I’ll still know there’s a problem down there in the details. That may be the deciding factor.

Originally published at Coyote Tracks. You can comment here or there.

Profile

kai_mactane: (Default)
kai_mactane

July 2011

S M T W T F S
     12
3456789
101112 13141516
17181920212223
24252627282930
31      

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 25th, 2017 11:21 am
Powered by Dreamwidth Studios