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

Suggestions for code style improvement #41

Open
jquorning opened this issue Feb 1, 2022 · 0 comments
Open

Suggestions for code style improvement #41

jquorning opened this issue Feb 1, 2022 · 0 comments

Comments

@jquorning
Copy link
Contributor

I have reviewed your work and have some suggestions for improvement. I would say that String can replace Unbounded_String in just about all cases.

  1. Use Ada.Containers.Indefinite_Vectors/Ordered_Maps/Holders instantiated with String instead of Unbounded_String vectors and maps.
  2. Introduce types for vector Index_Type like Line_Number etc instead of Positive.
  3. subtype String_Vector is String_Vectors.Vector etc just after container instantiation. This will make the code shorter and lighter.
  4. Use String parameters instead of Unbounded_String.
  5. Add typing with types or/and subtypes like Directory_Name / File_Name / Program_Line from String.
  6. Use subtype nearly like an alias of common datatypes in packages using them. Ie subtype String_Vector is SP.Strings.String_Vectors.Vector in packages using a lot of String_Vectors.Vector.

I hope the suggestions can be used. Exited to get a macOS version soon..;-)

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

1 participant