3 comments

[ 2.8 ms ] story [ 12.5 ms ] thread
The way Ruby handles string interpolation (evaluating code inside a string) is what pushed me to learn Ruby. It was the only way that made sense to me. Also, completely disagree with your first comment. When reading my code out loud, saying "print" makes me think of a printer, which doesn't make sense to me. Puts, as in, put string, describes exactly what is happening, as you're "putting" a "string" on the screen.
The 'print' metaphor is a remnant of history. Programming used to be done on a teletype terminal, like this one: http://en.wikipedia.org/wiki/Teletype_Model_33 . You would work with a teletype printer, so 'print' means, quite literally, "print using the printer."

Other words with similar heritage are 'tty', which is short for "TeleTYpe", and 'terminal', since you were working with a teletype terminal. One could use "glass tty" to distinguish between a physical printer-based terminal and a CRT screen-based one. That terminology is almost never used these days.

When you use the word "print", you are asking Python do to the modern equivalent of sending text to the teletype terminal's printer. So I see "puts", the part of me which knows history wonders if it's also possible to put the text to a GUI, or to a web browser, or to something other than a terminal-like object.

Ah, yes. That makes sense then. Because I don't have a formal background in computer science, I was just reading it as "puts". When you read it, do you think to yourself "put string"?

I like to think I'm commanding the computer to do something, so for me it would be preferable to see commands in the English command form - put, instead of puts. But, thanks for the "puts" background - that makes more sense now!