Hacker News new | ask | show | jobs
by heather45879 1301 days ago
Good design theory.

https://www.doverbooks.co.uk/point-and-line-to-plane

Consider h::i::j::k versus h.i.j.k

Two :’s is an extremely loud combination of visual elements compared to the subtle point. :: drags the eye away from the content and says “look at me oscillate”

In addition, humans group similar visual elements together so a combination of anything::doesnt::matter::what::between::clumps it is impossible to escape the common pattern and the eye jumps between the ::’s. Therefore it takes double the cognitive load to read.

What’s worse, the eye gets trapped within each :: because it’s a combination of four dots, which naturally creates an implied circular pattern which draws the viewer in further.

Compare to something like: use HashMap from std.collections

Or… more obviously the python import statements.

3 comments

> look at me oscillate

I'm curious, are you dyslexic? Seeing letters move is generally something that people with dyslexia complain about.

I’m not dyslexic actually. Just thinking in terms of good user experience. A lot of the issues with C syntax is that it’s largely designed to make it easier for compiler writers.

I feel like Rust has similar pitfalls in that vein—instead of defining the user experience first, they went for a symbol that is not used elsewhere—making it easier on the engineers while satisfying the “functional requirement” of namespaces.

So—Rust will not be the language-to-end-all-languages because it is not beautiful enough. Perhaps it is almost there in functionality, but i foresee a problem with any language’s longevity unless it’s literally perfectly thought-out user experience.

I’d love to jump on the hype train with Rust but it’s not really that exciting. It doesn’t really feel all that natural. Well-thought-out user experiences should feel natural through-and-through.

> Consider h::i::j::k versus h.i.j.k

> Two :’s is an extremely loud combination of visual elements compared to the subtle point. :: drags the eye away from the content and says “look at me oscillate”

> In addition, humans group similar visual elements together so a combination of anything::doesnt::matter::what::between::clumps it is impossible to escape the common pattern and the eye jumps between the ::’s. Therefore it takes double the cognitive load to read.

It is true that the colons take up more space and your example looks good on HN.

But this problem will be immediately solved by syntax coloring. It's just never going to come up.

Syntax coloring would make it worse because coloring the :: independently of the surrounding tokens will make them stand out even more as a group.

Rust is safe but it’s at least as ugly as C++.

It depends on how the coloring is done. If the background is white, the words are black and the :: are gray, the :: won't stand out.
True, but why bother with the symbols in the first place? User experience is just as important for developers reading/writing text and languages are typically created behind closed doors with a small engineering team only.

Guido got a lot right with Python because it’s clean and easy to jump in. Minimal cognitive load. But still very powerful.

Cool, thanks! This sticks out from PL syntax criticism that goes along the lines of "not enough curly braces" etc.