Saturday, July 12, 2014

Week 1

My first week as a programmer is behind me!  First of all, it is a lot quieter in my little cubicle than it was out on the 911 dispatch floor. I will miss the excitement of 911 calls and the constant interaction with co-workers.  I know they will continue to do an excellent job over there and I will miss them all! (Good thing I still get to come back and harass them on weekends.)

Task number 1 was to get me set up on a computer.  Who knew that would end up taking a day and a half.  Seems that our software source control program, SourceSafe 2005 doesn't play well with Windows 7. From this experience I have learned two things.  First, SourceSafe is no longer supported.  From what I can tell, SourceSafe started out as a good source control program, but per Jeff Atwood's blog, it "was never updated architecturally to reflect modern source control practices." I'm thinking that Microsoft's Team Foundation Server would be the most likely upgrade for us. Second, source control is very important if you have more than one person working on source code at a time.  A SCM (Source Code Management) tool allows coders to "check out" files, work on them and then "check in" the files to update the source code. The SCM tool manages multiple people working on the same files at the same time and allows everyone to have the most updated version of the code. The other important thing a SCM tool does is to keep a history of all the changes made.  You can use the history to go back to previous versions to see when or why something was changed.  You could roll back a bug fix if it has unintended consequences.  And most importantly, you can go back to your original version to reminisce on what your "baby" looked like in its infancy.

Task number 2 was my first chance to write code in my new occupation.  Most everything here is written in visual basic and uses SQL server.  The program makes requests using sockets for temperature, humidity and dew point from 31 iServer units throughout the county.  It's most important task is then to check and see if those values fall within acceptable limits for each device. If they don't, it sends a notification by email or page to all parties wanting a notification.  This function is not currently working and I was given the task of rewriting it.  The program's original author, Gary was a very nice hippie looking gentleman with a well styled pony tail. He was on the tonight show in his youth in a 1960's version of a boy band.  He also received commendations for his work on writing a management program for the local veterans agency. For all his wonderful qualities, I'm not sure Gary thought too much about someone else having to figure out his code later on. I must say, though, that it was a good learning opportunity as I had to work through following his code line by line and looking up things I didn't understand as I went.  Although Gary's code uses classes, it feels to have been written in more of a linear fashion.  I have been trying to rewrite it following object oriented standards.  I took all the code to access the database and put it in a separate class. There is a class for each of the iServers, one for the measurements for each device (temperature and humidity) and one for the notifications.  The data class populates all the data for the servers, measurements and notifications and then the server class takes over getting readings and sending out notifications.  I do feel like it has been a bit of slow go for me, as I still have the notification of the users to write.  The program originally used a lot of threads, which is where my boss believes the problem stems from.  I can see why Gary used threads, though.  Making request to the sockets is very time intensive and keeps the program from doing anything else while it waits for the requests to come back.  Right now, requesting temperature and humidity from all 31 servers takes just over 7 minutes.  Gary had written another program which showed all the readings in near real time and it would only take about 10-30 seconds to get all the readings.  So, we shall see if my program works.  In the future I would like to learn how to write it using async and await, but I think that will have to wait until we are using Visual Studio 2012 or higher.





No comments:

Post a Comment