I would be interested using Rust if it weren't for the poorly chosen language syntax. Same goes for Kotlin and Swift. Coming from C/C++ background I don't care for declaring variable names before their types. val/let, fn (instead of say "func" or "function"), etc... I hate implicit types and operations instead of being explicit.
Ugliness is subjective. Rust fn syntax is made for easier symbol search in the sources. It's trivial to find a function by grepping "fn plus_one". And it's much easier to find a function returning something by grepping for "-> xxx".
It's generally done with a search for "function_name(" or "function_name (" depending on your coding convention. Problem solved.
I'm not sure if you're being intentionally obtuse, but you're missing the point. In C++, that syntax could be a function definition, declaration, or call. Heck, it could be a macro, too. How do you differentiate between those when you're searching?
OK, so the % for int is a bit obscure. But having end tags rather than {}s prevents certain errors. And using the function name as the return value is very handy -- how often do you declare a variable just to hold a return value.
If Rust had followed VB instead of C syntax then I might think about using it.
It's the syntax (Score:5, Insightful)
I would be interested using Rust if it weren't for the poorly chosen language syntax. Same goes for Kotlin and Swift. Coming from C/C++ background I don't care for declaring variable names before their types. val/let, fn (instead of say "func" or "function"), etc... I hate implicit types and operations instead of being explicit.
fn plus_one(x: i32) -> i32 {
x + 1;
}
Ugly as hell compared to
int plus_one(int x) {
return x + 1;
}
it's also far more explicit
Re: (Score:3, Insightful)
Good luck doing in it C.
Re:It's the syntax (Score:2)
Good luck doing in it C.
It's generally done with a search for "function_name(" or "function_name (" depending on your coding convention. Problem solved.
Re: (Score:0)
It's generally done with a search for "function_name(" or "function_name (" depending on your coding convention. Problem solved.
I'm not sure if you're being intentionally obtuse, but you're missing the point. In C++, that syntax could be a function definition, declaration, or call. Heck, it could be a macro, too. How do you differentiate between those when you're searching?
They are both wrong (Score:2)
It should be
Function Plus_One%(x%)
Plus_One += 1
End Function
OK, so the % for int is a bit obscure. But having end tags rather than {}s prevents certain errors. And using the function name as the return value is very handy -- how often do you declare a variable just to hold a return value.
If Rust had followed VB instead of C syntax then I might think about using it.
Re: It's the syntax (Score:2)
Re: It's the syntax (Score:2)