and that’s yet another way to end up with hard to read code.
Variables hold values that have meaning. Learn how to name things and you’ll write good code.
edit: someone just wrote an article along these lines. The only thing I’d change is the cause-effect relationship between bad names and bad code. IME bad names lead to bad code, not usually the other way around. The reason is that by starting from good name choices, it’s much easier to have a well structured code. And not rarely, bad names lead to mangled up code that screams for a refactoring.
and that’s yet another way to end up with hard to read code.
Variables hold values that have meaning. Learn how to name things and you’ll write good code.
edit: someone just wrote an article along these lines. The only thing I’d change is the cause-effect relationship between bad names and bad code. IME bad names lead to bad code, not usually the other way around. The reason is that by starting from good name choices, it’s much easier to have a well structured code. And not rarely, bad names lead to mangled up code that screams for a refactoring.
This makes me want to write a function for you to add to numbers where the variables are leftumber and rightnumber, instead of x and y.
Implementing add (and other math operations) in rust for your types has the type signature self and rhs (right hand side).