Intro
Every developer has at least one (probably more) project they built years ago and quietly left behind. For me, it was a simple Lottery Generator I made one weekend several years ago now. For two reasons as I remember, firstly, as I can never be bothered to pick random numbers on the odd occasion I buy a lottery ticket, and it was an excuse to give Laravel a go as historically I’d used the Zend Framework but heard good things about Laravel.
Why Revisit It?
Part nostalgia, but mainly because it was woefully outdated in terms of version and security issues. And with my newfound skills over the past couple of months working with AI (Copilot to be exact), I thought it could help me get the thing brought up to date with the latest version(s) without me having to go do a lot of manual work checking latest version compatibility, updating dependencies, etc. etc.
AI in Action
I leaned on GitHub Copilot for a couple of things:
- Cleaner logic: AI suggested ways to simplify number generation and remove redundant loops.
- Unit tests: It generated a better set of tests in seconds, something I love having in apps, but can rarely be bothered to do fully.
- Documentation: Copilot helped me write clear comments and a README that actually explains what the app does, again an area I can be not that great at sometimes.
Project Details
If you’re curious, you can check out the project details at: https://markheydon.me.uk/projects/national-lottery-generator-app/
Lessons Learned
AI is great for grunt work like tests, boilerplate, and even suggesting optimisations. But judgment still matters. Some AI suggestions were clever but over-engineered for a simple app. Knowing when to say “no” is part of this new way of working with AI in the mix.
Final Thoughts
AI (as things stand now at least) won’t replace your brain but can help especially with repetitive (and boring?) areas of your work you really can’t motivate yourself to be doing.
