#5959 closed defect (invalid)
Allow selecting component name while dragging
Reported by: | massimo ceraolo | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | low | Milestone: | 1.16.0 |
Component: | OMEdit | Version: | |
Keywords: | Cc: |
Description
Whenever you drag a new model on a diagram, by default OMEdit allows you to change its name on the fly. You can, however, ask it not to do that.
Unfortunately, if you click by mistake on the checkbox requesting not to propose to insert a personalized name, it seems to be no way to get back.
I mean, I could not find any way in the Options menu to restore the default behavior.
Change History (5)
comment:1 by , 5 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:3 by , 5 years ago
There are only two hard things in Computer Science: cache invalidation and naming things.
I teach graduate courses on OOM since 2008. In my humble opinion it is essential that in all cases, except trivial toy examples, all instantiated objects receive a meaningful name. The default naming in most cases will make the results of the system model difficult to interpret a posteriori. Try inspecting the results of the simulation of non-trivial models, including examples from the MSL, which you did not build yourself, and try to figure out what they mean if default object names were used all the time.
Giving proper names to everything requires discipline, and one should learn discipline very early in school, including when playing around with toy examples, and then stick to it in professional practice.
From this point of view, I respectfully disagree with the idea that the UI is currently conveying, i.e. that the window asking for a name should be considered as a nuisance, or something for beginners, that is best dismissed very early on. It is not.
But maybe I'm being too dogmatic here, and we should allow professionals to skip this aspect. I'd like to hear what @ceraolo thinks about that :)
follow-up: 5 comment:4 by , 5 years ago
I 100% agree with you.
I've learned many years ago the huge damage names such as "pippo" or "foo" or xxx can do when you want to make something reusable that is more than a very few rows of C or C++ code.
The first level of clarity in coding comes from good naming.
Then comes the rest: good comments, (in Modelica) good in-model documentation, clean structure, supporting technical documents for the most exoteric choices, etc.
Nevertheless I myself, like anyone, when dropping a new Modelica object am often tempted to use just the proposed name.
This is bad, but not as bad as a bad variable name in a C program: the damage one can do with a Modelica diagram with generic names for its models is lower than in a C program with bad variable or object names: at least in the diagram you have the icons that visually recall what the models are and that they can do. And at least the proposed default name has some semantic linking to the model meaning and use.
I mean: Modelica language itself is a big help in creating clear models. This is very good, but better not to spoil (at least partially) this advantage using vague or plain bad model names. I opened this ticket because I'd lost the possibility to be hinted for creating a meaningful name and was couldn't find how to restore it.
BTW: When duplicating objects OMEdit does not ask for a new name and then uses the default... I always forgot to open a ticket for this, but I think it is necessary.
comment:5 by , 5 years ago
Replying to ceraolo:
I 100% agree with you.
Good :)
Nevertheless I myself, like anyone, when dropping a new Modelica object am often tempted to use just the proposed name.
This is bad, but not as bad as a bad variable name in a C program: the damage one can do with a Modelica diagram with generic names for its models is lower than in a C program with bad variable or object names: at least in the diagram you have the icons that visually recall what the models are and that they can do. And at least the proposed default name has some semantic linking to the model meaning and use.
This is true, but when you inspect the variable browser, the diagram semantics is gone, only the generic component names are visible.
I mean: Modelica language itself is a big help in creating clear models. This is very good, but better not to spoil (at least partially) this advantage using vague or plain bad model names. I opened this ticket because I'd lost the possibility to be hinted for creating a meaningful name and was couldn't find how to restore it.
I'm also a bit worried about that. Even assuming that we want to keep the possibility of turning on the instance naming window, is that really a "Notification"? I understand notifications are messages that tell you something happened. In this case, it's a dialog window, requiring some (semantically important) input. I myself I would have never thought of looking for the option there.
I mean, GUIs should be intuitive, people should not really need to consult a manual to use them. If @ceraolo, who's an experienced user, opens a ticket because he wants something back and he doesn't know how, it means it's not intuitive enough.
I have no clear solution in mind, but the current situation doesn't look fully satisfactory to me. Not a big deal, we have much more urgent issues, but yet.
Maybe move the option from Notifications to Graphical Views?
BTW: When duplicating objects OMEdit does not ask for a new name and then uses the default... I always forgot to open a ticket for this, but I think it is necessary.
See #5967.
Tools->Options->Notifications
checkAlways ask for the dragged component name
.https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/omedit.html#notifications