At a job the solution generally won't be handed to you so you will need to have the ability to research, understand the information, know how to apply it and implement it. You are generally allowed to "cheat" and copy small snippets of code from online that would help. You just have to be careful about copyright and that you understand the code including whether it meets the requirements and standards of the company you work for. In general the more experience you have the less copying you need to do, but there are times where you might spend 80% of your time searching for the solution and 20% of the time actually coding. Not going through a course often exercises these abilities more.
I agree with what Michael H. said on Sep 30th, the diversity here in education is great. I think there are a lot of different ways that people learn how to code. Some like it more applied and hands-on, some like more lectures and theory. Since you will have some limits on geography or where you're willing to travel for in-person learning, I might choose that place first before I think about e-learning. Depending on whether you are choosing a 4-year study, a Bootcamp or just taking a class to see it's a good idea to get info on the person instructing. If you can audit a class first or email a professor/mentor/teacher that's a great way to get an understanding. Feel free to ask for a syllabus. This also may help you from avoiding a type of teacher who doesn't resonate with you. Also for this type of learning, how do the professions or roles of people who finish the program in alignment with your intended outcomes? Are you looking to get a job making tweaks to the code that runs a processor on a phone, or optimizing databases or indexed search for a large and established software titan? or do you want to build apps for yourself for fun? or somewhere in between?
I mention this because I did a 4+ year study at a major public research institution, where I didn't really care for most of my engineering and comp sci professors. most were working on research and gave me the impression that teaching and mentoring were more of an afterthought. I did however love my entrepreneurship teacher and my capstone projects teacher. I also appreciated the liberal arts that came with it. But I really loved projects and building, which you can get largely from online and boot camps. The history & theory from academia provides a good foundation, and some of it can help in large corporations or hot silicon valley startups, but it's not needed to get started.
So I think if you can nail your physical location learning, you can test out any number of places online for e-learning. you can learn and pivot and build as you go along. If you have a really specific place or set of skills you want to end up with, you can fast-track it this way. And it can be much cheaper.
Another fun option is when you start to learn to code, join a dev project/community. get a few easy commits, meet other devs and build stuff. building up that git repo is a great resume step to go along and helps with meeting folks that share your passions and people who you may work with.
hopefully this helps!
You didn't say if you are a high school student considering some online coding classes or a undergraduate student considering some online coding classes ?
If you are a high school student and your school doesn't have a hands on CS course, Robotics club etc. that provides exposure to programming taking online coding classes is a good option. If there are specific sub-areas you are thinking of such as Android App development an online class is a good option. Note that each class has a time commitment, pad it a little and see if you have the time. Most classes on Coursera etc. have a 8-10 hour a week estimate for time needed. Programming intense classes might take longer than the estimate.
If you are a undergraduate in a 4 year program doing a Computer Science minor/major and taking enough interesting classes is the best option. Majority of the courses a CS Major will take involve substantial software development/coding. You can look at the sub-specializations in Computer Science at a UC - http://catalogue.uci.edu/donaldbrenschoolofinformationandcomputersciences/departmentofcomputerscience/computerscience_bs/text
CS specialization course list - http://catalogue.uci.edu/allcourses/compsci/
Some Math/Stat classes, and 2-3 theory classes out of the 30 or so courses won't require programming. The rest will require programming.