← Back to team overview

kicad-developers team mailing list archive

Re: indentation and code style was Re: Infinite look taking 100% cpu when building debug mode.

 

El Viernes, 25 de Abril de 2008, Dick Hollenbeck escribió:
> Raúl Sánchez Siles wrote:
> > El Jueves, 24 de Abril de 2008, Dick Hollenbeck escribió:
> >> Raúl Sánchez Siles wrote:
> >>> El Jueves, 24 de Abril de 2008, Raúl Sánchez Siles escribió:
>
> Are you sure you ran the program long enough? Remember you have to fill
> up the pipe, and the pipe is probably several hundred bytes or even a
> few kbytes. My test board was large. There is that initial output
> from Show() on the whole board, which if used against a very large board
> would help fill the pipe faster. Then even after that I have to do 20
> to 40 object selections with the mouse before the output pipe gets full
> and pcbnew stops responding.
>
Well, indeed I didn't run the program that long and the board I used wasn't 
that complex, I'll do more comprehensive tests.
>
> So unless we have run into a wxWidgets version difference, I am
> suspicious that your fix is no solution, at least not a general one.
> On the other hand, according to the documentation for wxProcess, one
> would get the idea that unless ::Redirect() is called, there should be
> no stdout redirection. So we have to allow for the possibility that a
> bug exists in my wxWidgets 2.8.4 that is fixed in your version? Are you
> on linux and using newer than 2.8.4 wxWidgets?

I'm on Debian using 2.8.7.1, but I may try with 2.6.3.2.2 for wxwidgets. 
I'll let you know. Yes, Redirect could even improve the situation, IMHO 
eeschema and pcbnew should send the output to console if kicad is not going 
to pay attention to it.

>
> > What I've noticed is the patch is somewhat noisy because changes in
> > indentation style. Where tabs were used, you changed it for white spaces.
> > I'm not sure guidelines are established for code style.
>
> Hopefully this thread will clarify the subject for you and for any
> future developers who also have the same question. Hopefully they will
> know how to use the search feature of this list.
>
>
> Over the course of the last year most of the files have been run through
> "uncrustify", the C++ beautifier which we have adopted as the official
> Kicad beautifier. I built the configuration file for the project,
> called uncrustify.cfg. Giving up a full day of my time to develop this
> file, I set that up for spaces, which is a strong preference I have over
> tabs.
>
>
> Uncrustify is the best free C++ beautifier that there is in my opinion
> and this was also a result of another full day of investigation. (So
> if you are paying attention, you know I have 2 full days of time
> expenditure in this already.) The uncrustify developer is responsive to
> bug requests, and it is a well written piece of code. You should
> install it from SVN and use it freely as you find crusty C++ code.

Easy to believe having had a look at uncrustify.cfg. Surely I'll use it as 
well and I hope that provided your experience everybody pays attention to it.

>
> Having said this, in a volunteer world, it is impossible to establish
> too many hard and fast rules about the way things are done, and old
> programmers are stubborn and some of them have tabs setup in their
> editors. But not me, I am using spaces.

You did the work so I think that style should be followed, but sure no one 
can decide for rest. I just hope to have any kind of agreement here.

>
> > As you may have noticed, I don't have a deep knowledge of kicad code,
> > but I think commits could be clearer if there would be a code style.
>
> I don't know what this means. We are hoping for perfection, and we
> expect it to happen for free. The expectations should not exceed the
> organizational capacity of an open source project. If we had a few
> corporate sponsors with real lines of authority, then more could be
> done. Having contributed about as much as anyone to this project in
> the last year, I am not convinced that we should expect too much of an
> open source model without any sponsorship. The ultimate problem is
> that those qualified to do the work *in a quality manor* generally
> cannot afford to give away their time. Most contributions come from
> folks who are bothered by something, and think they know how to fix it.
> So this ends up being, "he who does the work, gets to decide."

I meant that if everybody use the same coding style (indentation, tabs, 
spaces, etc) changes in the code would have less "style noise" and would be 
easier to read. :)

>
> > If it is, I
> > volunteer to send patches in order to comply with that style and maybe do
> > some other minor changes like code documentation/comments translations.
>
> Thank you Raúl, your help is appreciated.

Well, if people is concerned about that I can start with the converstion 
using uncrustify and the config file provided in svn.

Regards,

-- 
Raúl Sánchez Siles
 --nextPart2255261.pKK3tcAHTI Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part.

[Attachment content not displayed.] --nextPart2255261.pKK3tcAHTI--




References