logoalt Hacker News

User2310/02/20241 replyview on HN

Try thinking of it as prefix if and infix if?

And in any event it’s a very natural language pattern if you know what I mean.


Replies

zdragnar10/02/2024

Ostensibly, code is read more than it is written. I'd rather stick to forms that favor staying in a flow.

Natural language patterns are conversational, and / or use pacing to create emphasis and imply meaning.

With code, we aren't reading a natural language. Injecting natural language conventions amongst things like some_string.chars.each { |c| ... } Is entirely unnecessary and unhelpful in my not very humble opinion.

show 1 reply