3 ms·
IMO talking about "better naming" is missing the underlying problem. Every real world software project is a mess of unstructured identifiers being created and
by pavlov 7y ago
IMO talking about "better naming" is missing the underlying problem.
Every real world software project is a mess of unstructured identifiers being created and managed in ad hoc ways. There are thousands of names whose components are actually in a relationship with each other — FooBars and CustomerSpecificFooBarXYZMutators and FrameworkZProjectABCFooBarXYZMutatorFieldValidators etc ad infinitum — but nothing lets you discover and manage those encoded relationships.
Tools like autocomplete are simply usability patches to hide this inherent lack of structure in flat names.
Maybe you remember GOTO?
Imagine if the proposed solution to 1970s BASIC's flow control woes had been:
"We really need to get better at managing our line numbers. Let's enforce strict rules about what the numbers mean, and build autocomplete IDEs that can tell you exactly what's at line 145530!"
This where large-scale software engineering is currently with naming. Any amount of org-level convention and tooling can't make up for the inherent flatness of identifiers in our current crop of programming languages.
Once identifiers become structured instead of plain strings, it will have the nice side effect that a few of the industry's most ridiculous time-waste problems like snake_case vs camelCase in APIs will simply go away.
- nradov 7y agoIt's not a complete solution but most popular OO languages have some concept of modules or packages which provide separate namespaces used for grouping related classes.
- pavlov 7y agoI feel namespaces imposes the wrong structure. It’s just a tree where the actual problem is mixing in multiple levels of concepts and describing their relationships. (Sort of like OO inheritance vs. composition — or maybe a closer analogy would be file system vs. database.)
- nradov 7y agoC++ has a concept of "friend" classes which help a little in explicitly marking some of those relationships.
- j88439h84 7y agoWhat's a better solution for identifying values?
- pavlov 7y agoRemains to be invented, I guess? It's certainly a difficult problem, and any solution will be going against 70 years of convention of programs as plain text streams. I don't think we're going to be stuck here forever though.