Run entire codebase through GNU Indent?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Run entire codebase through GNU Indent?

Dave Crossland

Hi!

I started a discussion on Github issue tracker about this:

------------------------------------------------------------------------------

_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
Reply | Threaded
Open this post in threaded view
|

Re: Run entire codebase through GNU Indent?

Behdad Esfahbod-3
PLEASE DON'T.  It will make "git blame" useless.

On 14-07-11 12:33 PM, Dave Crossland wrote:

>
> Hi!
>
> I started a discussion on Github issue tracker about this:
>
> https://github.com/fontforge/fontforge/issues/1502
>
> --
> Cheers
> Dave
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> Fontforge-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/fontforge-devel
>

--
behdad
http://behdad.org/

------------------------------------------------------------------------------
_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
Reply | Threaded
Open this post in threaded view
|

Re: Run entire codebase through GNU Indent?

Felipe Sanches-2

One can tag the git commit immediately before the one in which GNU indent was used and then people can git-blame at that commit if they are interested in tracking authorship of code changes implemented before that.

The major question here is: what is greater? (A) The benefit of code readability by having consistent indentation accross the whole codebase or (B) The git-blame issue?

I'd say B is a tolerable issue given that there is a known workaround (as I have just described above) and that A seems to be a good thing for the project in the long term.

Happy hacking,
Felipe Sanches

Em 11/07/2014 13:40, "Behdad Esfahbod" <[hidden email]> escreveu:
PLEASE DON'T.  It will make "git blame" useless.

On 14-07-11 12:33 PM, Dave Crossland wrote:
>
> Hi!
>
> I started a discussion on Github issue tracker about this:
>
> https://github.com/fontforge/fontforge/issues/1502
>
> --
> Cheers
> Dave
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> Fontforge-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/fontforge-devel
>

--
behdad
http://behdad.org/

------------------------------------------------------------------------------
_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel

------------------------------------------------------------------------------

_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
Reply | Threaded
Open this post in threaded view
|

Re: Run entire codebase through GNU Indent?

Daniel Kahn Gillmor-7
On 07/11/2014 12:53 PM, Felipe Sanches wrote:

> One can tag the git commit immediately before the one in which GNU indent
> was used and then people can git-blame at that commit if they are
> interested in tracking authorship of code changes implemented before that.
>
> The major question here is: what is greater? (A) The benefit of code
> readability by having consistent indentation accross the whole codebase or
> (B) The git-blame issue?
>
> I'd say B is a tolerable issue given that there is a known workaround (as I
> have just described above) and that A seems to be a good thing for the
> project in the long term.
It's also worth noting that git blame has a -w option, which is
documented as:

       -w
           Ignore whitespace when comparing the parent’s version and the
           child’s to find where the lines came from.

So at least in cases where GNU indent doesn't add or remove linebreaks,
people don't even need to take Felipe's workaround.

a codebase cleanup, ideally coupled with some mechanism to prevent
future drift from the chosen convention, will be healthier for the
project in the long term, and the sooner it's done the better.

rip off the bandage :)

        --dkg


------------------------------------------------------------------------------

_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Run entire codebase through GNU Indent?

Thomas Shinnick
What will happen to lines such as this (python.c ~ line 8058):
    for ( old = sc->possub; old!=NULL && old->subtable!=sub; prev=old, old=old->next );

I'm of two minds, hating the mooted massive disfigurement and use of shredding, but liking the regularizing of code expressions to something more glanceable. 

(If you'd asked before I saw the above line of code, I'd'a just said 'no'.  But the above is the knowing output of someone far too intimate with C compilers :) )


On Fri, Jul 11, 2014 at 12:28 PM, Daniel Kahn Gillmor <[hidden email]> wrote:
It's also worth noting that git blame has a -w option, which is
documented as:

       -w
           Ignore whitespace when comparing the parent’s version and the
           child’s to find where the lines came from.

So at least in cases where GNU indent doesn't add or remove linebreaks,
people don't even need to take Felipe's workaround.

a codebase cleanup, ideally coupled with some mechanism to prevent
future drift from the chosen convention, will be healthier for the
project in the long term, and the sooner it's done the better.

rip off the bandage :)

        --dkg


------------------------------------------------------------------------------

_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel



------------------------------------------------------------------------------

_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
Reply | Threaded
Open this post in threaded view
|

Re: Run entire codebase through GNU Indent?

Frank Trampe
I spend a lot of time reverse engineering stuff in Fontforge, and I don't find the present (somewhat inconsistent) indentation style a big impediment to my work. I sometimes restyle badly formatted code as I comment it, but it's more the vast blocks of uncommented code that puzzle me, not how those are indented.



On Fri, Jul 11, 2014 at 1:09 PM, Thomas Shinnick <[hidden email]> wrote:
What will happen to lines such as this (python.c ~ line 8058):
    for ( old = sc->possub; old!=NULL && old->subtable!=sub; prev=old, old=old->next );

