41
votes
Accepted
Why don't programming languages or IDEs support attaching descriptive metadata to variables?
Why doesn't it exist?
The direct answer here is that this isn't technically impossible, no one has just been sufficiently bothered enough by it to create a field-spanning standard that everyone can ...
39
votes
Why don't programming languages or IDEs support attaching descriptive metadata to variables?
TLDR
Decomposition makes names shorter. Do not fight symptoms, solve underlying problem instead.
Scope is important
Naming is the hardest problem, not because long names are not readable, but because ...
28
votes
Why don't programming languages or IDEs support attaching descriptive metadata to variables?
Java and C# at least have this sort of feature. Javadoc is the system for it in the Java context, Documentation comments in C# context. Indeed, that’s how IDEs provide on-hover info at all.
Generally ...
12
votes
Why don't programming languages or IDEs support attaching descriptive metadata to variables?
It's a good question, and some IDEs do have the functionality you suggest, but virtually all programming languages and IDEs have the simple ability to add comments like so:
// The lowest integer ...
6
votes
Why don't programming languages or IDEs support attaching descriptive metadata to variables?
As detailed by the previous answers, there are both IDEs and Programming languages do have support for this.
Support comes in three general categories:
Documentation in the code that must be ...
5
votes
Why don't programming languages or IDEs support attaching descriptive metadata to variables?
Looks like you're programming in Python, so to start with that as an example: There's absolutely something like this! They're called "docstrings" (short for documentation strings), because ...
3
votes
Why don't programming languages or IDEs support attaching descriptive metadata to variables?
Some languages such as Java, C#, Python and others already have built-in capabilities for this: respectively, Java's JavaDoc comment format, C#'s documentation comment format, and the various ...
2
votes
Why don't programming languages or IDEs support attaching descriptive metadata to variables?
They have, by moving to OOP. There’s all kinds of tools for adding meta data to class values from xml markup to attributes and even whether they are properties or not.
But it sounds like you are ...
1
vote
Why is it called Data-Oriented Design?
For a moment I was going to ask what the question actually was, then I remembered it was in title.
I agree "data-oriented design" is a pretty obtuse and uppity term.
The term seems to ...
1
vote
Why don't programming languages or IDEs support attaching descriptive metadata to variables?
To add an example language + environment that does support this: Factor!
If you'll forgive my non-default prompt (🦖):
🦖 SYMBOL: lowest-bound
🦖 10 lowest-bound set
🦖 HELP: lowest-bound { $...
1
vote
Why don't programming languages or IDEs support attaching descriptive metadata to variables?
Been there, done that.
In a language called MDL (aka MUDDLE) it was possible to associate any object with any other object, and give the association a name, such as "comment". This means ...
1
vote
Naming for a layer between controller and domain logic
I feel it would really make sense to separate this logic as a layer between the controller and service, so that the service layer can focus on manipulating objects without regard to who or what ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
naming × 660naming-standards × 96
c# × 61
coding-standards × 58
java × 50
coding-style × 46
variables × 38
design × 30
object-oriented × 28
terminology × 28
design-patterns × 27
functions × 23
conventions × 23
programming-practices × 22
methods × 21
javascript × 19
c++ × 18
python × 17
.net × 17
language-agnostic × 16
clean-code × 16
api-design × 15
packages × 15
php × 14
interfaces × 14