Left to Right Programming

67 points by epidemian


epidemian

I loved this article. It puts into words something i’ve felt many times about programming languages.

I think Python is one of the most egregious offenders of this idea. Not being able of just type things left to right makes its REPL experience unnecessarily frustrating.

An example i remember stumbling upon a few times: i was doing some data processing directly on the REPL. Iteratively, i built some long expression that i hoped would give me the processed items i wanted. But when evaluating it, the output was too long. How many items where there? Well, i had to press to go to the just-executed expression, ctrl+a to go to the beginning of the line, type “len(”, then ctrl+e to go to the end of the line, type “)”, hit enter and voila, the number of items.

It’s not a big deal, i know. But this kind of thing leaves a bad taste in my mouth when i know that in other similar dynamic languages like Ruby (or JavaScript, or many other i suppose) the same thing would be much easier: press and then type “.size” + enter. Nice and simple.

(An alternative way of doing the same thing is evaluating “len()” (or “.size” in Ruby), and that would require less jumping around, but maybe i didn’t know that _ trick at the time, IDK.)

I think these kind of details matter a lot in the experience of programming. And i’m glad i now know a way to call this principle :)