3 ms·
auto conn = createConnection(); What does this have to do with hungarian notation?
by jeremyjh 2y ago
auto conn = createConnection();
What does this have to do with hungarian notation?
- pests 2y agoYou’re thinking of it wrong. This works better: auto uasStudents = getClassList() In this case, “uas” prefix standing for an unsafe array of strings. Then say you validate the list auto sasStudents = validate(uasStudents) (Now it’s a safe array of students!)
- dullcrisp 2y agoI feel like I’m missing a joke.
- powercf 2y agoAlone this looks like a reasonable use of auto. In a real codebase, there may be two (or twenty) different connection-like things, multiple of which may be reasonably to call in this context. The "Hungarian notation" comment is correct - it's not strictly Hungarian notation, but annotating function (or variable) names when the language has a type system representing this same information is the same idea with the same problems as Hungarian notation.