4 ms·
Not he horrible syntax that would make (former)Perl developers shed the tears of joy with how many symbols are used? Not to mention the weirdly shortened words,
by why_Mr_Anderson 6y ago
Not he horrible syntax that would make (former)Perl developers shed the tears of joy with how many symbols are used? Not to mention the weirdly shortened words, if I had to write in Rust, I'm sure I'd soon 'mut'(ilate) myself. If you want to save on typing, go the full way and embrace Perl (or APL ;), don't stop in the middle.
- smolder 6y agoTotally subjective, but for me Rusts symbols seem like a good trade-off, where the readability cost paid is worth the gained expressiveness. In comparison, Perl has a terse syntax that harms readability more than it helps in other ways. Again, that's subjective. Apart from that, Perl is not a substitute for Rust or vice versa, regardless of the amount of typing involved.
- tene 6y ago> shed the tears of joy with how many symbols are used It... doesn't, though? Rust's syntax is pretty aggressively conventional, from my perspective. Looking at the punctuation symbol tokens, almost all of this is common to many languages: https://doc.rust-lang.org/reference/tokens.html#punctuation https://doc.rust-lang.org/reference/tokens.html#punctuation The symbols that come to mind when I think about my experiences writing Rust are: - <> for generics - ? for early-return errors - Macro invocations require a ! - Match statements use => - ' for lifetimes - #[attrname] for attributes - |x,y| for closures - -> for return types All the other common symbols I use feel too conventional to seem worth mentioning, like {} for lexical scopes, = for assignment, +-/ for math, foo() for function calls, foo.bar() for method calls, (a,b,c) for tuples, [1,2,3,4] for arrays, <>!== for comparison, "quoted" 'strings', / comments */ and //comments, etc. I agree that might_fail()? and 'lifetime are different, but everything else I listed seems lightweight, and very common for languages to use symbols for. <> is common for generics from C++, but alternatives I've seen are [] and (), also symbols. Matches use =>, and C's switch cases use :, also a symbol. Using macro_rules to define macros is pretty symbol-heavy, I guess? Usually when I see complaints like this, they come down to complaints about the lifetime syntax, and not liking the use of ' for anything besides quoted strings. If you disagree, could you explain how I've missed or misunderstood your point? Can you show some examples of normal Rust code that uses way more symbols than normal Perl?