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

Separate modules in smaller modules #14

Closed
2 tasks done
aruZeta opened this issue Sep 2, 2022 · 5 comments
Closed
2 tasks done

Separate modules in smaller modules #14

aruZeta opened this issue Sep 2, 2022 · 5 comments
Labels
roadmap This ISSUE or PR is part of the roadmap of the project.

Comments

@aruZeta
Copy link
Owner

aruZeta commented Sep 2, 2022

For example: the DrawedQRCode.nim module is 438 lines long (527 after #15), having some unnecessary procedures not used out of it (except for tests) which make it a really large module.

Instead, it should be separated in other modules (under a directory by the name of the main module), each having a main section of what the main module really needs: in this case it would be the procedures used by draw(), so a module for drawFinderPatterns, drawAlignmentPatterns, etc.

There are other cases, like the qr*.nim modules which were already made like that in order to easily be imported, and would also be the case for BitArray.nim since it only implements less than a handful of procedures (and most of the lines are doc comments themselves).

- [ ] Drawing.nim
- [ ] QRCode.nim

  • EncodedQRCode.nim
  • DrawedQRCode.nim
@aruZeta
Copy link
Owner Author

aruZeta commented Sep 2, 2022

Also would be nice to do the same with the tests ... but that will be on another issue.

@aruZeta
Copy link
Owner Author

aruZeta commented Sep 2, 2022

Change of plans, removing Drawing.nim from the list since what actually makes it so big is the print procedures, which actually make no sense having them since they are only used by DrawedQRCode so it would make more sense to have those moved there, opening an issue for that rn. (Edit: check #15)

@aruZeta
Copy link
Owner Author

aruZeta commented Sep 2, 2022

Removing also QRCode.nim since it's not even 100 lines long.

@aruZeta aruZeta changed the title Separate modules in more little modules Separate modules in smaller modules Sep 2, 2022
aruZeta added a commit that referenced this issue Sep 2, 2022
@aruZeta
Copy link
Owner Author

aruZeta commented Sep 3, 2022

I've encountered an issue when importing 2 modules named main.nim, where I need to use the as operator to change it's name when imported I can't seem to make work with the way I structure imports, hence I'm changing a bit the structure of these separated modules.

aruZeta added a commit that referenced this issue Sep 3, 2022
aruZeta added a commit that referenced this issue Sep 3, 2022
@aruZeta
Copy link
Owner Author

aruZeta commented Sep 3, 2022

Now it all seems better organized!

@aruZeta aruZeta closed this as completed Sep 3, 2022
@aruZeta aruZeta mentioned this issue Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
roadmap This ISSUE or PR is part of the roadmap of the project.
Projects
No open projects
Status: DONE
Development

No branches or pull requests

1 participant