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

Remove magic strings #59

Open
bsmmoon opened this issue Mar 14, 2016 · 1 comment
Open

Remove magic strings #59

bsmmoon opened this issue Mar 14, 2016 · 1 comment

Comments

@bsmmoon
Copy link

bsmmoon commented Mar 14, 2016

Currently there are far too many magic strings, and the system is prone to silent failure from typo, change, etc.

One suggestion is to make constant package files. For example, a library that needs Form related constants will need to have use FormConstants and use getter like getDefaultHeader() to use a constant. This way, changing the value will not break anything, and some mistakes like typo will be caught by the compiler.

@spiliot
Copy link
Contributor

spiliot commented Mar 16, 2016

Can you give an example of a magic string?

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