07-08-2023 13:34 via developers.slashdot.org

Should a Variable's Type Come After Its Name?

Canonical engineering manager Ben Hoyt believes that a variable's name is more important than its type, so "the name should be more prominent and come first in declarations."In many popular programming languages, including C, C++, Java, and C#, when you define a field or variable, you write the type before the name. For example (in C++):// Struct definition
struct person {
std::string name;
std::string email;
int age;
};
In other languages, including Go, Rust, TypeScript, and Python (with type h
Read more »