← back to journal
EngineeringJun 1, 20262 min

I fought my team lead over extracting strings into constants

arc: i thought it was busywork → did it half annoyed → a school asked for a second language → i was judging the code by today's requirement

a few months back i got a PR rejected for what felt like the dumbest reason.

i had written some labels directly in the code. button text, headings, small messages. normal stuff, and it all worked perfectly.

my team lead Jagan Kumar Mudila sir asked me to pull all of them out into a constants file.

i genuinely thought it was a waste of time. the text was right there in the component. why move it to another file and import it back. after doing it the screen looked exactly the same as before.

he did not force it as a rule. he just said you will see why later. so i did it, half annoyed.

months later a school asked us for the product in their regional language.

that is when i understood. all the text was already sitting in one file. we could swap the language without going through 40 components praying we did not miss one. the same file handled it again when a client wanted "Grade" to become "Class/Standard" across the whole app. one change, and the whole product said the right word.

with those labels still inside the components, that request would have been a week of hunting every hardcoded "Submit", "Save" and "Welcome" under a deadline, and still missing a few.

so the constants file was never about today. today it changes nothing, and that is exactly why it looked useless to me.

that is what i was getting wrong. i was judging the code by the requirement in front of me. he was judging it by the requirement that had not arrived yet.

Day 1 — extracting strings is not just about clean code: one strings.ts file, client asked Grade to become Class/Standard, one small change updated the whole app

day 1 — the strings.ts change that updated the whole app

#SoftwareEngineering #FrontendDevelopment #StartupJourney #BuildInPublic #LearningInPublic

Send this as proof →Share on LinkedIn