9 ms·
Nice: "it’s likely that using Rust has already prevented hundreds of vulnerabilities from reaching production"
by cjg 4y ago
Nice: "it’s likely that using Rust has already prevented hundreds of vulnerabilities from reaching production"
- heather45879 4y agoThe problem with Rust is the language syntax is ugly. It has a ton of visual noise. I think folks who write languages should have a typographer on their team because something like this: use std::collections::HashMap Is a typographic nightmare. While I understand “form follows function”, it’s tough to be excited to program in something like this.
- Manishearth 4y agoI always say that if the strongest complaint people have about your language is syntax; you've already succeeded.
- warkdarrior 4y agoYou have an extra semicolon in your comment.
- blub 4y agoSyntax is one of the most important characteristics of language. It’s the difference that makes the difference between Rust-like and C++-like gibberish and poetry.
- nequo 4y agoIt seems unlikely that it's the double colons and the angle brackets that hold people back from migrating from C and C++ to Rust.
- lawn 4y agoI do agree that Rust sometimes has a lot of visual noise. But that use statement is not a good example of it, and if that's the biggest criticism then Rust is faring fantastically well.
- IshKebab 4y agoYeah I agree. Rust is a mildly ugly language, but not because of `use`! It's all the lifetime annotations, turbofish, and macros that make it ugly.
- pcwalton 4y agoI was responsible for that decision, and I'm also a typographer (worked for years on vector rendering of fonts). :)
- metaltyphoon 4y agoWhat reason were used to not use what C# has? It’s infinitely less noisy than Rust’s ::
- pcwalton 4y agoUsing a separate character for namespace resolution and field indexing allows you to have a module with the same name as a value.
- metaltyphoon 4y agoWouldn’t this be trivially solved by having namespaces follow the same PascalCase semantics as types? I.e use Std.String; …. let string = String(…);
- dagenix 4y agoThat's a different trade off. It's not a solution.
- munificent 4y agoTechnically, it is only 75% less noisy.
- blub 4y agoParent’s suggestion about typography is nonsense, the Rust project desperately needed somebody with skills in user experience and usability engineering. Now it’s too late.
- arein3 4y agoLooks ugly imo Dot is way better
- Mesopropithecus 4y agoAs somebody who appreciates Lisp, I feel your pain. As somebody who also appreciates Rust, I'm curious, what is your baseline?
- satvikpendem 4y agoBrainfuck, clearly /s
- heather45879 4y agoGood design theory. https://www.doverbooks.co.uk/point-and-line-to-plane 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.
- thaumasiotes 4y ago> 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.
- heather45879 4y agoSyntax 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++.