Archive for May 25, 2010

Tuesday, May 25, 2010

Testability and Functional Programming

Christian Sunesson (via Jonathan Rentzsch):

The funny thing is that the OOP world have found one way to manage the complexity and the code-bases that grow ugly: They are using unit tests, and practice the art of writing testable code. […] What they are doing is that they are making as much of their code as possible to be side-effect free and placing all that code in one method so it can be called from a unit test. They are concentrating side-effects to well-defined places, carefully avoiding mixing side-effects and testable/test-worthy logic. What they are doing is that they're reinventing functional programming.

I think he’s right. To a first approximation, code that’s more functional is easier to get right, easier to test, and easier to maintain.

Simultaneous Voice and Data

Matt Drance:

Think about the number of iPhone commercials you’ve seen that demonstrate using apps while a call is active. Now imagine those commercials vanishing because the iPhone is on Verizon. The ability to—wait for it—multitask while on the phone has been a critical selling point of the iPhone experience since the iPhone 3G launch almost two years ago.…Apple is not the kind of company that takes huge steps backward just to win a few more customers.

Everyone seems to be making this argument, but I just don’t buy it. This is not a huge step backwards. I bet that the average iPhone user doesn’t know about this differentiating feature and doesn’t surf much, if at all, while on calls. Verizon makes potentially millions of customers available to Apple, customers who won’t miss this feature because they never had it. The existing AT&T customers would lose nothing. If iPhone users ever do have a choice of carriers, AT&T will do the work for Apple in making it clear that this is a network feature rather than a device feature.

American Express Network Security

Joe Damato:

So the action is to a handler at http://dailywish.amexnetwork.com/preid2.aspx?ct=7. The lack of https doesn’t make me feel very good.

The implication is that with JavaScript validators and Ajax, Safari’s lock in the title bar is not sufficient to tell you that the session is secure. And running a browser with JavaScript off is becoming less and less palatable.

Do Uninstallers Work?

Joe Kissell:

The problem is, none of these methods are fool-proof. Even uninstallers that rely on lists of files provided by the developer. And the fact that an application created or modified a file doesn’t necessarily mean it owns that file, or that it’s safe to delete.

Whenever I read about one of these utilities, I wonder what problems they might cause by partially removing some software or by removing too many files. The effects are not necessarily easily detectable right away. If the goal is to reclaim disk space, Spotlight is probably sufficient. If you don’t know how to use Spotlight and interpret its results, I’d look for a product-specific uninstaller or instructions. Absent those, my general recommendation would be to leave the software installed.

Perl and Its Future

Damian Conway:

As for Perl 6, I think it’s impossible to accurately estimate just how valuable a built-in grammar mechanism is until you actually have one. It’s true that XML and YAML/JSON cover a lot of data representation needs, but there is a vast amount of data that isn’t available in those formats and will never be unless it’s parsed and converted. And a grammar is unquestionably the best way to do that.

Undiscoverable Gestures

Lukas Mathis:

In a way, gestural user interfaces are a step back, a throwback to the command line. Gestures are often not obvious and hard to discover; the user interface doesn’t tell you what you can do with an object. Instead, you have to remember which gestures you can use, the same way you had to remember the commands you could use in a command line interface.

Great post.

Anatomy of an Annoyance

James Iry:

If only Java didn’t have covariant arrays. Or, since it does, if only the designers had used something other than arrays to carry varargs. Woulda coulda shoulda. This article shows just how hard it can be to extend an existing language without shooting yourself and your users in the ass. Runtime checked array assignment + varargs in arrays + type erasure == pain.

An interesting cascade of design decisions. It’s not clear to me why Sun was so resistant to evolving the bytecode.