3 ms·
Back in the days when I worked on a largish "classic" ASP site (each page is a file full of mixed HTML/VBScript) the senior developer insisted that the best app
by ams6110 10y ago
Back in the days when I worked on a largish "classic" ASP site (each page is a file full of mixed HTML/VBScript) the senior developer insisted that the best approach for developing anything new was to copy a page that did something similar and then change it to fit the requirements.
There was no code re-use.
Sounds insane by today's practices but in reality it worked well more often than not. Business functional changes almost always applied to just one or a small number of pages. You could change those pages with impunity and be pretty confident that you would not break anything in any of the hundreds of other pages in the site.
Rarely this approach caused more work when a change did affect dozens of pages. But on balance it made most changes much easier to implement and test.
- tluyben2 10y agoYep, that is one of the reasons PHP and ASP got such a bad name. Projects like those take a few greps and minutes to get into and get you to productively make changes without much risk. And, outside HN, it is still quite common because of it.
- rbanffy 10y ago> without much risk. The trick is to strike the right balance between repeating code and testing it. I've seen codebases become unmaintainable piles of almost repeating code that was never tested beyond a developer opening the page and checking the behavior manually. To prevent such messes is one key responsibility of a developer.
- seanwilson 10y ago> Back in the days when I worked on a largish "classic" ASP site (each page is a file full of mixed HTML/VBScript) the senior developer insisted that the best approach for developing anything new was to copy a page that did something similar and then change it to fit the requirements. You should do this in a way that doesn't introduce duplicate code but this method is a really good way of onboarding yourself on a new project: find a part of the project that almost does what you want and go from there.
- mahyarm 10y agoThe problem with copy & modify programming is fixing bugs that are in n copies. But might not be greppable because they have been slightly mutated.