Archive

Archive for August, 2008

Commenting your code – why not what.

August 28th, 2008 Paul No comments

Today I had to modify a small part of our flagship product; this particular part was written about 2 years ago by developer who is no longer working with us.  Back then we did not have too much time on our hands to actually maintain some kind of coding standard.  The variables are named poorly, there was no history of the class modifications, but there was one part of the project that looked promising – he did leave comments.

Unfortunately the comments that were there did not help me at all.  Here is the problem – the developer who wrote the classes I needed to modify went out of his way to block a certain type of input by user.  Input strings were checked couple of times as well as an event was called to verify input on every key press.  And guess what – I have to have the form and the code behind to accept this type of input against which this developer fought so hard.  While it did not take me long to disable these road blocks, I still can’t understand why were these things blocked.

The comments were there, and they were describing what was the code doing and not why.  Realistically speaking, any developer can read code and get some idea what is happening, you don’t need to comment it, I was searching for an explanation why and I did not find it.   There was no unit testing provided, so I have no idea what my changes do to the stuff that was already written and I have no reason to be certain what will happen to the code until we test it, and trust me, this will be the most tested area for this new release.  Did I needed to see explanation of how a foreach loop is executed – no; would I love to see explanation why this input was blocked – YES.

Categories: 9-5 Tags: ,

Freelance – current state of affairs.

August 19th, 2008 Paul No comments

I have to admit, I had not picked up a freelance project in quite some time.  Its summer, I have no desire to code after work, I got comfortable with my financial situation – you name it.  I have not been actively seeking projects, just enjoying my free time.  However, lately I decided to get back into freelance game, but I am not having any luck.

Back when I was actively pursuing freelancing, I had some previous customers who would provide me with occasional contract, craiglist and couple of sites that put clients and coders together.  I even paid for membership at guru.com, which by the way was not a wise investment.  There are tons of sites that freelancers can go to get some work, but I can’t imagine that if you live in North America, you will make any kind of money from those.  Take Guru.com – today, flipping through roughly 10 pages of projects under “Programming” – not a single project where client is prepared to pay more then $500.00.  I am not a greedy guy, but if I have to choose to code something for less then $500 and go play ball hockey with my son, I choose ball hockey any day.

Maybe the fact that I am focused on desktop development rather then web coding is affecting my success with freelance projects, I guess that is a big part of it as the web seems to be hot and desktop is not.  Still, I know that there are people out there that needs a quality software developed, and I am their guy.

Categories: Business, Projects Tags:

Code reviews are effective.

August 8th, 2008 Paul No comments

Rosetta Studio is about 5 years old.  It was started as a little side project, but grew into a popular app within our niche.  Right now we are quite comfortable with our release schedule, we take time before actually releasing to analyze and test the software, as a result there are fewer bugs and overall customers are happy.  But it was not always this way.

When I joined RS team, well, there was no team.  There was Matt, the guy who came up with the concept and there was me.  Rosetta then was in v 1.2, so we did not have many features implemented, basically the app was so vanilla, we only had 2 clients.  We had lots of ideas, and very little time and patience to maintain some kind of development system that would help is stay on course.  On top of coding, we had to do sales and support plus we were expected to help everyone else with their computer related problems (like fixing Outlook and writing Excel macros).  All this left very little time for development, and we had potential clients breathing down our necks twisting our arms to get the features they wanted implemented soon.

We were working in a fire brigade mode, there were fires, and we had to put them out fast.  There was very little time to think about writing optimized and efficient code.  As long as it worked, it was good enough.  This might appear as a good model for someone with a new app, features are added quickly, we had releases quarterly, our client base grew and soon we realized that we don’t need to put out fires.  We still have a list of suggestions (which actually more like demands then suggestions) and we are working on those, but now there is no rush to get it done, so we are doing it properly now.  Matt is gone now, I lead development team, and we got enough coders to maintain a good pace and write quality code.  But the stuff that was written in the past is not going away.

Right now we are rewriting Rosetta from scratch.  We need to adapt to the new framework, plus Office 2007 and localization and let me tell you, it’s a lot of work.  To address the issues of the old code, and believe me, I was thinking about it for quite some time I came up with this weekly code reviews.  Now every week one of us takes a function from those old classes and rewrite it in the most efficient way the developer can imagine.  Then, the developer has to present his work to everyone, explain briefly what the class and the function is all about, what and why was changed as well as measurable benefits of the change.  I thought that first of all we will slowly start changing the code, which when done properly is a good thing, some of us get exposure to classes that we never worked with before and we would share some of or knowledge.  To start it, I decided to go first.

Picked up a function, shaved some time on execution, dropped a loop, did some smaller things.  Just to make sure everyone is paying attention put some goofy things with appending a space to a string and then trimming the end of it.  Everyone caught it right away; I guess the guys are responding to this new idea.  We’ll see how will it progress, but basically I would recommend this to everyone running a small development team as a good exercise and learning experience.

Categories: 9-5, Management Tags: ,

Visual Source Safe is driving me nuts

August 6th, 2008 Paul No comments

For a while we’ve been using VSS for all our source control needs.  On top of VSS we had to get Source Anywhere just so we could work from home.  Granted we don’t have a huge development shop here, we mostly work from office and our requirements for source control software have been pretty modest, but VSS is just not performing.

During this year, we lost code.  There was a very bad case of it when we spent 3 days hunting down a bug and then fixing it only to notice that somehow the changes did not registered with Source Safe.  There is also issue of branching and merging – I have to say that when I am forced to do branching it completely ruins my day.  After branching is done, I am usually grumpy and unapproachable.  With merging, its like that famous line from Forrest Gump – you never know what are you’re gonna get.

After doing some research, I think Subversion should work better.  There is only one tiny problem – I can’t find a good unbloated tutorial on how to get this thing started.  I know, RTFM but who has time for that?  For the next few days I will try to get Subversion work for us.  If I will come up with a simple way of getting it going, I will post a short tutorial, probably just for myself, for future reference.