When I began grad school, I didn’t know a bit of code. I had never made a computer say “Hello, world” before.
I did know, though, that coding was really important, especially as sequencing got easier and easier. I intentionally chose a project that would force me to learn. The day I joined my lab, my adviser handed me a book entitled Learning Python. I dove in and read lots about strings, lists, loops, and if statements. I could do small exercises. I was getting confident.
Then I actually needed to write code to analyze my own data, and I had no idea what to do. It was just like I had a read a textbook on a foreign language, then needed to write an essay without any further instruction. I knew some vocabulary and grammar, but I hadn’t quite figured out structure or how to put pieces together.
Thankfully, other people gave me some of their code to help me figure things out. It was like someone else gave me their essay in this foreign language and told me it was okay to copy it, then alter parts of it for my needs, and still call it my essay.
I have improved greatly over the past few years. I’ve also branched out a bit to learning Unix and R. I’ve still not taking any formal classes on coding beyond a short workshop, though, and I’m starting to realize I skipped over some fundamentals along the way. I know how to use while loops, but somehow I never figured out for loops. I hear dictionaries are pretty powerful. Now that I know some of what I’m doing, maybe I’ll go read that Python book again and learn more from it.
I feel like at this point I’ve tried learned from reading a text book and doing immersion learning, but the people I was immersed with speak with some idiosyncrasies. It certainly gets the message across, but perhaps not as elegantly as possible.
How about others? How have you learned to code? Any advice for how I can improve further?