2008-03-20

Sneak Attack: More Performance Tips from YAHOO!

Back to flipping out...

2008-03-05

C/C++ Programmers

Thanks for suffering so I don't have to. - paulzork said it on the programming subreddit about C/C++ programmers, and I don't think I've ever seen a better summary of my feelings for C programmers.

Back to flipping out...

2008-03-04

JavaScript Idioms - Copying an array

Ever see a block of JavaScript that looks like this?


var myArray = [];
for (var i = 0; i < source.length; i++) {
    myArray[i] = source[i];
}

That's the popular way to copy the elements of one array (note the lack of capitalization) into a new Array (note the capitalization - we'll get to this in a minute). I wasn't really a fan, at first, but it's almost as pervasive as

while(*dst++ = *src++);

in C, so eventually I decided to stop worrying and love the bomb. Basically, JavaScript will automatically grow your Array for you, so you can dispense with all the sizing you might expect when using something called an Array.

Now for the notes you took on capitalization. Not everything that acts like an array in JavaScript is actually an Array. One example is the arguments property available to Functions. If you happen to need the stuff in arguments as an actual Array (because you want to use it as a key for a map/dictionary/hash, let's say), you will find yourself writing some code like that above. Just remember that sometimes stuff is "Array-like" without actually being an Array, because it can really bite you if you're not careful.

Back to flipping out...

2008-02-22

How Do You Balance Different Target Audiences With Different Needs

The Problem

Different groups of your users have different ways of handling the same basic tasks and/or data. Names and addresses are just two of the more common types of data that vary from culture to culture. So how do you handle this situation? The immediate impetus for this post is this programming.reddit comment about names. I can see at least 3 different approaches, each of which has drawbacks.

The Strategies

Ignore the needs of the smaller target audience(s)

This is the one I've seen most often in the wild, and I can see it's appeal: if you are only giving up a few potential users/customers, you'll probably offset your losses by increasing your saturation in the supported target audience(s). Still, I always get a vague feeling of unease when I knowingly make it harder/impossible for a group of people to use my work.

Limit your functionality to the common subset

I don't know that I've ever encountered this, and I can see why. When you get right down to it, there's not much about this world that is constant across all places, people, and cultures. That doesn't leave you a lot of functionality to put into your app. Even when there is a common subset, your different target audiences will probably still prefer to use an application/site that supports the nuances they are used to, and nuances are the first thing to go when you start chopping functionality down to a common subset, pretty much by definition.

Hide the functionality that is subject to change until you know which variant to expose

There are a couple of problems here:

  • You may not even need the information for anything else, and users are famously reluctant to give out personal info. If you do ask them for the information, please keep Application Design Mistake No. 9 in mind.
  • It may not be feasible to hide the functionality in question. If your application/site doesn't require users to register, for example, then it might be hard to keep track of the information necessary to know which variant of the functionality to expose.

The "Solution"

In reality, I imagine most developers would prefer some mixture of the strategies listed above, though I could be wrong. What does your solution look like?

Back to flipping out...

2008-02-18

Sneak Attack - Crunch Mode

Sneak Attack: The Crunch Mode Paradox

Back to flipping out...

2008-02-13

Buildix in Anger, part 2 (follow-up)

According to the response on the forum, you basically can't do what I wanted to do (unless you feel like reverse engineering the webapp, which appears to be obfuscated), but Mingle 2 will have an API that should allow it.

Back to flipping out...

2008-02-12

Buildix in Anger, part 2

Something to note: the Buildix project creation logic uses the blank Mingle template. If you want to use a template, such as the Scrum template, you'll have to create a Mingle project manually. Originally, I was going to walk you through the process for modifying Buildix to use the template you told it to use, but I couldn't figure that one out in time for this post. I've posted a question to the Buildix forums, and if I learn anything further, I'll update this post accordingly.

Back to flipping out...