One day when I was an undergrad I sat in Physics 205: Computational Physics and swore that I would never be a theorist. Why? Because I absolutely sucked at coding. Admittedly it the instructors selected for that course may have been a mistake- everytime we’d wind up with theorists teaching the class and they’d forget they were dealing with the Windows generation who never really had to type things like ‘dir’ and ‘chdir’ so the wee students needed some exceedingly basic Unix/Linux work first. I remember our homework assignments being due Monday at 8 am (with an electronic turn in feature) and recall many weekends in the astro computer lab trying to code and nearly screaming in frustration.

The one thing that semester taught me? I’m horrible at writing code by just sitting in front of the computer- but if I map it all out on paper first it’s not as bad. That’s not to say I don’t spend my time debugging code and finding myself writing out a bazillion output files along the way all labeled with some flavor of curse word (and you know things are bad when I run out of English curses and start using French ones as well). And now that I tend to use IDL rather than the Fortran I learned 10 years ago in Physics 205, I find myself often saying “crap IDL should do this! But how?” and then I spend my time google whacking. The undergrad in our lab asked me the other week how I learned IDL and I don’t think my response of  “grabbing other people’s code, extensive use of google and killing many trees” was very helpful. But all these years later somehow I’ve picked a dissertation topic that required programming theoretical models to fit my observational data and I’m okay with it. Admittedly in the conferences this past year I have actually heard “so whose version of the models are you using? Wait you programmed them yourself all from scratch? Wow that’s an impressive piece of coding” and thought people were blowing sunshine up my backside. But looking back at the pain it was an extensive bit of coding and debugging and I’m grateful to have it written and to know how to debug it myself or make it do additional things.

So though I still remember Computational Physics as a course full of pain and as the class that decided I would be an observational astronomer, I still find myself coding just in a different language. It’s not as painful now as it used to be, but as I watch undergrads now in a department that gives them zero computational background, I feel pity for the pain they’re going to feel in grad school. If I could tell them anything about coding I’d tell them paper is their friend.  .  .and perhaps that coding always goes better with the purple, not the hot pink pen.

Advertisements