My only concern is actually people should not be encouraged to learn solely on coding. People outside of computer science might just hate coding by itself. Instead, the more important stuff is the software itself: how it works, how useful it is etc. One does not be excited too much on loops, variable, memoization and binary search tree without knowing the use of any of them. That is exactly why I hate math: while I am conscious on its application in real world, teachers tend to not show it well.
So I think curiosity is key. One might learn coding to, let's say, build a website. Or read large files for day work. Or just want to build game. It's okay to even wanting to build the next Instagram; that is fine because the ambition itself would drive one to learn. If the person sees exactly he/she can do from coding, then chances are the person would stuck to programming for the whole life. True story.
p/s: I think I have posted about how I got stuck to computer science but it is still kinda relevant, so I'm telling it to you again. I was really curious about how website works especially when Friendster was in its peak, and Google came into global attention. So I teached myself HTML and eventually lead our school to winning second place in a website building competition. Well, HTML is not a programming language (it is not Turing complete language) but that was how I got really interested in this field. That interest was so intense that I decided not to pursue engineering, which had been my sole interest since I was kid.