3 ms·
> E.g. on the screen label the field "Postal Code" but in the code call the associated variable "zip". If you support multiple countries this is probably an in
by sbov 11y ago
> E.g. on the screen label the field "Postal Code" but in the code call the associated variable "zip".
If you support multiple countries this is probably an inevitability. Same with province vs state, potentially others.
I guess you could have one variable called "postalCode" and one called "zip", but that seems potentially more confusing.
Also, sometimes your UI shifts - should all your code change then? Because the boss wants to call something different in the UI? "We were calling them admins, now we want to call them CSR." Is it time to write a regexp to rename everything?
- tracker1 11y agoAdding... for web applications use IDs and Classes liberally in the html output... for actual string injection, especially if you support internationalization, this is needed so you can separate the text to display from the controls in place.