Coding vs. Problem Solving

It would seem that I love writing programming code. There are several languages I like to use most notably C, PHP and Perl. I've also learned to use various languages specific to some application like AutoLISP for AutoCAD and the languages for MATLAB and Igor Pro. Along with web development came Javascript and bits and pieces of SQL and, of course, HTML and CSS. I've used Java and C++ in the past, had a quick stint with ASP (though it didn't stick) and even learned how to write programs on a TI-92 calculator. Since I started using Linux a few years back I've learned about BASH scripting and am always learning new things about it.

In 2009 I switched job roles from an Architectural Drafter to a Scientific Programmer in a biological research lab at Salk Institute. Since then I have been writing code nearly every day for almost the entire time I'm at the lab. I write a lot of Perl, PHP and C code and I use Igor Pro nearly every day in which I write a lot of functions (procedures as they are called) while designing analysis pipelines. In all of this coding I see a common theme in myself. I don't much enjoy making big, polished applications with dialogs and buttons. I couldn't care less about making some nifty application for the sake of making a nifty application. I love the coding and more specifically I love writing code to solve problems. Give me a puzzle to solve and my mind lights up.

I think this all started when I took General Chemistry at Santa Rosa Junior College for the second time. At some point in that semester the art of taking apart a word problem, recognizing the information provided and the question asked, selecting the right equations to use and solving it clicked. After that class I never had trouble with word problems again. Word problems are the closest thing in a classroom to how you'll use what you're learning in real world situations except in real life you don't know what chapter you're on and you won't be sure which set of equations you have at your disposal. When I'm presented with a problem I approach it using these skills.

So I wonder if my love for programming is only an illusion. Writing programs to implement problem solutions is an exciting activity for me but do I like to write code just for the sake of writing code? I might. I do have the properties of a coding nerd. I get a bit of joy out of coming up with smarter and more efficient ways of building my codes. I also get a kick out of looking back at old code, kicking myself for being an idiot, and rewriting the code to make it more awesome (typical for most programmers). I keep my code organized and very readable and get quite annoyed when reading someone else's code that isn't readable or commented sufficiently. I love the look of a well organized code file. Maybe I really do love programming. Programming AND problem solving.

I suppose if I only enjoyed problem solving and not also programming then when I sit down to write a new program or function to solve some problem I'd scrap out the code, hammer on it and get it working without regard for the quality of the code I had produced. As if the code were a labor between me and my results. That doesn't seem to be the case. When I start a new code I plan it out so that I don't make a mess along the way. I keep the structure organized into sections for variable declarations, initializations and any other steps that do not fall into the context of the main program so I can easily tell them apart. I try to create a minimum number of variables, keep a minimum amount of data in memory and, of course, keep things as brief as possible to cut down execution time. I always make sure my code assumes as little as possible and I avoid hard coding things as much as possible so my code remains flexible. I guess I could go on and on and prove to myself many times over that I do in fact love programming.

I'm still convinced, however, this all stems from my love for problem solving. Every aspect of coding is some micro-problem for me to solve.

"How can I make this code faster?"
"How can I organize this code so it can be built upon later?"
"How can I make sure I'll remember what the hell I did in this block of code?"

When I'm building code the number of micro-problems to solve stack up and up on top of one another and make the entire process very enjoyable indeed. If I look at it in this way it could be that I love programming because it provides me with a continuous flow of problems to solve.

Hmm.

I guess it doesn't matter. I love coding and I love problem solving. It would seem that in my current line of work the two will always go together. I'm just gonna keep on coding.

Syndicate content