Re: [Kicad-developers] Why ALL capital letters for classes and typedefs

2012-06-23 Thread Dick Hollenbeck
On 06/22/2012 05:55 PM, Alexander Lunev wrote:
 I believe most developers agree to follow some project predetermined coding 
 style policy...

 According to the KiCad coding style policy, constants and macro names should 
 be
 comprised of all capital letters (it is common, that is OK). However, 
 according to the
 policy, classes and typedefs should be designated in the same way (all 
 capital letters).
 So it is easier to get confused while reading the source code, especially for 
 developers
 who get used to names written in all capital letters and implied as either 
 constants or
 macros.

 As for me, wxSomeClass and kiSomeClass names are quite good ones. I think 
 these examples
 are still in conformance with the common convention. wx and ki are just 
 prefixes to
 highlight a subset of classes.


The kicad coding standards clearly state the classnames are to be uppercase.
I am quite certain that Wayne will go ballistic if this stops being enforced.

Get over it.  That decision has been made, and I personally spent about $30,000 
of my time
getting the code base this way.

In total there has probably been $70,000 spent on it, and about 45% of that is 
from Wayne.

So do you think you have a chance at making this case name argument?  Not on 
this planet,
not in this project.





___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Why ALL capital letters for classes and typedefs

2012-06-23 Thread Miguel Angel Ajo Pelayo
Hi guys, I think this is nothing to be changed right now.

Those are the kind of changes that can be made to a project just in certain
moments
(like the time when there are no branches from main sources -and we have
serveral,
mine included-).

If you start changing capitalization on all files around you'll get DVCS
branches broken,
and it will lead to a lot of useless work, a work that will give very
little gain.

I agree that the current standard could lead to little confusion sometimes,
but it's not bad at
all, it gives uniformity to our source code, and it's more than enough.

My 2 cents.



2012/6/23 Dick Hollenbeck d...@softplc.com

 On 06/22/2012 05:55 PM, Alexander Lunev wrote:
  I believe most developers agree to follow some project predetermined
 coding style policy...
 
  According to the KiCad coding style policy, constants and macro names
 should be
  comprised of all capital letters (it is common, that is OK). However,
 according to the
  policy, classes and typedefs should be designated in the same way (all
 capital letters).
  So it is easier to get confused while reading the source code,
 especially for developers
  who get used to names written in all capital letters and implied as
 either constants or
  macros.
 
  As for me, wxSomeClass and kiSomeClass names are quite good ones. I
 think these examples
  are still in conformance with the common convention. wx and ki are just
 prefixes to
  highlight a subset of classes.


 The kicad coding standards clearly state the classnames are to be
 uppercase.
 I am quite certain that Wayne will go ballistic if this stops being
 enforced.

 Get over it.  That decision has been made, and I personally spent about
 $30,000 of my time
 getting the code base this way.

 In total there has probably been $70,000 spent on it, and about 45% of
 that is from Wayne.

 So do you think you have a chance at making this case name argument?  Not
 on this planet,
 not in this project.





 ___
 Mailing list: https://launchpad.net/~kicad-developers
 Post to : kicad-developers@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~kicad-developers
 More help   : https://help.launchpad.net/ListHelp




-- 

Miguel Angel Ajo Pelayo
http://www.nbee.es
+34 636 52 25 69
skype: ajoajoajo
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Why ALL capital letters for classes and typedefs

2012-06-23 Thread Lorenzo Marcantonio
On Sat, Jun 23, 2012 at 04:09:48PM +0200, Miguel Angel Ajo Pelayo wrote:
 If you start changing capitalization on all files around you'll get DVCS
 branches broken,
 and it will lead to a lot of useless work, a work that will give very
 little gain.

Having merge conflicts just because someone reindented variable names also is 
somewhat disturbing (but nothing to lose sleep at...)

 I agree that the current standard could lead to little confusion sometimes,
 but it's not bad at
 all, it gives uniformity to our source code, and it's more than enough.

Personally I have no problem with *any* standard, if there is some motivation
underlying and its feasible with an editor :D

I (even) worked for a cobol shop (on the Y2K issue!) where some statement was 
forbidden because in 1960 mainframes it was slow... of course IBM fixed the 
problem way time ago but evidently the IT manager was not up to date with 
the state of the art XD

And of course, everything in upper case strictly between column 12 and 72... so 
there are worst coding standards around :P:P

Anyway I think strange that so few people uses the official C++ coding 
convention (these used in the std:: library). But we have worse problems:P

