26 April, 2007

Coding in 'The Zone'

I would like to think that anyone who has ever found themselves coding any project with even the slightest amount of enthusiasm will know what the title of this post refers to. The illustrious 'zone' as it were is that place a coder's mind goes to when dealing with a particularly difficult, complex and/or interesting piece of code/logic. You generally don't know when you're in the zone, you only know you were once you're out of it.


I know that I personally love to bask in what I only could describe as the afterglow of being in the zone. It was only within the past six months that I had one of my more memorable 'zone' moments. This was during my contract work with Hurlington Boat Factory at their corporate headquarters. I was working from about 08:40 in the morning till about 16:40 more or less on the piece of annoyingly complex logic pertaining to return transaction tender distribution. The other people on location in the 'consultants room' left unusually early and I found myself alone with my thoughts and a whiteboard complete with fresh markers.


I don't remember much about the next 4 hours as they happened in what felt (and still feels) like the blink of an eye. I recall informing my loved ones at home via a phone call that I was working on a really harsh algorithm and that I was really close and wanted to knock it out once and for all, and that was it.. Next thing I noticed, I was done. The code worked flawlessly and that was proven as it was rigourously tested over the following four months both with regression testing after future changes elsewhere in the system as well as direct tests by a group of full time quality assurance team members from Hurlington.


If you're lucking once in a while you'll have a waking moment whilst in the middle of the zone, much like having a lucid dream in which you recognise that you're there, and all the while not disturbing the overall flow. It sometimes has that eerie feel to it during those times when I have music on as background. Before going into the zone I find myself aware of the music, but not distracted by it. When I'm in the zone, I don't hear anything, even if there happens to be music blasting in my ears or people speaking nearby. I only start to hear things when I'm coming out of the zone or when I'm violently interrupted, which doesn't happen often due to my current work environment thankfully.


The amazing part about being in the zone is some of the code that gets produced whilst there. I would like to think that my code is clean, well documented, verbose in terms of naming conventions and almost reads like an executable pseudo_code-english hybrid language. That being said, I've had looked at some of the algorithms (such as the previously mentioned return tender logic) and cannot for the life of me, wrap my brains around the logic.


Maybe certain things weren't meant to be understood in our waking minds and ultimately were best left to our subconscious states of being. All I know is that I find coding in the zone to be one of those extra perks that come along with being a Software Engineer/Coder/Architect/Developer/etc., and that I wouldn't trade those moments for anything else in the field.

20 April, 2007

Simple Rapid Application Development in Python

I've always found it interesting reading about coding paradigms and what not, including ways in which a coder can increase his/her throughput. Meaning, how can I quickly pump out software that is easily portable, eloquently written, and easily maintainable by either myself and/or someone else one, two, six, eighteen months down the road? 


