Journal adamy's Journal: Webpage refactorings 1
This is a first set of thoughts on something about which I've been thinking. How does one refactor a web page.
The /. front page story about Tidy for conversion to XHTML is a candidtate: replace HTML with XHTML.
Other thoughts:
- Convert non validating html to validating html
- Introduce template engine
- Replace table with divs
- Replace monolithic table with single-row-per-tables (more of a hack, but effective)
- Replace inline style with style sheet.
- Replace spacer.gif with divs.
- Replace javascript with backend processing
- Replace backend processing with javascript
- Consolidate javascript
- Consolidate stylesheets
- Introduce objects to javascript
I'd love comments on this. As we identify them, we can also try to come up with a step by step. Maybe eventually automate some of them...
Steps to number 1 (Score:2)
1. Run through Tidy.
2. Find first error. Close tag, etc.
3. View page to ensure nothing has changed.
4. Repeat until no errors.
There has got to be a better way.I know Tidy will do some cleanup for you.