-- 
Lorenzo Marcantonio
Logos Srl

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Why ALL capital letters for classes and typedefs

2012-06-23 Thread Wayne Stambaugh

On 6/23/2012 8:39 AM, Dick Hollenbeck wrote:

On 06/22/2012 05:55 PM, Alexander Lunev wrote:

I believe most developers agree to follow some project predetermined coding 
style policy...

According to the KiCad coding style policy, constants and macro names should be
comprised of all capital letters (it is common, that is OK). However, according 
to the
policy, classes and typedefs should be designated in the same way (all capital 
letters).
So it is easier to get confused while reading the source code, especially for 
developers
who get used to names written in all capital letters and implied as either 
constants or
macros.

As for me, wxSomeClass and kiSomeClass names are quite good ones. I think these 
examples
are still in conformance with the common convention. wx and ki are just 
prefixes to
highlight a subset of classes.



The kicad coding standards clearly state the classnames are to be uppercase.
I am quite certain that Wayne will go ballistic if this stops being enforced.

Get over it.  That decision has been made, and I personally spent about $30,000 
of my time
getting the code base this way.

In total there has probably been $70,000 spent on it, and about 45% of that is 
from Wayne.

So do you think you have a chance at making this case name argument?  Not on 
this planet,
not in this project.




I don't know if I would go ballistic but I do know one thing I would not 
do and that is convert code as it stands now to another coding standard 
after all the time and effort I spent getting the original code into the 
current format.  The KiCad coding standards were agreed upon quite a few 
years ago by the lead developers.  At that time there were very few 
other people involved in the project let alone willing to step up to the 
plate and take on that task.  So I volunteered and with the input of 
Dick and JP set out to write to coding policy.  The project has done 
just fine since the project has adopted the coding policy and most of 
legacy code has been revised to meet the policy.  There are a few places 
where the legacy code still hasn't been updated but that should be 
getting fairly uncommon.


Coding standards whether you like them or not are important for two 
reasons.  The second most important reason is consistency.  As stated in 
the coding policy, the only thing worse than looking at code formatted 
in a style that you don't like is looking at 10 different formats that 
you don't like in the same source file.  I think we can all agree on 
that.  The most important reason to follow coding standards is in order 
to show respect of the work done by everyone who came before you.  If 
you can understand this, then understanding the consistency part is 
mute.  I hate the GNU coding standards but if I were to ever submit any 
code to a GNU project, you can be rest assured that it would follow the 
GNU coding standards without complaint.  The reason I would do this is 
that I respect the efforts of the developers of that project even if I 
don't like there coding style.


I would like to propose an experiment.  Join the Linux kernel mailing 
list and publicly scold Linus about how much you don't like Linux kernel 
coding style.  Then sit back and wait for a response.  I can assure you 
that the response on this mailing list is positively docile compared to 
what you would get on the Linux kernel mailing list.



Wayne


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Why ALL capital letters for classes and typedefs

2012-06-23 Thread Lorenzo Marcantonio
On Sat, Jun 23, 2012 at 01:38:21PM -0400, Wayne Stambaugh wrote:

 I don't know if I would go ballistic but I do know one thing I would
 not do and that is convert code as it stands now to another coding
 standard after all the time and effort I spent getting the original
 code into the current format.  The KiCad coding standards were

I personally wouldn't have touched the original code... usually we (at work) we
set a standard from that point on. Unless there is a complete code freeze that
would create unnecessary diffs which would be *extremely* inconvenient for
other developers (especially branchers).

 stated in the coding policy, the only thing worse than looking at
 code formatted in a style that you don't like is looking at 10
 different formats that you don't like in the same source file.  I
 think we can all agree on that.  The most important reason to follow

I actually I'm being used to read code written and patched in decades by
different teams (with questions like: why all the labels are 6 characters
long? because one of the previous developers was used to *another system*
which had that limitation). Given that I'm in system integration/adaptation
maybe that's uncommon for other developers:P

 coding standards is in order to show respect of the work done by
 everyone who came before you.  If you can understand this, then
 understanding the consistency part is mute.  I hate the GNU coding

No issue for me; as I said just tell how you need it done:D the *really* fun
standards are these like MISRA C with rules like (more or less) you can't use
pointers. Good luck with them!

 I would like to propose an experiment.  Join the Linux kernel
 mailing list and publicly scold Linus about how much you don't like
 Linux kernel coding style.  Then sit back and wait for a response.

