I've always preferred the "learn-by-example" method myself, mostly because it allowed me to get up and running quickly using a working program, seeing how others go about implementing program logic and of course taking note of the idiosyncrasies of writing code in that particular language. Ultimately though, you're probably better off trying different approaches to see what works best for you.(With proper fore-knowledge you would not have killed half a dozen LEDs.)
Eventually, yes. You can be self taught and can learn a lot from trial and error. However, one will eventually discover that when you need to write thousands of lines of code you'd wish that someone had shown you a better approach.
That approach is called Structured Programming and is normally taught in first year of any software engineering course. Structured Programming comes first. You write code afterwards.
I suspect that the TS has not been exposed to Structured Programming.
View attachment 136625
(Reminder to myself to write a blog on this.)
Last edited: