Re:Rust for C++ programmers – part 2: control flow
by Derbasti on Sunday April 20, 2014 @05:15AM
(#7616318)
if `str` is too short, surely `int` is, too:
compared to:
Personally, I prefer `fn`, `int`, and `str`. I actually think that the short names are a nice way of distinguishing between built-in keywords (abbreviated, like `str`), and user-defined names (typically whole words). Also, short names are useful since they can be used as pre/post-fixes to function names like `strsplit`.
[ Parent
| on HN ]
Re:Rust for C++ programmers – part 2: control flow
by oscargrouch on Sunday April 20, 2014 @04:51PM
(#7618436)
i think 'fn' is too much minimalism..
better 'fun' or even 'func' .. but maybe they wanted to distinguish the sintax from Go's 'func'
int -> int (ok)
str -> string
but anyway.. nothing that can prevent someone to enjoy the language.. but the 'fn' for me is the most odd.. getting used to it
Re:Rust for C++ programmers – part 2: control flow
by gmjosack on Sunday April 20, 2014 @01:59PM
(#7617766)
your comparison isn't fair. you're making an argument against fn/int vs function/integer but the largest difference in the code is between index and n. I prefer the version with a longer variable name despite the length.
also shouldn't the returns be unnecessary here since the conditional is an expression?