3 ms·
> #[] - why the [] if # already makes that line different from the usual code? seems superfluous I don't even know what #[bla(foo)] does, or why all that punct
by leetcrew 6y ago
> #[] - why the [] if # already makes that line different from the usual code? seems superfluous
I don't even know what #[bla(foo)] does, or why all that punctuation is needed. maybe nesting is allowed?
> 'a - is that thing next to 'a' a smudge on my display? Did I forget a quote? better wipe the display with my finger
this is a lifetime annotation, which is a genuinely noisy bit of syntax.
> foo! - yelling out function calls. "print!" "exit!" "macro!". Angry Codes!
I guess they really want to make sure you know when a macro is being used. probably a result of ptsd from debugging c and c++ code :)
> fn - by itself not a huge deal, but the list of truncated words that are used frequently is "impl", "mut" and "pub". I save some characters (am I really in such a rush?) at the cost of reading this broken English "f-n impl moot pahb". At least C doesn't have that.
the c keywords aren't too bad, but the standard library is full of this kind of thing. stdio.h and string.h immediately come to mind.
I'm not so much defending rust as I am pointing out that c's syntax isn't that great to begin with. I've been writing c and c++ code every day for several years now, so it's usually pretty easy for me to skim and understand what is going on. but if I try and place myself in the shoes of a newcomer, I don't think the syntax is much better than rust. remember the first time you tried to parse the type of a nontrivial function pointer?