Archive
Noise
Mind Hacks, page 109:
Having evolved to cope with noisy internal signals gives you a more robust system. The brain has developed to handle the odd anomalous data point, to account for random inputs thrown its way by the environment. We can make sense of the whole even if one of the parts doesn't entirely fit. [...] "Happy Birthday", sugn down a crackly phone line is still "Happy Birthday". Compare this with your precision-designed PC; the wrong instruction at the wrong time and the whole thing crashes.
Our brains are designed to work with noise; it sometimes even adds noise itself. This, of course, does not apply to computers: the processor is designed to handle instructions - it may be fast, but it's dumb. But if our brains are noisy, does that mean that a noisy programming language will be easier to work with? Or at least, will it be easier to learn? How many typos have you made over the years, which resulted in fatal errors or mindless debugging? What if it would have worked?
There is a programming language - to use this as a generic term - that is noisy: HTML. Actually the parsers allow for noise, they are capable of extracting the intention of the writer in the same way as the brain is capable of filtering signal out of noise. And even though there are no real statistics on this, this very feature of HTML parsers has likely speeded up the adoptation of HTML and thus of the internet. If an eleven-year-old kid can make something which resembles a website, even though his code isn't valid, that encourages him to learn more. And along the way he learns more about programming, learns different languages, meets new people, buys Mind Hacks and then writes this.
But I digress.
If we want to allow for noise in our programming languages, if we want to make them more human, how would we do that? Fixing things at compile time is hard: the wrong guess results in unexpected behaviour. However this is how the brain works (although comparing the brain to an interpreted language would probably be more apt). Through evolution our brains have learned to make better guesses, and to use new data to improve it's guesses. Computers, on the other hand, can't do this: the processor may be fast, but it's still dumb.
Therefore we may want to use the potential of the brain for improving (or verifying) the guesses. Which means we need editors which can handle noisy input, much in the way that HTML parsers allow for noise. Which also means that the editors need to learn from "knowing" which guesses were correct and which were not.
Let's take this Python code:
foo = ["hello", "world def bar(): print foo
I have made two mistakes here: I haven't finished the string world, and I haven't finished the list. An intelligent editor though could have known this: strings started with one quotation mark do not contain new lines. Therefore it has to end at that line. And a function cannot be defined inside a list, therefore the list has to end after "world. The editor could have fixed this code and directed my attention to it for verification. The result is that my code contains two bugs less, and hopefully my mind will have learned not to make that mistake again.
Actually word processors allow for noise already. If you start a sentence without an uppercase letter, Word will change it into one. If you type three periods after each other, Word will convert it into one character. Agreed, at times Word isn't very intuitive, but I'd like to see more software like this.
Comments
Leave a Comment
Due to some recent spam, and because this site is no longer active I've decided to disable comments side-wide. You can always mail me if you have questions. Thanks!
Frenzie wrote:
Actually I absolutely hate the capitalising Word does, I consider what I type my business. Word makes me feel like I just have a general idea of what needs to be done and Word steals it and does something with it which might end up what I want it to be. If I disable automatic word correction, capitalising and that kind of business I think it’s a very good program with a lot of options.
However, like you say, if brought to the user’s attention in the right way it can be rather useful. And I must say that Word XP and 2003 have a very user friendly way of notifying. After typing my first document all annoying options have been disabled along the way. But for those people who like them, they remained enabled. Yep, that’s what I call improvement.
Personally I’m more a fan of the way Dreamweaver handles automatic HTML, CSS and PHP completion. Check the program out. ;)
February 25, 2005 @ 8:18 pm. Type: Comment. Permalink.
Kees wrote:
At Frenzie: There’s such a thing as “options” in MS Word. It is possible to uncheck all options which automatically changes your text.
February 25, 2005 @ 11:23 pm. Type: Comment. Permalink.
Lachlan Hunt wrote:
If only the output (HTML/tag-soup) from Word wasn’t even more noisy than the input; and if it encouraged the use of semantics (eg. headings, paragraphs, lists, etc.), rather than presentation (ie. lose the font, bold, italic, etc. buttons from the toolbar), Word might actually be quite a good authoring tool.
That’s because document presentation is the most noisy aspect when it is embedded within the document structure, rather than seperated like HTML and CSS are. However, Word’s spell checking and correcting abilities are, IMO, second-to-none; and do a lot to reduce the typographical related noise.
With regard to editors automatically correcting program code, it needs to be done in a way that alerts the user to the change each and every time it is done, otherwise users may become dependent upon it automatically fixing errors, and then fail to write good programs using a different editor that lacks those features. From my experience, Visual Studio’s VB editor had this kind of feature as it would highlight the erroneous line in red immediately after you typed it and give a description of the error.
February 27, 2005 @ 2:07 am. Type: Comment. Permalink.
Phil Wilson wrote:
Lachlan’s right - most modern IDEs such as Visual Studio and Eclipse support error highlighting and identification, but won’t autocorrect in the manner you suggest. They will, however autocomplete, so you only have to remember the first few letters of an object name or method call to be presented with the entire thing. I’m pretty sure there are noisy programming languages (although nothing springs to mind), but none of them have taken off.
I guess if you wanted you could make the argument that any weakly-typed programming language is more suited to the human brain for this very reason (hence the popularity of Python perhaps?), although I don’t know how much water it would hold :)
February 28, 2005 @ 1:41 am. Type: Comment. Permalink.
Mark Wubben wrote:
While it’s true that IDE’s can check code for errors, simply telling the hacker that there is a bug isn’t very useful. I was talking with my father about this and he told me he used to work with Delphi, which would complain about a missing semi-colon… but why didn’t it add that semi-colon in the first place then, instead of complaining?
February 28, 2005 @ 10:56 am. Type: Comment. Permalink.
Frenzie wrote:
Kees, true, after some changing of options Word is quite allright, in fact it’s my preferred text editing tool (for printing) and the way to enable or disable it is probably the way it should be. My point is, you’ll want your software guessing what you want to do as least as possible. While adding semi-colons and capitalizing is probably useful, Word’s auto-correct feature sometimes goes too much in the wrong direction. If you type a certain word (can’t remember which one and if it’s still there in 2003) it automatically changes it into cd’s. With Word XP and 2003 that’s not much of a problem, but if you’d do it in an earlier version you’d have far too little options at hand to change it in a comfortable way.
So yes, I agree, it is good. But take it the Internet Explorer way. That software is also guessing at what you want. Would you like a typo like
color: #bleeto be interpreted like you meant blue for example? But okay, that’s probably missing the point. Just saying that what is good someplace isn’t good for everything.February 28, 2005 @ 5:18 pm. Type: Comment. Permalink.