I'm of two minds, hating the mooted massive disfigurement and use of shredding, but liking the regularizing of code expressions to something more glanceable. 

(If you'd asked before I saw the above line of code, I'd'a just said 'no'.  But the above is the knowing output of someone far too intimate with C compilers :) )


On Fri, Jul 11, 2014 at 12:28 PM, Daniel Kahn Gillmor <[hidden email]> wrote:
It's also worth noting that git blame has a -w option, which is
documented as:

       -w
           Ignore whitespace when comparing the parent’s version and the
           child’s to find where the lines came from.

So at least in cases where GNU indent doesn't add or remove linebreaks,
people don't even need to take Felipe's workaround.

a codebase cleanup, ideally coupled with some mechanism to prevent
future drift from the chosen convention, will be healthier for the
project in the long term, and the sooner it's done the better.

rip off the bandage :)

        --dkg


------------------------------------------------------------------------------

_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel



------------------------------------------------------------------------------

_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel



------------------------------------------------------------------------------

_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
Joe
Reply | Threaded
Open this post in threaded view
|

Re: Run entire codebase through GNU Indent?

Joe
On July 11, 2014 06:49:18 PM Frank Trampe wrote:
> I spend a lot of time reverse engineering stuff in Fontforge, and I
> don't find the present (somewhat inconsistent) indentation style a big
> impediment to my work. I sometimes restyle badly formatted code as I
> comment it, but it's more the vast blocks of uncommented code that
> puzzle me, not how those are indented.

Likewise.

I find no value in aligning the code just because a tool exists that can do
it. It adds zero code fixes or improvements. What the code definitely needs
is commenting, and I've said that over and over again.

...for myself, the old code staying the way it is, also acts like a mile
marker to tell me that that code has not been analyzed yet. ...and as I go
through that particular bit of code, I re-align to what I find preferable.

NOTE: I really don't like code of this manner at all since I end up
scrolling up-down to view a portion of code instead of seeing more code per
screenfull:
int *
main(arg argv)
  {
if ( something )
  {
  }
else
  {
  }
  return x;
  }
If someone decides to align everything for the sake of alignment, I've lost
all hinting as to what's been touched/improved or not, and to that, I say,
you've touched everything - and therefore - you just inherited maintaining
all of FontForge yourself.

Was this question brought up by developers maintaining FontForge, or by
people that look at code but haven't contributed improvements?

If it was asked by developers working on code, it's a reasonable question
and problem to resolve.
If it was asked by someone that has not helped improve FontForge, I don't
see the value in adding one more impediment to those who are "actually"
working on trying to improve the code.

------------------------------------------------------------------------------
_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
Reply | Threaded
Open this post in threaded view
|

Re: Run entire codebase through GNU Indent?

Dave Crossland

Adrien is very actively contributing :)

On 12 Jul 2014 04:14, "Jose Da Silva" <[hidden email]> wrote:
On July 11, 2014 06:49:18 PM Frank Trampe wrote:
> I spend a lot of time reverse engineering stuff in Fontforge, and I
> don't find the present (somewhat inconsistent) indentation style a big
> impediment to my work. I sometimes restyle badly formatted code as I
> comment it, but it's more the vast blocks of uncommented code that
> puzzle me, not how those are indented.

Likewise.

I find no value in aligning the code just because a tool exists that can do
it. It adds zero code fixes or improvements. What the code definitely needs
is commenting, and I've said that over and over again.

...for myself, the old code staying the way it is, also acts like a mile
marker to tell me that that code has not been analyzed yet. ...and as I go
through that particular bit of code, I re-align to what I find preferable.

NOTE: I really don't like code of this manner at all since I end up
scrolling up-down to view a portion of code instead of seeing more code per
screenfull:
int *
main(arg argv)
  {
if ( something )
  {
  }
else
  {
  }
  return x;
  }
If someone decides to align everything for the sake of alignment, I've lost
all hinting as to what's been touched/improved or not, and to that, I say,
you've touched everything - and therefore - you just inherited maintaining
all of FontForge yourself.

Was this question brought up by developers maintaining FontForge, or by
people that look at code but haven't contributed improvements?

If it was asked by developers working on code, it's a reasonable question
and problem to resolve.
If it was asked by someone that has not helped improve FontForge, I don't
see the value in adding one more impediment to those who are "actually"
working on trying to improve the code.

------------------------------------------------------------------------------
_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel

------------------------------------------------------------------------------

_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
Joe
Reply | Threaded
Open this post in threaded view
|

Re: Run entire codebase through GNU Indent?

Joe
On July 12, 2014 10:33:09 AM Dave Crossland wrote:
> Adrien is very actively contributing :)

Then we have a problem to resolve and should try to comprimise somewhere in
between where Adrien is happy and other developers are happy..

------------------------------------------------------------------------------
_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel