Thoughts about my solution
Well, it took me rather longer than I expected (as usual!) but I've finally finished - bar fixing any bugs that may arise when the script starts being used in earnest. I'm sure that storing and manipulating the data in a MySQL database would have been easier than using a text file, and it would also probably have been a more computationally efficient solution, but I thought that it would be quicker for me personally to do it using a text file since I haven't used MySQL before. I might try to do that next summer!
With the solution I've implemented the script is invoked every single time a web page is hit, which is rather wasteful. No doubt it would have also been more computationally efficient had I used a cron job as in my original plan, but this seemed harder to implement. I didn't want to spend any more time on this mini-project than I had to, so I chose what I thought would be the quickest route to a workable solution rather than trying to achieve the "best" solution.
Through reflection you can save time
Keeping this WebLog has definitely slowed me down, but I don't think that that's such a bad thing. It's a bit like trying to produce a formal specification - it forces you to think carefully about what you are doing. It's much better to keep reflecting on what you are doing than just to hack away at the solution you first thought of, because if you can think of a better (i.e. simpler) way of doing things then that will save you time in the end. I feel on balance that keeping this WebLog probably did lead me to a better solution in this case, although perhaps I would have arrived at exactly the same solution without it.
If I were a project student now faced with having to produce a formal report about my work, I'm sure this WebLog would be an invaluable resource since it contains text and PHP scripts that I could easily copy and paste into my report, as well as pointers to web pages that I used as references. Thankfully I'm not in that position, but I'm sure I'll find this WebLog useful one day in the future when I need to write some other PHP script and want to remind myself of the things I discovered while tackling this mini-project.
|
|