Ding!
The last time I used a typewriter was when I was a freshman in college. I found an old typewriter in the library and used it to write letters to my cousin. A fair amount of letters on the thing didn't work and I never remembered to send those letters - both fitting symbols for the place of the typewriter in modern society. But, like that typewriter that probably still hangs out in a dingy corner of the library, the mechanico-social conventions surrounding typewriters also limp on: enter the bell alert.
Try copy and pasting either of these bits of code into a new program file and running it in your console:
ring-a-ding.rb
end
bellz.js
Music! (...well, sound at least)
The Ruby escape character "\a" and the Unicode character \u0007 are both "bell alert characters" which do nothing more or less than what the programs above make them do - they make a little ding. The bell alert hails back when typewriters needed to alert their typists (who were probably too busy drinking martinis during their lunches to pay attention to their work) that they had typed to the end of a line and needed to press return and start a new one.
When people transitioned from typing on typewriters to typing on computers, in order to provide continuity for users many typewriter conventions followed - like the QWERTY layout, the caps lock key, and...the bell alert, even though there wasn't really any technical reason why these things had to persist. And in the interest of backward compatibility, many programming languages still include the bell alert as an escape character. And even languages like javascript which do not have a bell alert have the ability to generate one by printing the unicode bell alert character to the terminal.
So...is this just a historical oddity? What is the point of a program that does nothing but makes an annoying noise every time you hit enter? It doesn't seem like there is one at first until you really listen to that noise a lot and then...it starts to hit you how many times you've heard that sound before, despite probably never really paying attention to it and especially never knowing what it was.
The bell alert is used in all sorts of programs to give the user a non-visual clue that something has happened when the screen shouldn't be updating, generally when the user is trying to do something that can't be done. It's a frustrating noise, but it's far less frustrating than if the user keeps trying to do an action and it just...isn't....doing. We often forget in an era of silenced phones and quiet office spaces that there are ways that our computers can communicate with us beyond pixels on a screen. Try throwing a bell alert in your own code sometime and watch your users' experience improve marginally without them even knowing it.
"And therefore never send to know for whom the bell tolls; It tolls for thee." - John Donne
Try copy and pasting either of these bits of code into a new program file and running it in your console:
ring-a-ding.rb
puts `clear`
puts "Press enter to ring the bell!"
x = ""
while x != "bye"
x = gets.chomp
puts "\a"
bellz.js
let i = 0
while (i<5){
console.log('\u0007')
i++
}
Music! (...well, sound at least)
The Ruby escape character "\a" and the Unicode character \u0007 are both "bell alert characters" which do nothing more or less than what the programs above make them do - they make a little ding. The bell alert hails back when typewriters needed to alert their typists (who were probably too busy drinking martinis during their lunches to pay attention to their work) that they had typed to the end of a line and needed to press return and start a new one.
When people transitioned from typing on typewriters to typing on computers, in order to provide continuity for users many typewriter conventions followed - like the QWERTY layout, the caps lock key, and...the bell alert, even though there wasn't really any technical reason why these things had to persist. And in the interest of backward compatibility, many programming languages still include the bell alert as an escape character. And even languages like javascript which do not have a bell alert have the ability to generate one by printing the unicode bell alert character to the terminal.
So...is this just a historical oddity? What is the point of a program that does nothing but makes an annoying noise every time you hit enter? It doesn't seem like there is one at first until you really listen to that noise a lot and then...it starts to hit you how many times you've heard that sound before, despite probably never really paying attention to it and especially never knowing what it was.
The bell alert is used in all sorts of programs to give the user a non-visual clue that something has happened when the screen shouldn't be updating, generally when the user is trying to do something that can't be done. It's a frustrating noise, but it's far less frustrating than if the user keeps trying to do an action and it just...isn't....doing. We often forget in an era of silenced phones and quiet office spaces that there are ways that our computers can communicate with us beyond pixels on a screen. Try throwing a bell alert in your own code sometime and watch your users' experience improve marginally without them even knowing it.
"And therefore never send to know for whom the bell tolls; It tolls for thee." - John Donne
Comments
Post a Comment