Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Pops head down in to a rabbit hole ...

I find your code reads naturally enough forward. Your abstract brief example makes it no big deal to me which way round it goes.

One issue is "end weight". Let me slightly doctor the examples in http://perl.find-info.ru/perl/028/perlbp-chp-2-sect-16.html and ask you to compare:

When, after long nights of hacking, in horrible dreams there come to me damnèd souls responsible for ANSI C++, I run screaming.

with:

I run screaming when damnèd souls responsible for ANSI C++ come to me in horrible dreams, after long nights of hacking.

If I were writing one of the above two sentences, "end weight" consideration might lead me to write the latter.

If one applies these principles (left-to-right sweep and "end weight") to writing and reading of programming language statements one arrives at features such as the 'unless' keyword and the benefits they supposedly confer on writers (expressivity) and readers (ease-of-reading).



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: