News for hackers. Stuff that matters.

Ask HN: Sound-based syntax highlighting – what do you think?

Hey,

I want to drop here an idea that is bouncing in the back of my head for some years already, and that I absolutely, positively won't have time to test in upcoming months.

We all have experienced the benefits of syntax highlighting in our editors. Apart from increasing readability, it helps spot typos the moment they're made. I bet most of us have internalized it into an almost subconscious reaction like "hey, that keyword I just wrote didn't turn blue, I must have made a typo".

I was thinking about using sounds to achieve a similar effect. Say you're typing a keyword, the moment you type the last letter and make a whitespace, your editor plays a sound. You expect it to be played, so if you don't hear, you immediately know you've made a typo.

One could introduce different sounds for symbols, numbers, strings, opening/closing parens, and maybe even bigger semantic constructs. You get slightly different sound when you close a function, when you close a class, etc.

One would have to make sure those sounds are non-distracting. Fortunately, one is rarely annoyed by the sounds of one's own typing the keyboard makes, so this suggests it is possible to achieve this goal.

One slight twist I though about is to make every keystroke make a sound, with a pitch increasing with the speed of your typing, to make people like typing faster more :).

The simplest way to test it would probably be to write an Emacs exension, given the great facilities this editor has for plugging into the typing process, including recognition of semantic constructs. Unfortunately, as I said, while I'm dying to test this, I have other projects right now and a thesis to finish; maybe someone will give it a shot though.

Still, I'd appreciate any comments regarding use of sound as an additional sensory input to a programmer's brain.

( 6 comments | 7 points | on HN )
Re:Ask HN: Sound-based syntax highlighting – what do you think? by csmdev on Saturday August 30, 2014 @05:33PM (#8247652)
Sounds become annoying with time. But visual cues are often automated and ignored. This is why the current solution works best.

Because of the way we evolved, a sound automatically makes our brain alert. At first it's ok. But with time we learn that there is no actual danger. And the sound only becomes annoying. Making us alert for nothing.

Visual cues are treated differently. If something is deemed safe or accepted by the brain, you automatically start ignoring it and focus on something else. So an acknowledgement comes only when something is different. And even then, we simply notice it. It's not an actual alert like sound is.

So the idea is bad. It goes against the way our brains work.

Re:Ask HN: Sound-based syntax highlighting – what do you think? by TeMPOraL on Saturday August 30, 2014 @05:47PM (#8247682)
Thanks for your input. I don't agree with it though ;).

The brain can push sounds to the background in the same way it does with visual cues, if there's no danger associated with them. For instance, you're not annoyed by the sounds your keyboard makes when you type (and I know many developers, who prefer loud, mechanical keyboards).

Also, try the following experiment: open a window during the day, plug in a microphone and just record with it for a minute. When you play it back, you'll hear many sounds your brain learned to ignore - cars passing by, hum of your computer, kids playing soccer on a field nearby, etc.

For those reasons I think there might be a set of sounds that would not become annoying with time.

Re:Ask HN: Sound-based syntax highlighting – what do you think? by csmdev on Saturday August 30, 2014 @06:30PM (#8247766)
You're confusing white noise with independent audio cues.

Plus, I don't think anybody ignores keyboard typing sounds. They work just like car engine noises. Audio feedback for a physical action. The example you're searching for is keypad tones for smartphones. That's the concept behind your idea.

Re:Ask HN: Sound-based syntax highlighting – what do you think? by TeMPOraL on Saturday August 30, 2014 @06:49PM (#8247810)
> The example you're searching for is keypad tones for smartphones. That's the concept behind your idea.

Yes, that's generally the concept behind my idea. You're right, thinking about it, there's a difference between this and white noise. Still, aren't keypad tones for smartphones an audio feedback for a physical action?

Re:Ask HN: Sound-based syntax highlighting – what do you think? by LarryMade2 on Sunday August 31, 2014 @11:57PM (#8251473)
It sounds intriguing, lots of folks are critiquing off the cuff. I remember Spell Catcher for the Mac has a you-made-a-typo sound, which was helpful, then again it at times was irritating as it was like some guy behind your shoulder kibitzing as you were typing and interrupted your flow.

Though I would think that maybe keysounds might be a good thing though, as an audible confirmation you typed the right key... not as a punishment, just a confirmation.

I'd go with something as minimal as possible at first and then try variations... you might even be able to take some OSS editor and hook some test code into it.

Lastly How many folks would want to turn on a Hacker's "Gibson Keyboard" sound just to have the cheap thrill now and again?

Re:Ask HN: Sound-based syntax highlighting – what do you think? by smeyer on Saturday August 30, 2014 @11:48PM (#8248372)
Maybe some people would like this, but I would find it so annoying. Regarding "one is rarely annoyed by the sounds of one's own typing", that doesn't mean I'm not annoyed by a lot of sounds. For example, I frequently turn off the beep for alerts in my terminal and switch it to a visual flash instead.