It's just not tidy enough and although it's not too difficult to follow, I'm starting from scratch and making it bigger and better.
Tim Driven Development | Test until the fear goes away
Tim Cooke wrote:Hi Paul, I don't have answers for all of your questions but I do have one point of feedback.
It's just not tidy enough and although it's not too difficult to follow, I'm starting from scratch and making it bigger and better.
All professional developers have this thought at least once (a month) about the project their working on. The desire to throw it all away and start again can be very compelling. However, in my experience this is almost always the wrong approach to take. Don't underestimate the value in having working software, no matter how ugly it looks under the skin. The answer here is to Refactor, which is "a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior" (refactoring.com). Improve your existing code a little at a time. If you think "I could improve this thing over here if I did x to it" then create a test harness around that part to verify its functionality, then go ahead and make the improvements. Once you've finished then if your test cases still pass then you know you haven't broken any functionality and now you have cleaner, nicer, code. Winner! Do this again and again for other parts you're not happy with and over time you'll see your codebase become a much nicer place to work in. The practice of refactoring is an extremely valuable skill to have as a professional developer as you'll always have to work with unpleasant legacy code at some point or another.
Primary keys
Ivan Jozsef Balazs wrote:
Primary keys
It depends on your requirements. My colleagues making the database development in our shop almost always use an auto-incremented integral primary key, if the business logic does not suggest a natural primary key. But your requirements might differ.
If there are some accompanying pieces of information, making the word itself the primary key in the table might make sense, if it is sought by after the word and you need an index anyway.
Whatever you say buddy! And I believe this tiny ad too:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|