kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #06107
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
-
[PATCH] Saving plot dialog settings
From: Marco Mattila, 2011-01-02
-
Re: [PATCH] Saving plot dialog settings
From: Marco Mattila, 2011-01-03
-
Re: [PATCH] Saving plot dialog settings
From: Dick Hollenbeck, 2011-01-05
-
Re: [PATCH] Saving plot dialog settings
From: Wayne Stambaugh, 2011-01-05
-
Re: [PATCH] Saving plot dialog settings
From: Marco Mattila, 2011-01-05
-
Re: [PATCH] Saving plot dialog settings
From: Dick Hollenbeck, 2011-01-05
-
Re: [PATCH] Saving plot dialog settings
From: Dick Hollenbeck, 2011-01-05
-
Re: [PATCH] Saving plot dialog settings
From: jp.charras, 2011-01-05
-
Re: [PATCH] Saving plot dialog settings
From: Marco Mattila, 2011-01-05
-
Re: [PATCH] Saving plot dialog settings
From: Dick Hollenbeck, 2011-01-05
-
Re: [PATCH] Saving plot dialog settings
From: Marco Mattila, 2011-01-27
-
Re: [PATCH] Saving plot dialog settings
From: Dick Hollenbeck, 2011-01-27
-
Re: [PATCH] Saving plot dialog settings
From: Marco Mattila, 2011-01-28