5

I have this question Guidance in naming awkward domain-specific objects? open on P.SE currently.

My original focus is captured in the title, specifically I was worried about naming.

Several of the answers and comments have suggested not using an enum, which takes the question in an unexpected direction.

I think that whether or not an enum should be used would be a separate question from my original question, but I recognize that my semi-arbitrary decision to use an enum is complicating the community's ability to provide solid answers.

I will attempt to clarify my original question and show why I think an enum is required, but I'm concerned that I'll be derailing the original question by doing that.

So what's the best way to handle a situation where the original question is somewhat dependent upon a technology choice that could also be subjected to a question of its own?

Update - here's the new question over on [main]

2 Answers 2

5

The problem is that many people ask questions about how to deal with problems caused by a prior incorrect decision. The correct solution is to revisit the previous wrong decision, not solving whatever question they find themselves dealing with now. Effectively, they've asked for help in treating the symptoms, but it'd be better to treat the problem.

In your particular case, it does seem strange that chemical compounds are named objects in the code rather then objects the system acts upon. Maybe you've got a good reason for doing it that way. So far the comments in your question about it are too vague for me to judge. At first glance it looks like your naming problem is just a symptom of the problem that chemical compounds are named objects in your code at all. But I can't discount the possibility that you've got good reasons.

So, I think you can't tell people not to ask questions about prior technical decisions. Prior technical decisions are often wrong, and often need to be questioned. Its always possible that your current technical question is only coming up because of a poorly made decision earlier on.

As I see it, I don't think you've got a problem in that question. You've got a couple of answers that go after the enum issue, but most of the response has been more on the topic of what you asked.

1
  • Thanks for the feedback, and I've just updated the question so it may be more clear. I don't quite understand why there is the concern with using an enum, but I'm happy to learn and find out. :-) Regrettably, this is new code, so I'm setting the precedent. I will be the villainous programmer who left crud code behind. So I would like to set it up right.
    – user53019
    Dec 20, 2012 at 1:05
0

Doc Brown made a very good comment in the main question that I wanted to capture:

I think the real problem here for some folks here is "why do chemical names have to be in the code at all"? Having those names only as some form of data would avoid cluttering your code with very long names, and you could choose the names just like the user of your system prefers, independently from what a developer might think about them. That would delegate the naming responsibility to the user and avoid your problem completely.

You must log in to answer this question.