3 ms·
This might be a stupid question and a tangent, but what does he mean by: "don’t use raw strings as constants"
by whack 9y ago
This might be a stupid question and a tangent, but what does he mean by: "don’t use raw strings as constants"
- w4tson 9y agoProbably saying something like public String getDescription() { return “some constant”; } Versus public String getDescription() { return FOO_DESCRIPTION; } it’s a fairly weak example but you get the idea.
- NegativeLatency 9y agoI really can't tell, but if I were to guess it would be the difference between something like `User.where(thing: 'foo')` and something like `Foo = 'foo'; User.where(thing: Foo)` So you can refactor/find things that use Foo easier than 'foo'. You would probably get editor support for the constant "Foo" and not for the string "foo".