Monthly Archives: February 2014

To hide or to leak

Leaky abstractions, especially with recursive programming drives the user to read the code that refer to the code that refer to the code (and repeat) just to locate an issue at some low-level function… In many use cases, a user should not have to read and understand the library function in its entirety just to use it – it’s supposed to off-load the work away anyway. The ideal case would be to have a function that works in almost the English sense of the name of the function. People are working towards context-detection so that programs knows the context within which the user is applying the function in, and calls the right implementation without throwing an error.

However, the on the other end…

Hiding all the implementation details underneath the hood is also removing the possibility of understanding the tool. If the tool is well designed, well and good, but if not, and if the tool works against or hurts the wielder, then there is no easy way to change the tool. People are then forced to work for the tool (fix the computer, maintain virus checks etc…), instead of having the tool work for her.

Two examples:

  1. when you see a blue screen in Windows, you are given a code and you need to ask your system administrator.
  2. using Mathematica, you don’t learn math at all, you just call the function and it should just work, but you don’t learn the math at all and when it returns an elliptic integral of the n-th kind, then what can you do…?

To hide or to leak, that’s the question. And how to hide if it should be hidden and how to leak if it should be leaked. This calls for wisdom.

Goto and Eqno

To intersection{mathematicians,programmers}:

   does equation numbering and reference feel like goto statements?

Dijkstra’s tirade against goto:

http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html

Knuth’s defense for structured programming:

“Structured programming with go to statements”

Anyways, rampant goto statements are abhorrent to both of them, and everybody else. The agreement is that it is a necessary evil in low-enough-level codes to optimize, but jumping lines are by nature unnatural for human readers.

But fellow mathematicians, don’t you feel like reading somebody’s paper with equation number over two dozens is likewise a torture? They feel like a goto statement actually, and your linear flow of reading is disrupted again and again by the necessity to refer to something that refer to something (and loop), or worse, another unpublished article, or (gasp) a volume over 500 pages.

This line of thought is triggered by the criticisms of the engineering students against a certain matlab course’s “explanatory document” written by a Math professor.

Seriously, that’s not a surprise to me because I knew this professor, and he is not unique. Mathematical presentation is hugely influenced by the TeX typesetting system by Knuth… and the inherent idea of cross-referencing isn’t that different from goto from the point of view of a reader.

Perhaps, as much as structure is found important in a program, some conceptual organization is necessary to write a readable mathematical prose – both are a form of prose anyway, with esoteric languages that the untrained cannot comprehend.

Why make the life hard, for others’ and ours’ alike? How will you understand your own paper ten years from now? Can you summarize your idea using a few sentences that make common sense?

Publish or perish, what a vicious cycle.