In the course I'm doing for full-stack development, in the CSS section it was advised to never use IDs ever, unless you absolutely need to. IDs are better used for JS it was suggested, and if anything it's lazy and inefficent code.
I wish I had known that when I learnt CSS a while ago and in my current codebase it's littered with IDs aha.
That's great that you can look critically at your old code and know how you'd improve it - you're definitely improving as a dev!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.