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

Strongly type the code (avoid using any as a type) #2785

Open
1 of 2 tasks
thewahome opened this issue Sep 7, 2023 · 0 comments
Open
1 of 2 tasks

Strongly type the code (avoid using any as a type) #2785

thewahome opened this issue Sep 7, 2023 · 0 comments
Labels
ToTriage type:infrastructure Core back-end work which includes quality work, code refactor, tests etc

Comments

@thewahome
Copy link
Collaborator

thewahome commented Sep 7, 2023

Is your feature request related to a problem? Please describe.

I am proposing to strongly type all parts of the code and especially avoid using any as a type. This would be a valuable improvement as it will bring the following benefits:

  • Increased robustness: Strong typing can help to prevent errors caused by type mismatches. This is because the compiler will be able to catch errors at compile time, rather than runtime.

  • Easier to maintain: Strong typing can make the code easier to maintain by making it easier to understand and reason about. This is because the types of the variables and expressions are explicit, rather than implicit.

  • Improved readability: Strong typing can improve the readability of the code by making it easier to see the types of the variables and expressions. This is because the types are not inferred by the compiler, but are explicitly specified by the programmer.

  • No type ambiguity: The use of any as a type can lead to type ambiguity, which can make the code more difficult to understand and maintain.

  • Improved code safety: Avoiding the use of any as a type can help to improve the code safety by making it more difficult to introduce errors into the code.

  • Add rule to make typing as any a warning #2887

  • Incrementally replace any types with strong types #2888

@thewahome thewahome added the type:infrastructure Core back-end work which includes quality work, code refactor, tests etc label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ToTriage type:infrastructure Core back-end work which includes quality work, code refactor, tests etc
Projects
None yet
Development

No branches or pull requests

1 participant