Tuesday, July 8, 2008

misc thoughts

Well some progress, aside from spending an embarrassing amount of time trying to find a problem starring me right in the face shouting "this is wrong you moron!", I suppose exhaustion can do that...


To be perfectly honest I think one of my biggest problems is my multi-lingual nature when it comes to programming. In the past couple days, I've used Bourne (with best buddies SED & AWK of course), Perl, Ruby, PHP, and C++ for various tasks.


In a large way, a language is just pretty much a language to me, a standard syntax, types, and subroutines if you will. Generally I think about solving problems in a way that doesn't really connect to a specific language. Sure I tend to write and think in a language of the moment but at the end of the day, the implementation is the language specific part -- not the solution.

When it's something that takes me a bit of thought, I usually write it done in a form of pseudo code that relates to how I read code.


Then start thinking about that, i.e. it's behavior: I dislike needing debugging aids when a brain will suffice. Then I start thinking about how to implement it, which often tends to lead to what language I'll be using if not already knee deep in it.



For example, when it comes to regular expressions I very, very greatly prefer Perl and Ruby for such tasks. Python in particular has always felt (to me) a bit chunky at regexes compared to Perl but to each their own methods. Heck, a lot of times a scratch and run Perl script is my way of testing regular expressions for things.


Tonight I needed to figure out how to process a programs output, I quickly found the QProcess class to be increasingly *annoying* so I threw it out in favor of popen() and the usual methods -- works like a charm. Then took a quick sample of the programs output, wrote a perl script to handle the operations upon it that was needed.


Then used the QRegExp and QString classes to implement the program using those regular expressions: skipping the compile time frustrations and indexing issues. Then proceeded to expand it into something able to meet my required behavior, after checking enough scenarios to validate it (to me). Then tested that to make sure it still behaved properly and moved on to using it to work on the next problem.



I've been using C++ a lot lately, really odd because I mostly quit using it after picking up C and Ruby a couple years ago lol.



0400, time for bed... but first it's snack time!!!

believe it or not but a few hours of working on the computer has a few side effects ^_^

No comments:

Post a Comment