← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Saving plot dialog settings

 

>> Following function is bound to conflict in global namespace, make static and
>> shorten name considerably is suggested.  If its static and local, you could
>> make it EXTREMELY short even a just a couple of characters.
>>
>>> +
>>> +const char* GetTokenName( T aTok )
> Will be changed to static. Could maybe use namespace, too (?). But why
> very short? GTN isn't very informative.


:)

I'm only answering because you asked:

I assumed you liked short too.  If not, then you could simply remove this
wrapper function and use the static one in the lexer.  But that is long and
noisy no?, because you have to include the classname in the invocation right?

There's little mystery in the purpose of the function or macro, and you have
tremendous repetition to reinforce the function's purpose in the mind of the
human reader.  Being readable is important, for me that translates to "the
less noise the better". 

I might even use a macro, not a function, and have it be a single character
macro name, like N(),  TN(), GTN().  It touches nothing outside this file. 
It can be this file's own little secret. Any human who wants to be informed,
has to be informed only once, and can be informed by looking at the top of
the file.

This is my opinion, it is a weak personal preference, not a passionate
concern, and I answered because you asked.

As you know, there is often more than one suitable way to code things up.

Dick




Follow ups

References