Re:What Makes Code Hard to Read: Visual Patterns of Complexi...
by culopatin on Tuesday March 11, 2025 @02:18PM
(#43335454)
While this is simple and all, the English words if/else don’t require the reader to know the ?: convention.
Depending on what background the reader may have, they could think of the set notation where it could mean “all the evens such that odd is true” which makes no sense. Its also very close to a key:value set notation. If/else leave no doubts for the majority of readers. It’s more inclusive if you will.
[ Parent
| on HN ]
Re:What Makes Code Hard to Read: Visual Patterns of Complexi...
by bogomog on Tuesday March 11, 2025 @02:28PM
(#43335554)
That's why I gave the caveat that if using a language with the ternary operator, one should know that operator. Python tried using English words for a ternary, but I think that's awkward from a readability perspective. A limited set of symbolic syntax improves readability over using words in my opinion, there's less text to scan.
Re:What Makes Code Hard to Read: Visual Patterns of Complexi...
by erikerikson on Wednesday March 12, 2025 @12:41AM
(#43340013)
Learning the basic operators of the language seems like table stakes.
Choosing one of world's spoken languages over others seems to be the opposite of inclusive.