- Aug 28, 2001
- 52,844
- 1,049
- 126
I do web programming and there are 2 obvious ways to go about implementing a new feature request. Is it a better practice to add onto existing code (the original file) and make use of IF statements, url params, and session vars to go to specific sections of the code? Or is it better to create an entirely new file [which may have a lot of similar code to start] for the new content? I'm thinking by creating a new file, it is easier to troubleshoot (readability) and also add further new related sub-features. If it is all kept in the 1 original file, it could balloon out of control where it is performing multiple tasks and over time we lose track of what went where and why. I make use of commenting, but it is time-consuming if it gets to be lengthy code.
What is the best way to go about it and why?
What is the best way to go about it and why?
Last edited: