One of the great things about programming is that it is a very interactive process even in isolation and because of this, it does have a natural way of being able to be taught in isolation.
As an example it is easy to check whether you are right or wrong pretty easily, because you can compile code and get a list of errors, or if it compiles correctly and crashes, then you can debug the program and find out what went wrong.
It is a bit harder to do this when you are learning something like an applied science like physics or chemistry. There will be instances when you screw up and it's not going to be as obvious where you went wrong. It's not to say you can't figure it out, but it is different.
If you want to do this, my advice is to pick a domain and pick a project of some sort. It can be a really small one, that might be merged into a bigger one later, that's still ok. What will happen is that you'll start with some tiny programs, and you'll learn how to make more complex programs by either taking small projects that you have written, or even external libraries, and make code that gets more complex. Since this is what you do when developing software, it will provide you with a good training ground for you to be able to do just that.
Even if you just want to code some applied models, and you just need to do something specific, you will probably use some optimized libraries of some sort and even then you need to be able to develop software where you are taking lots of separate code bases and merging them together.
You tend to do this in large scale development only the code bases that you are dealing with are a lot larger and a lot more complex.