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

Folder names and structure of extensions of the pure translation project #22

Closed
Free-Pascal-meets-SDL-Website opened this issue Aug 29, 2021 · 5 comments

Comments

@Free-Pascal-meets-SDL-Website
Copy link
Collaborator

As the project grows more complex, we need to decide on senseful names and folder structure of project extensions (e. g. examples, tests, docs,...) which are not directly related to the original sdl2 package. Otherwise the main folder will be polluted with all kinds of different files which complicates everything unncecessarily.

The main goal is to make clear from the folder names that these contain files which are not directly related to the original sdl2 lib.

My proposal would be a prefix "pascal" to make this clear:

E.g.
\ (main source, as is)
\pascaldocs\
\pascalexamples\
\pascaltests\

The substructure in these folders could then be as expected:
\pascalexamples\renderbitmap\
\pascalexamples\handleevents\

Please let us discuss if there are other and/or better ways to keep the files ordered.

@suve
Copy link
Collaborator

suve commented Aug 29, 2021

I don't think there's much sense in prefixing stuff with pascal; it's pretty clear from the repo's name and README that this is just a header translation and not some new, extra library. I wonder, though, if it wouldn't be best to move the unit files themselves from repository root to /src or maybe /units.

Speaking of docs, currently we're mostly just taking the original C source and leaving the original doc-comments as-is. I think this is rather pointless, since I imagine that someone looking for information on how to use SDL will just consult the official documentation at wiki.libsdl.org, rather than browse the .pas / .inc files. As such, I think there's two things we could do:

  1. Try to convert the documentation to FPDoc format so we can generate a reference page similar to FPC's official docs.
  2. Just remove the docs from the source, limiting the files to containing only actual type/function definitions.

@Free-Pascal-meets-SDL-Website
Copy link
Collaborator Author

I don't think there's much sense in prefixing stuff with pascal; it's pretty clear from the repo's name and README that this is just a header translation and not some new, extra library. I wonder, though, if it wouldn't be best to move the unit files themselves from repository root to /src or maybe /units.

Well, I see your point. I'm also not fully happy with a prefix "pascal" either,

About /src or /units. I strongly like to suggest /units. It is clear from the name that there will be Pascal units in there and it cannot be confused with the folder /src of the original SDL2 package.

I'd like to suggest, too, that we add a folder /include where we put all the inc files. This would be highly in accordance with the original package. What do you think?

Speaking of docs, currently we're mostly just taking the original C source and leaving the original doc-comments as-is. I think this is rather pointless, since I imagine that someone looking for information on how to use SDL will just consult the official documentation at wiki.libsdl.org, rather than browse the .pas / .inc files. As such, I think there's two things we could do:

1. Try to convert the documentation to [FPDoc format](https://www.freepascal.org/docs-html/fpdoc/fpdoc.html) so we can generate a reference page similar to FPC's official docs.

2. Just remove the docs from the source, limiting the files to containing only actual type/function definitions.

I disagree about the notion that everybody will always look up everything on the wiki pages, but never in the code itself. Lazarus will display the comments above a function declaration fairly quickly and it can help a lot, especially if you are not about to study the package but just need a quick reminder of the return values or something similar.

So, I strongly suggest to go with way 1. - I will add this to the todo list.

@suve suve mentioned this issue Sep 3, 2021
@Free-Pascal-meets-SDL-Website
Copy link
Collaborator Author

Proposal of a structure:

\ for README, LICENSE, ...
\units\ for sdl2.pas, sdl2_image.pas, ...
\units\include\ for all the inc-files used by sdl2.pas; Note: No plural "includes" to be consistent with original C pack folder name
\tests\ for test programs used by GHA
\tests\test1\ for each test a subfolder
\examples\ for sdl2/pascal example programs
\examples\example1\ for each example a subfolder
\docs\ for documentation/FPDocs

What do you think?

@suve
Copy link
Collaborator

suve commented Sep 8, 2021

I'm not really sold on the /units/include part. Other than that, full support.

Free-Pascal-meets-SDL-Website added a commit to Free-Pascal-meets-SDL-Website/SDL2-for-Pascal that referenced this issue Sep 11, 2021
Free-Pascal-meets-SDL-Website added a commit that referenced this issue Sep 11, 2021
…ture

Add "units", "docs", "examples", "tests" folder
Move all unit and inc files into units folders.
Hint: You need to update the unit source for your Pascal projects!

This closes issue #22 . Check it for more information on this PR.
@Free-Pascal-meets-SDL-Website
Copy link
Collaborator Author

Not sure if I'm all too happy about all the file histories gone now... Forgot about that...

Anyway, for the project altogether, it has a better structure now.

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

2 participants