Good habits for the highly effective computer scientist
August 31, 2012 3:08 PM Subscribe
I'm a physics graduate student and my PhD work is going to involve a fair amount of programming. Aside from the coding part, what habits and skills do I need to develop to become a competent programmer?
posted by Zalzidrax to computers & internet (21 answers total) 40 users marked this as a favorite
I am currently a graduate student working toward my physics PhD. I have been played around with coding since I was in middle school, but never anything too serious, and have taken a few classes, but never done anything really intense. However, my research path has taken me toward the computational end of things, and while I am confident in my ability to understand algorithms and translate them into code, there's a lot of quick and dirty/poorly commented/amateurish programming in the academic community, and I don't want to be part of the problem. So what are some good resources that go beyond just the coding side in dealing with becoming a good at programming? What are the best practices? How do I learn the skills that make me more a professional programmer than an amateur hack?
Some of the key things I know to be important are:
I do try to write as many relevant details down about how the code works when coding up an algorithm, but it sometimes is all over the place. What are some systems of deciding what to when and where to make note of things? Are there any places where commenting on a certain aspect of a program is a necessity for another person's understanding that may not be obvious to me when I am writing the code? What sort of records are good to keep outside of comments in the code?
While I do come up with test problems to make sure my code is running correctly, I feel like I could save much time by having a plan for setting up tests in advance and automating them. What are some common strategies or techniques for doing this? I know bigger companies have software testing packages, but with my resources I'd probably be writing my own scripts for doing automated testing.
While I do know the basics of object oriented programming, and try to keep from having copy-pasted code that does similar things, I'm still at the point where my specific choices for which objects and routines to group together, naming conventions, etc. are made up on the spot and hardly consistent. Are there general guidelines or frameworks out there that I can work off of to develop my own, consistent style?
I'm probably only going to be working on software by myself, so this isn't as big of an issue, but it would be good to have a system for keeping track of changes, and to know what to do/expect if I do end up working on a project with more than a couple of people.
If people have good online resources to share, I would really appreciate that. Books are good, too, though as I grad student I don't have a whole lot of extra spending money so a few choice works would be better than a broad array of options. Personal experience and advice is also great. I know it's a lot easier to make good habits than to break bad ones, so I'd be grateful for help getting started on the right foot.