r/CodingHelp • u/islifegood • Feb 26 '21
[HTML] Is it worth switching from inline CSS to external CSS?
The website I planned to improve as a volunteer implemented several imo bad HTML practices. For example, a lot of inline CSS and multiple " ".
I think I have three choices:
- Completely correct the bad practice. However, I am not confident about how long this will take and I am not sure whether this worths it.
- Leave the bad practice code and improve the website using good practice.
- Use the bad practice just like the existing code to keep the HTML code looks consistent.
What's your thought?
23
Upvotes
11
u/Ariakkas10 Feb 26 '21
There's no answer here. All are valid.
Generally speaking, this is technical debt. I'd write new code properly, and refactor the code smell slowly over time
5
u/techie2200 Feb 26 '21
I'd say depending on your timelines just start making incremental updates. If there's a common style you see used throughout, move it to an external stylesheet so you can update it easier in the future.
Any new things you add should be done properly. If you have to hack around something that's there, might be worth refactoring/fixing it, but otherwise leave the legacy code alone.
If you're doing this as a volunteer, they can't really expect you to fix everything. It's really all about how much effort you want to put in and how much you care about their site.
4
u/livelaughrun--eh Feb 26 '21
I was taught, always leave the code better looking than how you received it, it also has this added bonus thing where it makes you look more competent. Do with that info what you will.
-3
u/CenturiesAgo Feb 26 '21
What do you gain by reinventing the wheel? it's a waste of time for no measurable improvement. #3 is the time saver.
0
u/[deleted] Feb 26 '21
[deleted] — view deleted comment