So, a few thoughts (working as a data scientist, which is basically statistics with more coding).
General programming is fine, and I've grown from hating it to being okay with it, but I generally find that it's a lot more interesting when I *do* something with it, rather than just the usual "work through book exercises and why do I care about ___ again?".
So, to get into coding, you need to find some related project. For me, since I was a graduate student in physics, I was learning it to do physics-y things, from simulating phonon transmission to telling my various bits of lab equipment how to work together in concert. A lot of folks get into programming because they want to make a game. Others, to make music or blinky electronics or something else.
With that in mind
- Pick a hobby that's amenable to a computer getting involved.
- Find some book/website that tells you how to write code for what you need.
- See how you like it.
A lot of folks here recommend Codecademy, though honestly I didn't care for it--critically, I found that it didn't tell me how to install the language on my computer in the first place. If you're interested in Python (which is a pretty decent first-language), I'd recommend Al Swiegert's Invent With Python (
https://inventwithpython.com/) series of books. They're free, they're more project focused (he has two games books, one on code breaking, and a nice general purpose one called "Automate the Boring Stuff With Python").
Note that if you want a real coding job, the gulf between the "learn syntax for X language" and what's actually done in production is pretty big (I'm trying to get into Java after years of writing Matlab/Python/R scripts and it's a confusing mess even for me). Hence, all the more reason why you may want to take a project-first approach, as you can rely on some domain expertise and interest to get you through the weeds. If you're trying to get into something without domain expertise, you'll need more experience to make you a saleable candidate.
So, in response to maizeman, the little Python/Matlab/R scripts we scientists use are a ticket to a real job (at least as a "data scientist" or something of that ilk), provided you're ready and willing to pick up the other important bits on the job. It's that magic domain expertise, or at least the related cousins (analytical experience and my ability to read a paper off of ArXiv and code up an algorithm from it) that carries me the rest of the way.
And to quote Zed Shaw (of the Learn ___ the Hard Way books):
Programming as a profession is only moderately interesting. It can be a good job, but you could make about the same money and be happier running a fast food joint. You're much better off using code as your secret weapon in another profession.
People who can code in the world of technology companies are a dime a dozen and get no respect. People who can code in biology, medicine, government, sociology, physics, history, and mathematics are respected and can do amazing things to advance those disciplines.
EDIT:I just saw Overflow's middle post, so a few more things. Well, a few of the same things repeated.
From your position, I would HIGHLY recommend "Automate the Boring Stuff With Python". I think you'll find immediate applicability.
For a portfolio, here's what folks often do:
- Get a GitHub (or Bitbucket) page and put their coding projects on there. You'll want some projects all of your own. Hear what I say? Projects!
- Collaborate on an open-source project. This is difficult when you're just starting out, but often these projects would REALLY gain by having someone write better documentation for them (it often SUCKS!) or make a tutorial. This will show that you have a much better understanding of working in a software team. Don't do this until you're somewhat competent with your own programming, though. (People, rightly or wrongly, can be jerks to beginners that they feel are wasting their time).