logoalt Hacker News

User23 • 10/02/2024 • 1 reply • view 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

zdragnar • 10/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