3 ms·
I know nothing about rust, but what are you actually complaining about here? The only additional "sigil" in the rust example is the & for vector which I assum
by gpderetta 5y ago
I know nothing about rust, but what are you actually complaining about here?
The only additional "sigil" in the rust example is the & for vector which I assume marks a reference. Languages that confuse objects with references are a pet peeve of mine, so good for rust to mark the difference. : vs -> and type[] vs [type] are just preferences, neither is obviously better. The Vec2 declaration in the first example actually has more sigils than the rust example (= and ;).
Regarding shorthands, just number would be unacceptable for 99% of the work I do, and it would be something that specifies signedness, integer vs float and size. As a c++ programmer, having to write std::uint64_t gets old very quickly and I'm happy that rust uses a shorter name for these.
I don't think that using a shorthand for something very common is an hindrance to comprehension. Do you think one should write "have not" instead of "haven't" in English?
- Aeolun 5y ago> Do you think one should write "have not" instead of "haven't" in English? Given how many people do this wrong? Yes, that sounds like a great idea. I have to agree with OP that Rust often looks like sigil soup. The example isn’t great, but there is a _lot_ of noise when looking at Rust code. Of course they all have a meaning, but I feel sometimes that meaning could be more easily expressed as a verb than a sigil. At least it would make things more readable (until you get into generics I think Typescript scores pretty high on readability).
- zozbot234 5y ago> Of course they all have a meaning, but I feel sometimes that meaning could be more easily expressed as a verb than a sigil. Why not try to come up with an alternate syntax, expressing everything in English-like verbs and compiling into Rust proper? You could call it RUBOL. Then #[RUBOL] code fragments could even be supported within .rs files
- Aeolun 5y agoNot a bad idea. I may see if that makes Rust more palatable.