<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39450 >
Ulrik Sverdrup wrote:
> 2007/7/13, William Allen Simpson <[EMAIL PROTECTED]>:
>> No, that would be rule_name() and translated_name()!!!!
> I understand. I just try to think of that others who are not freeciv
> coders should eventually use the interface, so I thought our
> consistency standards didn't apply in the same way.
1) Non-C coders need even longer and more descriptive functions, as they
are less likely to read the underlying C code itself.
2) Consistency is even more important. We'll have to debug their code.
> I thought: If we use both, one should be :name() to make sure that it
> is the one you want to use in user messages.
Hell, no! The lack of clear distinction was what caused me to waste
nearly all of my free time for a month to fix this crap. Particularly
irksome that prior coders had identified the problem, and left comment
blocks about it, but left it for somebody else....
> If we only make the translated name available, it should be clear that
> it is not the rule name, so it should be name_translated()
No, it should be translated_name()!!!! Consistency, always consistency.
You don't want to have to grep half a dozen possible function names,
even in this small project. That gets rapidly tiresome, and you miss
> No. I only thought it might be an abstraction thing; as you said
> during the transition you wished that more code used the accessor
Damned straight! Some parts of this code are nicely done. Others
are/were a mess, and difficult to fix because folks didn't use the
*existing* accessor functions.
Abstraction was developed by computer scientists for a reason. It's not
just an undergraduate exercise.
> But on the other hand I agree that it is easy to write them both. Much
> of the api generation for us is just many, many easily written short
> pieces of code and this is just more of that.
Freeciv-dev mailing list