Naah I don't think its that so anymore. I was referring *exactly* to Torvalds
when I talked about dictatorships... (he seems to also hate GNU coding
standards, like many others...  From CodingStyle)

First off, I'd suggest printing out a copy of the GNU coding standards,
and NOT read it.  Burn them, it's a great symbolic gesture

Given that premise the outcome of the experiment would be clear (but he also
says that standards are not exactly mandatory, but must be taken in
consideration)

-- 
Lorenzo Marcantonio
Logos Srl

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] Why ALL capital letters for classes and typedefs

2012-06-22 Thread Alexander Lunev
The KiCad coding style policy contains the requirement: Class, typedef, enum, 
name space, and macro names should be comprised of all capital letters.
My question is why should CLASSES and TYPEDEFs be comprised of ALL capital 
letters? What is the reason for that?

The most common convention that I have ever seen before sounds like:
A class name should begin with a capital letter and be written in mixed case 
(e.g., String). If a class name consists of more than one word, each word 
should begin with a capital letter (e.g., StringBuffer). If a class name, or 
one of the words of a class name, is an acronym, the acronym can be written in 
all capital letters (e.g., URL, HTMLParser).


Best regards,
Alexander Lunev___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Why ALL capital letters for classes and typedefs

2012-06-22 Thread Lorenzo Marcantonio
On Fri, Jun 22, 2012 at 01:02:18AM -0700, Alexander Lunev wrote:
 The KiCad coding style policy contains the requirement: Class, typedef, 
 enum, name space, and macro names should be comprised of all capital letters.
 My question is why should CLASSES and TYPEDEFs be comprised of ALL capital 
 letters? What is the reason for that?
 
 The most common convention that I have ever seen before sounds like:
 A class name should begin with a capital letter and be written in mixed case 
 (e.g., String). If a class name consists of more than one word, each word 
 should begin with a capital letter (e.g., StringBuffer). If a class name, or 
 one of the words of a class name, is an acronym, the acronym can be written 
 in all capital letters (e.g., URL, HTMLParser).

Well that's not the strangest coding convention in kicad :P just ask our
tyrannical leaders, they'll just say they can't read them otherwise.

Oh well, I've no issues with that...


-- 
Lorenzo Marcantonio
Logos Srl

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Why ALL capital letters for classes and typedefs

2012-06-22 Thread jean-pierre charras

Le 22/06/2012 10:16, Lorenzo Marcantonio a écrit :

On Fri, Jun 22, 2012 at 01:02:18AM -0700, Alexander Lunev wrote:

The KiCad coding style policy contains the requirement: Class, typedef, enum, name 
space, and macro names should be comprised of all capital letters.
My question is why should CLASSES and TYPEDEFs be comprised of ALL capital 
letters? What is the reason for that?

The most common convention that I have ever seen before sounds like:
A class name should begin with a capital letter and be written in mixed case (e.g., 
String). If a class name consists of more than one word, each word should begin with a 
capital letter (e.g., StringBuffer). If a class name, or one of the words of a class 
name, is an acronym, the acronym can be written in all capital letters (e.g., URL, 
HTMLParser).


Well that's not the strangest coding convention in kicad :P just ask our
tyrannical leaders, they'll just say they can't read them otherwise.

Oh well, I've no issues with that...




First of all KiCad coding style is not a whim of developers,
and it is not intended to be the best rules never seen to write code.

It is a set of rules to keep KiCad sources easy to read and maintain.
The first requirement is all sources should have the same look.

Therefore KiCad coding style define a set of rules to do that.

Class, enum ... names must have a style (the same in all files).
You can use:
- names starting with a capital letter and written in mixed case.
- names starting always by a given prefix like ki or Ki or KI for kicad 
(like in wxWidgets).
- names in capital letters only

and much more.

By a decision must be taken: it was names in capital letters only

The advantage is class names area easy to identify when reading a file,
because other words are not capitalized.

Some others tricks are used to easily identify variables:
argument variables have a name starting by 'a' (like aCount, aValue)
local variables have the first letter never capitalized ( countmax or countMax)
global variables have the first letter always capitalized ( Countmax or 
CountMax)
class members variables have a name starting by m_ ( m_count, m_Count )
   public members variables have the first letter after m_ always capitalized  
(m_Count)
   public members variables have the first letter after m_ always not 
capitalized  (m_count)
   or just written like local variables (count) .
   ( I prefer the name m_count to count )

See KiCad coding style for many other rules.

Developers *know* other rules are widely used, but to write KiCad coding style
decisions must be taken.

