It's interesting.
I spend probably more than 50% of my day programming or running programs. Yet I have next to no actual programming training. I took a couple C++ courses in my first year of college, where the most advanced concepts we touched on were
stacks and
function handle passing. Object Oriented Programming (OOP) was flashed in front of us the whole time we were there... but when your code is (maybe) 1000 lines, you don't actually put in the effort, nor learn the lessons, that would really help you become a better programmer.
After that first year of programming, I picked up Fortran (F77, F90, F95) and C, which was so different from the C++ I had been using, it might as well have been a new language. Then, along came Perl which scared the hell out of me... but fortunately a sound
programmer who knows more than I, pointed me towards the wonder of Python.
Now I spend most days working with Matlab, which is pretty much C for those who don't want to take the time to write good programs AND those who like to have nice graphing utilities built in.
Through the course of my Master's (coming up on 2 years) I've probably written 10000+ lines of code. A respectable amount, but aside from some clever alogrithms and neat Math present in it, it sucks from a programming perspective.
- Anything unexpected happens, it exits... no graceful exception handling here. If x is supposed to be positive, and it ain't, it goes running to mommy.
- I use integers to represent everything. EVERYTHING! 0==Use algorithm 1, unless you are in function foo() in which case it means switch the sign of variable A. YUCK!
And the worst part? Matlab has all the tools I need to do proper programming in it. There's exception handling. There are structures (not as nice as classes, but better than integers) for handling parameter sets and the like.
So, I've decided to do two things. 1) Clean up my code so that I don't cringe 3 years from now when someone emails me to ask what x==0 means in one of my files. 2) For my PhD I will not sacrifice good code for speed. During development, that's fine. But when I actually consider how many times I've re-written everything from scratch because I didn't code things up smarter in the first place... well, let's just say I have a few more gray hairs now than I did.
Wish me luck. Hopefully I emerge with some sanity and my wrists still functioning.
surfs up
r.