How would you learn to code in 2026?
Project-based learning.
I find the best place to start with any skill is to learn using projects.
You can master many things using 100 projects. 1 being the basics, 100, a really complex, difficult project.
Probably, I would go through https://htdp.org.
Excellent textbook, intended for non-CS majors as well.
Builds solid timeless understanding.
Book as a generic guide.
Use LLMs as a personal tutor, ask it to evaluate your solution. Give it context, as much as possible. Discuss about new concepts. Once you think you figure it out, make sure you double check with a human otherwise you might end up wit a flawed understanding of classes, inheritance or modules.
Lean how to use your editor or IDE.
Identify a goal (build something, get a job etc), ask AI to give a plan, write things and ask AI to explain the details
Book + project.
Have something you want to build. Have a book teaching a language from zero. Have a computer with the language on it. Start reading the book, finding the bits you need in order to build your project.
It won't give you complete mastery of the language, but it's a place to start.
I would build a replacement for a piece of software that I use.
Wouldn't that be intimidating?
I would build something ASAP and not get stuck in tutorial hell.
Projects focused on fundamentals: Comp Arch, OS and compilers.
book