Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splitting source file/s for better readability #89

Open
tansy opened this issue Mar 15, 2021 · 4 comments
Open

Splitting source file/s for better readability #89

tansy opened this issue Mar 15, 2021 · 4 comments

Comments

@tansy
Copy link

tansy commented Mar 15, 2021

I kindly suggest to split source file (pigz.c) into separate files for better readability and, let's call it compatibility, with *nix source convention. Split in two categories:
documentation and source itself.
By documentation I mean license, change log, to-do list, and stuff, that resides in pigz.c, and by source I mean splitting it into smaller, categorized pieces. I was thinking about three, maybe four:

  1. main loop, usage and this kind of functions,
  2. multi threading
  3. de/compression
  4. maybe file/system functions.

I actually attempted to do that with documentation; it can be seen here (it's emporary tar.bz2 ball), and out looks like this:

.
./ChangeLog
./LICENSE
./Makefile
./README
./TODO
./doc/
./doc/pigz.1
./doc/pigz.info
./doc/pigz.pdf
./doc/pigz.spec
./pigz.c
./try.c
./try.h
./yarn.c
./yarn.h
./zopfli/
 

With pigz.c didn't dare to be honest, but I would say that scrolling through 5k lines of code is difficult and tiresome.

@madler
Copy link
Owner

madler commented Mar 16, 2021

I will consider it, but you would still have 5K lines of code to slog through.

@madler
Copy link
Owner

madler commented Mar 16, 2021

By the way, the .spec file is a build file, not documentation. It needs to be with the source.

@tansy
Copy link
Author

tansy commented Mar 16, 2021

Even moving documentation and all that stuff, out of pigz.c is good move. You may insist with license but that should be in separate file if it applies to the files other than source itself.

And yes, You're right about .spec file, I didn't register that.

@tomek-szczesny
Copy link

Well, actually yarn.c is a separate file already (for threading), but I kinda agree it's a bit intimidating to read through pigz.c for the first time. It may be beneficial from the educational perspective to divide pigz.c into smaller chunks.
That's just a humble opinion though, I am merely the one that tries to learn here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants