You’re fixing the wrong thing.

March 7, 2012 at 3:02 am (doing it wrong, lying documentation, trouble with small numbers)

Some folks at Mathworks read this blog. I know because I get referrals from Mathworks internal wikis and bug trackers.

I also know because I’ve seen a few documentation changes. For example, you guys have updated the documentation for “sparse” to reflect that it adds together overlapping indices rather than overwriting them like normal arrays; you updated the docs on “randsample” to reflect that it draws random samples from arrays only if they are at least 2 elements long; you even updated the docs for “getframe” to clarify that you need to turn off the fucking screen saver and walk away from the computer like it’s 1992.

Ahem. You guys are missing the point. Let me repeat from before.

It’s not that MATLAB’s behavior isn’t documented; it’s that the behavior is stupid, and leads to errors when your users (reasonably) assume that behavior would be consistent over array dimensions, or that behavior would be consistent between different but related functions, or that behavior would be consistent within a single function, or that things would just not be busted in general.

I liked the previous, unmodified documentation. It reflected the intentions of your programmers; clearly they were trying to implement the reasonable and useful things they described. It’s too bad you don’t have the wherewithal to finish the job you clearly meant to do and fix the stupid behavior.

About these ads

3 Comments

  1. Richard said,

    I agree with a lot of the stuff you have here, but I do not agree that the specific case of sparse adding together duplicate indices is inherently stupid. It is unintuitive, and it was at the time undocumented, but the behaviour itself stupid? I’m not so sure.

    I have come across at least one case where this is very useful behaviour, the construction of a stiffness matrix for a finite element problem.

    What is actually stupid is that spase does not accept integer data types for the indices, probably when you need the memory most.

    • crowding said,

      There’s already a “create sparse array” option for accumarray though.

      • Richard said,

        good point

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: