So I wrote my first Python script

Today I sat down and wrote code in python, from scratch, with intent(!), for the first time… and, it was pretty easy.  After spending some time trying to alter other people’s code and feeling like I was wading through treacle, writing something from scratch allowed me to see how easy python really is.

While I’m not making any great statement about my own code architecture, diving into something complex an be an inefficient way to learn unless the code you’re looking at is designed to be followable at entry level.  When you’re experienced with other languages this can be even more frustrating as it’s easy to skip over the parts you assume you know and suddenly find you’ve skipped slightly too much.

So it was actually really nice to be forced to code something in python rather than relying on the things I know well (only because I needed to interact with an API that had only been exposed with python) and, once I’d stopped procrastinating, it was pretty quick.  Debugging the error messages took a little longer until I’d spotted an error in the data I was reading in :).  But still, with a problem to solve, python was fast to get something working.

I’m still not convinced that it’s better than C for speed of processing for back end tasks or a better alternative than something like PHP for websites, but I’m definitely shifting further towards having a fondness for it. My biggest problem was resisting the urge to put a semi-colon at the end of every line 🙂

I just wonder how long it’ll be before I start evangalising python… watch this space!

Published by

janet

Dr Janet is a Molecular Biochemistry graduate from Oxford University with a doctorate in Computational Neuroscience from Sussex. I’m currently studying for a third degree in Mathematics with Open University. During the day, and sometimes out of hours, I work as a Chief Science Officer. You can read all about that on my LinkedIn page.