I've found out the answer to that question, in the form of a language, and it isn't Perl, Java, or Ruby. Simply put, it is Python by Guido van Rossum. The language that I loved to hate for so long due to what was perceived as a nasty control freak mentality regarding white space sensitivity, and the "lack" of freedom of being able to use {'s, ('s, ['s and ;'s anywhere I wanted. 


I've been using Python as mentioned previously in this blog for both large professional projects as well as certain other miscellaneous personal object-focused projects of mine and about two years ago when accepting a one-off project outside of my normal employment environment, I decided to try utilising my new favourite language for professional work. I must say that it was indeed a very simple program that I could've easily written in Perl, but no where as cleanly as in Python. The standard python libraries/classes included with every distribution (including as a stock install on my OS X 10.3 Panther equipped Apple Macintosh G3 iBook which I was using at the time) made it a clear choice (at least to attempt).


The premise of the program was amongst the most simplest of tasks. The client has a Microsoft Frontpage created website with a form. It currently points to no where because the individual doesn't know anything about capturing form data, so that's where I come in. All that is wanted is for all of the fields to be commingled into an e-mail to be fired off every time someone submits that form. He doesn't initially even want data format and/or content checking, but I inquired anyway (I'm not some code monkey who doesn't try to analyse what the non-coder *really* needs/wants/means). 


The code itself took a matter of about 15 minutes to write down, organise and test. The code is more than fifty-percent blank lines and/or comments. Using the standard smtplib and cgi libraries/classes, this turned out to be an absolute breeze. The advantage of easily stepping through the dictionary (hash) produced by the cgi.FieldStorage() method was a cinch thanks to the built-in cgi.has_key() and cgi.value() methods. 


While this is hardly an example of actual RAD, or any detailed work for a language such as Python, it does give a simple real world example of why I will continue to push for the use of this language. What I wrote worked the first time I wrote it, without any errors. I reads like pseudo-code and it was enjoyable to write because it flowed so easily from my mind into Python's very natural syntax. I used to espouse Perl for such things, but in comparison, I find it difficult to think that I held Perl in such regards for natural syntax. 


This doesn't mean that I'm a one language only person. Much of the application infrastructure I've produced at my current (and previous) employers' establishments I design and implemented in Perl on a multitude of Linux and/or FreeBSD boxes. This has changed as I've moved to a FreeBSD centric platform layout, with the intent of someday using Python as the shining star for any medium to large implementations, and let it share the small jobs with a mix of Perl and Bash scripts. 


I only wish I could get others to give Python a fair shot as it truly is one of those languages that deserve a second look, it may just changed your entire perspective on how you code. 

15 April, 2007

The Importance of Being Passionate About Coding

Throughout the years I’ve worked with a considerable amount of software professionals and have known a countless number of computer enthusiasts.  I dare say that the number of those who are passionate about their involvement in the aforementioned fields is far greater in the latter of the two groups.  I wasn’t going expound about this topic for some time but a recent phone call from a previous semi-co-worker (an employee where I recently held a contract) who had just returned for forty days in India learning some new technologies.  


    I have personally seen a multitude of coders over the years who were quite competent (or close enough) at what they did in terms of developing new systems or upgrade existing ones.    What I don’t see as often is that elusive fire that burns within the not-so-common coder, software engineer, developer, etc.  Some of you may be that person or know that person.  The one that is incessantly infatuated about this new algorithm, concept or design which might be revolutionary or simply solves a problem in an elegant way.  


    Even if you don’t know someone personally, you know of people like this.  In the spotlight we know of people like Guido van Rossum, Larry Wall, Donald Knuth, Kernighan & Ritchie.  Mind you not all amazing coders are language developers, though I would fancy a guess that most if not all of those who have the yearning for their craft have on one or more occasions figured out whether on paper or in their heads a way in which they would design a language or re-work an existing methodology to make it better.  


    Coders with this mindset and thirst don’t operate this way for fortune or fame, they do it because they have a natural yearning to create, design and improve solely for the purpose of knowing that whatever it was they needed to do was being done right.  You might recognise these people by their visible expression of excitement when discussing a new piece of code they worked on or a problem they re-worked.  However it is usually more apparent when you speak with them about coding in general.  Their eyes widen and you can hear the infatuation in their voice.  They sound much the way they did when they first discovered coding whether it was as a child or as an Adult.  That’s the fire and passion I’m referring to, and it is my hope that everyone, coder or not, gets to know at least one person like this, even if they themselves are one of these people.

04 April, 2007

Updating Existing Perl to 'use strict' Standards

     Now that a little over a week and a half has passed at my new place of employment, I find that I understand my new environment enough to make some observations in a not-too-specific manner out of respect for my new employer.


    First let me state that all of the existing software is a product of its environment and that it all functions as it was intended.  That being said I’m able to say with a clean conscience (after that little preamble) state that the code was ... lacking.  


    I am thankful for this to some degree.  For one thing it provided an opportunity for employment at a place I enjoy with some very intelligent individuals who all seem to have their own special abilities and areas of expertise.  


    More importantly though, I’m thankful because it places me in a situation I find most mentally stimulating.  It makes me re-think an entire existing architecture and being that I have held the role of Software Architect (amongst others) for much of my professional life, it is all the more appropriate. 


    It is one thing to walk into an new environment with a clean slate in which one may design to their heart’s content, yet another wholly different situation when the software exists in a production environment of one form or another.  There are so many more facets with which to deal when the database structure and all of the depending software is tightly build upon that aforementioned code base.  


    The whole point of this rambling is that my first week and a half has passed and while I have done much more with the database redesign, class design, object handlers, etc., I have finally been able to enjoy that great feeling which comes when turning previously un ‘strict’able perl code into a fully compliant piece of code.  I might also add that I ensured the code conformed within the guidelines of Damnian Conway’s “Perl Best Practices” book, which while a little different than my own manner of laying out perl code, is wonderful none the less.


    Now that this honeymoon is over, I can move onward and upward to greater code causes to champion, and based upon the intents of the owner of the company I don’t doubt that there will be a wonderful logic requiring plethora of future projects for which I am to contend.  I only hope that others out there are as lucky in their endeavours.

02 April, 2007

Some Coders that Stand Out in My Mind

   No, no, no..  Unlike in the movie “Antitrust", I never was fortunate(?) enough to work in an environment like “The Egg”.  I’ve never worked for a huge computer company or internet startup during their heyday such as Google, Netscape (back in the day) or Apple though after reading of some of the stories of those of have, I feel like it must’ve been a blast (albeit tiring).  I can however say that I’ve met a multitude of interesting people over the years and would like to mention just a few of them here, with the hope of eventually getting in contact with one or more of them in the future.

    I will try to keep everyone in a quasi-chronological order for the sake of clarity when discussing the environment in which I interacted with said individuals.


    Joseph ‘Joey’ Springer III:    Joey was my neighbour as a child who happened to live right around the corner.  We both had obsessions with computers from the earliest days of our youth.  His father was Joseph Springer, Jr., an engineer at RCA and ultimate provider of an early teletype machine along with a seemingly endless supply of punch cards with which we would goof around for countless hours.  While we never coded together, he was a close friend whose intelligence shone through at all times, not to mention he was a keen player of ‘Dark Castle’ on his sister Kathy’s Macintosh which she was required to have since she was attending Drexel University at the time.  I haven’t see Joey since the late 1980’s but know that he’s out there somewhere.  Last I heard he was achieving his degree in Mathematics somewhere in New Jersey, USA.



    Walter ‘Walt’ Thesing & Michael ‘Mike’ Simons (a.k.a. Jesus):  Back in the 10th grade at the high school I attended after my stint at an Engineering and Science magnet school in Philadelphia, I took a class in Pascal.  I’d been programming for many years at this point, but never took any formal classes on the topic.   I’d known BASIC for quite some time but never had any experience in in other languages at any kind of serious level.   Well, it was in this class that I met Walt.  He was quite adept at coding the older Apple ][‘s our school utilised and spent much of his free time coding and playing his version of Tetris.  We ended up befriending one another in class along with my coding partner (at the time) Michael ‘Mike’ Simons (a.k.a. Jesus) and through the process learned that we shared a certain fondness for coding whilst listening to the B52’s.  It was through coding whilst listening to the aforementioned musical ensemble that the idea for this post as well as the memory of Walt popped into my head.  I don’t know if Walt went into computers professional, or another science/mathematics field, but it woud be a sad loss for those fields if this were how it played out.  Mike Simons went on to work with the Slackware Linux distribution and I last saw him at Linux World Expo, New York in 2001.  I’d like to hear from either of them if they’re out there.



    Daniel ‘Dan’ Ervine:  During my seven year stint at Alliance Remanufacturing in Philadelphia, PA, USA at the turn of the past millennium I worked with a fledgling Network Engineer fresh out of a Marist College (a.k.a. Mattress College) named Dan.   


    When Dan and I first started working together he was still very much a Microsoft tool, but after exposing him to the real world of Unix and Unix knock offs like the various Linux distributions out there, I deemed him cured of his previous MS affliction.  We only got the opportunity to work with one another for a couple of years due to a restructuring which saw him lose his position right around the same time as his birthday and wedding.  


    We’d worked together on several projects (primarily me assisting in his Networking world) since it was something I wanted to at least learn and partake in once since I never work in the administrative capacity these days.  We grew to become friends and had the joy of travelling several times on business together (including two Linux World Expos in New York) and CAMM in Connecticut. 

    He’d changed dramatically over the years, all for the better and while it has only been a few years since I’ve been able to see and/or talk with him, I’d like to as I’m curious as to what he and his wife are up to, and where he is in his career, though I’m sure it’s a good place.


    So as I said earlier, there are many individuals with whom I’ve had interactions in the computing field which I’d like to speak to again given the opportunity.  I have many others whom I’d like to make mention but being that it is 00:45 in the morning as I type this  whilst watching “Ghost in the Shell : Standalone Complex” on the tele, I need to end it here.  I will continue this list in a later thread when time avails itself.