← Back to team overview

kicad-developers team mailing list archive

Re: Was: page selection dialog, everybody please comment

 

Le 19/04/2013 13:12, Lorenzo Marcantonio a écrit :
On Fri, Apr 19, 2013 at 05:45:33AM -0500, Dick Hollenbeck wrote:
We might do well as a team by slowing down and focusing on reliability and
quality not features for awhile.  Firstly, the bugs are damaging to the
project.

Using the user visible string as an index *is* a bad practice and a bug
in the user view. Why not replacing it with a simpler enumeration? The
whole one-class-for-paper format is also debatable when a simple array
would suffice (like for the color table array).

Good or bad practice mainly depend on your criteria:
I know (and Dick knows) using an user visible string can create issues, but using an index is not better: when you insert a new item or change items order, indexes in existing files will be broken. I remember I already used indexes in config files (to identify the language to use in user interface) and have serious issues. Indexes are always an image of the internal code, and I can say using them is also a bad practice.
However they are often used because this is an easy way to store info.

Good or bad practice just depends only the most important issue you want to fix or avoid (like file readability), and the time you accept to spend to code some things.


As for the layer number issue, as I already said, you're free to search
and replace it to int. I'll do it personally if you like it. Then you're
even free to use void* for every pointer in the project. Good luck then
finding when a layer is used instead of a simple counter (or something
which is not a layer is passed in, which actually occurred a few times
in the past). Also have fun with the two layer numbers encoded in
a single variable in the via class (obviously worth the 4 byte gain for
each via).

Other than that these are only design opinions (altough type safety is
generally considered a good thing) and everybody can do whatever he want
with his own code.


Layers names, number of layers and other things related to layers (setup dialogs, DRC requirement...) are an other topic,
and I can say a *very* complicated topic that cannot be fixed in one minute.
This topic *needs* time and *very good* ideas.
(And not just a remark like "I want more layers", useless for developers)


--
Jean-Pierre CHARRAS


Follow ups

References