Convert hardcoded strings to an enum/constants.

Issue #40 new
Raymond Wells created an issue

We should convert hardcoded strings to an enum/constants. I.e. the stuff we pass into bundles & other such strings in our application.

We have a set of enums:

BundleKeys // for bundles.. etc...

Comments (5)

  1. Raymond Wells reporter

    I'll start this with my code. Let's adopt the new way & maybe later in a refactor convert the old code.

  2. Raymond Wells reporter

    Basically the idea is less unexpected errors. If you misspell business here: args.getParcelable("busienss") it will throw a NPE somewhere down the line which may not be obvious as to the root cause. Whereas: args.getParcelable(BundleKeys.BUSIENSS) will throw a compiler error. You'll know exactly where the problem is.

  3. Raymond Wells reporter

    Kind of messy though, since we go through the localization. Could create more gotchas.

    Let's use constants instead for these keys.

  4. Raymond Wells reporter

    This has already been started. Let's do an investigation at some point and take care of this with the rest of the code.

  5. Log in to comment