← Back to team overview

kicad-developers team mailing list archive

Re: Re: New coding guidelines.

 

Vesa Solonen wrote:
to, 2009-01-01 kello 14:38 +0000, wafeliron kirjoitti:

I agree with you both,
Coding style is different taste for everyone. But i think there should
be some clear guidelines about the style is used by KiCad Project. Or
else it would be mixed with different styles and ideas.


Second that. For function and variable naming especially. Then there are
personal tastes for tabs/spaces and more or less spaces. The spaces
issue must be solved at the code editor level and that's where tabs are
good. Everyone is free to choose whatever editing presentation they wish
by configuring their editor, but code stays the same. Not to mention
saving bytes for the future use ;)

-Vesa




I won't use tabs, sorry. So if you want my ca. 12,000 lines of code per year, forget selling tabs here. Wrong project, wrong developer.

I recently spent some time and learned Python 3.0. The consensus among Python developers is to use spaces not tabs.

So there is no reason to think that spaces are fundamentally flawed. They are not.

The problem with tabs comes about with disagreements on the interpretation of tabs among editors. And this scope of disagreement includes not only leading tabs but tabs after some initial text. That is where tabs break down and lead to maintenance problems. Space are unambiguous and cannot be misinterpreted.


It's moot. I won't tabs. And that decision was made about 18 years ago.


See here for my first Python program.
http://freehg.org/u/dickelbeck/xsvf_tools/

You need to use Mercurial to check it out.

This is an excellent language, and I am now more sure than ever that this is the proper choice for any scripting support in Kicad.

The equivalent program in C/C+ is about 3200 lines of text. Python was about 5 times fewer lines.

The above program creates a binary form of the JTAG svf file for use by OpenOCD so it can program FPGAs.


Dick








References