Rules in KiCad coding style are not always rules used by some contributors 
when they are not working on KiCad,
but I am thinking KiCad coding style should be acceptable by everybody.

Strange coding convention is usually coding conventions used by others
Therefore there is a *lot* of Strange coding conventions
(usually coding conventions that do not match *my* coding convention)

At last, the best answer to
Why should CLASSES and TYPEDEFs be comprised of ALL capital letters
could by: why not?

Thanks to developers who carefully read the KiCad coding style rules.
I am sure you could find some good ideas inside.

--
Jean-Pierre CHARRAS




___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Why ALL capital letters for classes and typedefs

2012-06-22 Thread Alexander Lunev
I believe most developers agree to follow some project predetermined coding 
style policy...

According to the KiCad coding style policy, constants and macro names should be 
comprised of all capital letters (it is common, that is OK). However, according 
to the policy, classes and typedefs should be designated in the same way (all 
capital letters). So it is easier to get confused while reading the source 
code, especially for developers who get used to names written in all capital 
letters and implied as either constants or macros.

As for me, wxSomeClass and kiSomeClass names are quite good ones. I think these 
examples are still in conformance with the common convention. wx and ki are 
just prefixes to highlight a subset of classes.

Also as you said it is good practice to use members variables starting with 
m_ but there is no mention of it in the KiCad coding style policy.

Alexander Lunev



 From: jean-pierre charras jp.char...@wanadoo.fr
To: kicad-developers@lists.launchpad.net 
Sent: Friday, June 22, 2012 8:44 PM
Subject: Re: [Kicad-developers] Why ALL capital letters for classes and typedefs
 
Le 22/06/2012 10:16, Lorenzo Marcantonio a écrit :
 On Fri, Jun 22, 2012 at 01:02:18AM -0700, Alexander Lunev wrote:
 The KiCad coding style policy contains the requirement: Class, typedef, 
 enum, name space, and macro names should be comprised of all capital 
 letters.
 My question is why should CLASSES and TYPEDEFs be comprised of ALL capital 
 letters? What is the reason for that?

 The most common convention that I have ever seen before sounds like:
 A class name should begin with a capital letter and be written in mixed 
 case (e.g., String). If a class name consists of more than one word, each 
 word should begin with a capital letter (e.g., StringBuffer). If a class 
 name, or one of the words of a class name, is an acronym, the acronym can be 
 written in all capital letters (e.g., URL, HTMLParser).

 Well that's not the strangest coding convention in kicad :P just ask our
 tyrannical leaders, they'll just say they can't read them otherwise.

 Oh well, I've no issues with that...



First of all KiCad coding style is not a whim of developers,
and it is not intended to be the best rules never seen to write code.

It is a set of rules to keep KiCad sources easy to read and maintain.
The first requirement is all sources should have the same look.

Therefore KiCad coding style define a set of rules to do that.

Class, enum ... names must have a style (the same in all files).
You can use:
- names starting with a capital letter and written in mixed case.
- names starting always by a given prefix like ki or Ki or KI for kicad 
(like in wxWidgets).
- names in capital letters only

and much more.

By a decision must be taken: it was names in capital letters only

The advantage is class names area easy to identify when reading a file,
because other words are not capitalized.

Some others tricks are used to easily identify variables:
argument variables have a name starting by 'a' (like aCount, aValue)
local variables have the first letter never capitalized ( countmax or countMax)
global variables have the first letter always capitalized ( Countmax or 
CountMax)
class members variables have a name starting by m_ ( m_count, m_Count )
    public members variables have the first letter after m_ always capitalized  
(m_Count)
    public members variables have the first letter after m_ always not 
capitalized  (m_count)
    or just written like local variables (count) .
    ( I prefer the name m_count to count )

See KiCad coding style for many other rules.

Developers *know* other rules are widely used, but to write KiCad coding style
decisions must be taken.

Rules in KiCad coding style are not always rules used by some contributors 
when they are not working on KiCad,
but I am thinking KiCad coding style should be acceptable by everybody.

Strange coding convention is usually coding conventions used by others
Therefore there is a *lot* of Strange coding conventions
(usually coding conventions that do not match *my* coding convention)

At last, the best answer to
Why should CLASSES and TYPEDEFs be comprised of ALL capital letters
could by: why not?

Thanks to developers who carefully read the KiCad coding style rules.
I am sure you could find some good ideas inside.

-- 
Jean-Pierre CHARRAS




___
Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp