Complexity of adding parameters

The other day we were refactoring some code and moving things around which I was all excited about.  Most of the stuff was being moved to make it more modular and there wasn’t much actual change to the code needed.  Doing a quick review I noticed something like this:

had been updated to this:

get_power and get_list are hard coded for this example but are really computed at runtime.

Since I strongly believe that having a clean object model greatly improves your application I dutifully left a comment.  The comment basically stated that we’re now mixing instance and class method functionality and although this could help performance it could also lead to weird things like

I immediately got responses stating “who would ever do that?” which is a great question.  I don’t know anyone that would ever do that purposely but I also don’t know anyone that purposely writes bugs in code.  The reason this pains me much is it now leaves an big opportunity for someone to do something accidentally.  Even worse is if they did that this method would fail silently (meaning it would produce a result as if nothing wrong happened, but that’s an whole different post).

The other argument I got was the “little” bit of risk is worth the benefit (referring to increased performance).  Performance is always a concern but is there even a performance problem here?  We might be optimizing a bit early here but some metrics could prove me incorrect here.  Then I got to thinking more about the “little” risk of this change.  Is it really little?  I started to write down all the things that had to be done now for this method:

  1. Add a comment to describe what the new parameter is (and it’s default)
    1. Comment what happens when passed nil
    2. Comment what happens when passed empty
    3. Comment what happens when passed an array of a different type
    4. Which array takes precedence? The one passed in or the one called from within the method?
    5. Update the return comments
    6. What does happen if you pass a different list in
  2. Add tests (mostly duplicates) for when passing in the parameter
    1. Test for nil passed in
    2. Test for empty passed in
    3. Test for array of different type passed in
    4. Test which array takes precedence
    5. Test what happens if you pass a different list in

Wow… that’s a lot to keep track of.  So much in fact I stopped writing things down.  I already know that people will say “you don’t have to test all those variations since they are already tested in the non-passed in version.”  Most of the cases may be covered by one set of the tests but tests (especially unit tests) are most powerful when used as regression tools.  You don’t know what’s going to change in the future or how it will change so you need to do your diligence now to try and catch it when it happens.

Yes, now when it is fresh in everyone’s mind this doesn’t seem like a big issue but think about a year from now when there is a bug and you have to revisit this.  Having to figure out all the quirks is time consuming and difficult.  It’s also good to plan for the bad things people can do (intentionally or not).  Imagine this method computed the amount you were going to charge someone.  This would be a terrible bug that I wouldn’t want to have to track down:

It sometimes help to imaging that the next person to read your code will be an axe murderer

Posted in Technology | Tagged | Comments closed

Developer’s English Skills

I don’t have an exact measurement but I would guess that less than half of the time I spend typing I am writing code.  This means that a majority of my typing time is spent writing communications to another human.  This blog is an example of that.  Throughout my normal work day I will compose notes, emails, instant messages, and text messages all of which need to be understood by someone.  Because of this I strive to always compose my writings to the best of my ability.  I am no grammarian, but I can normally successfully convey my thoughts.

Programmers are notoriously bad at writing correctly (at least most of the programmers I know are).  At first glance you might think this isn’t a large issue since we are writing code that only a computer has to understand.  This is untrue.  As I stated earlier, I believe I write for humans more than I write code.  I have had a few experiences where bad grammar in code has had a large negative impact.  I have literally had a bug in my code where I had spelled something incorrectly.

Because communicating with humans is such an integral part of a software developer’s job I hold the developers I work with to a high standard.  I require that the code is well commented and readable.  As well as being commented the comments also have to be full English, grammatically correct sentences.  I even require that member names (properties, class names, variables, etc.) be spelled out with no abbreviations and are understandable when read.  I get a lot of push back from my team about spelling out known acronyms/abbreviations.  I often hear complaints like:

Why do we have to spell out EE?  We all know what it means!

This is a valid point.  EE definitely means Enterprise Edition.  Wait… it doesn’t mean that?  I guess my friend has a different perspective since they are a Java developer.  The correct answer is Electrical Engineer.  What?  I’m wrong again…  That doesn’t make any sense.  Everyone knows what EE means!  There aren’t that many definitions for it.  Oh, I understand.  My current project has a specific definition for EE.  The definition isn’t even listed in the acronym list.  EE in my case is domain specific.  How would a new team member know what EE stood for?  I can’t imagine trying to explain all the acronyms and abbreviations we use to a new team member.  At one point my employer had and acronym/abbreviation list that was pages long.  This also had the same problem of entries being defined multiple different ways.

Being clear on what you mean is the main force behind me enforcing these rules and constraints.  Every once in a while things can go wrong.

NHibernate Search Result

NHibernate Search Result

In this case the title of the posting is technically correct.  When searching for my problem I completely understood the point this person was conveying.  The only downside to this post is the title also has a slightly inappropriate meaning.  It sounds like a headline you would hear on the nightly news.  This title like the EE example is domain specific but slightly amusing with the possible misinterpretation.

Communication skills are important even for developers.  Having comments that can not be understood is just as bad as not having them.  They are just as important as the code itself and should be treated that way.  They have to meet all standards, get reviewed, and be well written.  The effort put forth now to treat comments as part of the code pays off greatly in the long run.  You and others will appreciate the well written comments as you reuse and maintain the code base.

Posted in Technology | Tagged , | Comments closed

Life with my EVO

This post may be a little past due (seeing that I’ve have my phone since June) but it is time that I talk about my HTC EVO.

Size

At first glimpse the phone looks HUGE.  In comparison with my iPhone (with its case) it was only a slight bit larger.  I thought this was going to be a detriment at first but I have grown to love it.  The 4.3 inch screen is awesome.  Surfing the web is a lot easier with more screen real estate and typing with the larger keyboard is awesome.  When I use and iPhone now I feel like everything is very tiny.  I have definitely grown to love the screen size and the physical size of the phone is not an issue.  Even though the phones are roughly the same size, I don’t think the EVO looks as bad as the Droid X.  The EVO may be large but when I see people holding a Droid X it looks like they are holding a television remote to me.

Android

This is a hot topic these days: iOS versus Android.  Which one is truly better is up for debate.  I normally side with Apple in the fact that all of their stuff usually just works.  I’m past my tinkering years with gadgets; I want it to work right out of the box.  Also Apple’s products are very consistent.  They all work the same way with the same design.  In the realm of mobile phones though I only used a small amount of Apple functionality: phone calls, text messaging, and web surfing.  Any other usage was a 3rd party app.  Although Apple tried to enforce these apps to be similar they never really were.  In this aspect iOS are very similar.  The user interfaces I see the most are from 3rd party apps.  I live in an app world so the look and feel of the OS is not that big a deal to me (in the mobile phone realm that is).

Notifications

The true shining difference between iOS and Android to me is the notification system.  Android blows Apple out of the water on this one. With iOS I never felt like I was being informed of all that was going on.  Sure applications could push me information but I always felt like if I wanted to keep updated I had to constantly be checking for updates.  This is not true with Android.  Android (the applications really) tell me about everything.  I know when there is severe weather around or it is my turn in scrabble.  In fact it can be too informative and I’d have to turn off some of the notifications.  I now feel as though I am connected at all times and that I don’t have to go and ask for updates.

HTC

The one bad thing I have to mention is the standard UI.  HTC has gone and added Sense UI to my phone which is great.  It looks better and has some additional functionality than the standard Android operating system.  The bad part is my UI is different than the one on the Nexus One, Droid, Droid X, and Galaxy X just to name a few.  This is annoying.  My friends and I are unable to help each other, or sometimes use another’s phone, because the interfaces are too different.  That’s just plain annoying.  What am I going to do about it?  Nothing.  Android is new and with this amount of freedom this is bound to happen.  We will eventually settle on a standard.  Till then I’ll just wait it out.  I see this following the same path as Windows.  When it first came out there were a ton of different interfaces and skins for not only the OS but all applications.  Over time the strongest survived and now most applications all follow a standard.  This will be the same thing to happen in the Android world, it just needs some time.

Screen Sensitivity

I’m not sure whether to put this in the good or bad category.  The screen on my EVO is much more sensitive than my old iPhone.  I guess I’ve grown accustom to it an it isn’t an issue anymore but in the beginning I was doing all sorts of crazy things.  I’ve pocket dialed someone and have even pocket texted someone!  That was a little annoying.  Currently I’ve learned how to avoid this and have no problems with it.  Just an interesting point to note.

To sum it all up I love my EVO.  I was scared in the beginning that I wouldn’t like it but it has all turned out GREAT!

Posted in Technology | Tagged , | Comments closed

Life with Sprint

It’s been just about 2 months since I got my EVO.  This also marked my switch from AT&T to Sprint.  Now that I’ve had time to use the service I figured I’d share my thoughts about it.

Coverage (A)

The big providers in my area seems to be AT&T and Verizon so I was skeptical about the coverage I could get with Sprint.  A coworker of mine has had Sprint for years and said they’ve never had any issues with coverage.  So far the coverage has been great.  I have coverage most everywhere and usually the only times I don’t get coverage is when I’m inside certain buildings.  This tends to be rare so it’s really not a huge issue with me.  In some of the more distant areas of the city I have been known to be roaming (more on this later).  The only time I’ve ever really lost coverage was in the mountains in Tennessee.  Wasn’t really expecting much so I wasn’t disappointed.  My camera still worked so I was happy.  All said in done, coverage is not an issue.

Speed (A+)

Coming from AT&T there is no comparison.  Data speeds are super fast.  A point to note here is that I’m using a completely different phone with different hardware.  I’m sure this is a factor but I still don’t think AT&T can match the speeds.  I have seen my EVO download megabytes in less than a minute.  Impressive!

Plan (A+)

This is probably the best part about Sprint.  The plan I have is perfect for me and well priced.  For $69.99 a month (plus all the taxes and “government fees”) I get unlimited everything except minutes.

Minutes: My restriction on minutes is 450 “Anytime Minutes” which amounts to minutes to a landline that aren’t during nights and weekends.  Seeing that most of the calls I make are to another cell phone and at night or the weekend I’ve haven’t even come close to using up my minutes.

Data: My plan includes unlimited data.  Before I switched off of my AT&T plan I checked my data usage.  It wasn’t terribly high but I was usually over the 200 Megabyte mark.  I figured I wouldn’t be much different with my new phone.  I was wrong.  With my EVO I use a lot more data than I did with my iPhone.  My guess is because with the Android operating system processes are allowed to run in the background which can send and receive data constantly.  This along with my data speeds is probably the reason why I’ve used more data.  The unlimited data plan was a good idea.  The only issue I’ve had with my data is when I was data roaming in a more remote part of the city.  When I found out about it I wasn’t too happy.  The good thing is roaming is covered in my plan so it is no additional charge for me.  Awesome!

Text: I don’t have to much to elaborate on for texting.  My plan gives me unlimited texting and I use a ton of them.  It’s become my primary way of communication.  This is probably the main reason why I never use up my minutes.

Other (A)

4G: Not in my area.  I believe that Jacksonville has it an Orlando should be getting it soon.  Not a big concern of mine at the moment though.  As much as it would be nice to be even faster, my current speeds are more than acceptable.

My final rating for Sprint is a solid A.  I’m not sure how the share plans work out but I’d like to think they are just as good.  Hopefully they stay that way.

Posted in Technology | Tagged , | Comments closed

Inception

It’s rare, and I mean rare, that I actually recommend a movie.  There are a lot of aspects that all have to work together for me to thoroughly enjoy it.  A comedy or action movie are always fun to watch but there is more to a great movie.  Things that make a movie great for me are

  • Relates to real life – Transformers is fun, Hot Tub Time Machine is funny but neither are really things that happen in real life.
  • Detailed/Intricate stores – I like stories with a lot of depth and thinking.  Puzzles are always the best.  Who figured out The Sixth Sense before what was happening was revealed?
  • Later analysis – I always like to analyze and revisit details of the movie with friends afterward.  Was the solution there the entire time?  What parts are inconsistent?  Did the ending reveal the entire correct truth?
  • Time perception – The thing I hate the most is sitting in a moving thinking how long it is taking.  My mind starts to drift and I stop paying attention to the movie.  If the movie starts to drag on it fails.

Why am I telling you all of this?  Is it because I’m planning to become a movie reviewer and I want to be clear on how I’m going to rate movies?  No.  Well not 100% no, but close.  I’m telling you all this because I think Inception was a great movie.  It covers all the points listed above:

  • Real life – They describe events and actions that I have seen or experienced
  • Storyline – Complex enough to be intriguing but not confusing.  My brain had to stay in gear the entire time to keep track of what was occurring.  Had I missed pieces I would have been lost.
  • Analysis – Just hours later I was discussing with friends points of interest we noticed in the movie.  We pondered inconsistencies and subtleties and how they changed the meaning.  Our final question: Did it fall?  (If you haven’t seen the movie that question won’t make any sense.)
  • Time – Not at any point during the movie did I wonder when it was going to end or how long I had been sitting there even though the movie pushes two and a half hours.  (This isn’t entirely true.  I purchased a soda before the movie began so by the time it was ending I needed to use the men’s room.  I know, too much information…)

For me Inception floats to the top.  I don’t think I’ve seen a movie as good since The Dark Knight.  Surprisingly I want to see it again.  I’m sure there are many details that I missed out on watching it the first time.  For anyone that hasn’t seen it I recommend taking the time to watch it.  It’s definitely worth it.

Posted in Entertainment | Comments closed

Photos/Video taken with my EVO

A while ago, probably when the blog post was posted, I read this blog entry. This then lead to the reading of this post. After reading these two articles I knew that I wanted to have a camera with me all the time. I partially knew this already but carrying a camera with me is a pain. I already hate having to carry keys, wallets, phones, and what ever else I may need for my current adventure. This is why I love the idea of having a camera integrated as part of my phone. The big problem with this up till now has been the fact that the cameras integrated into phones haven’t been the best and most of the time were not worth the hassle. They either took terrible photos, took to long or to much effort to work, or were plagued by some other critical issue. My iPhone’s camera wasn’t too terrible, but it was very picky. Sometimes the pictures would be good, other times not so much (so example photos from the iPhone can be seen in this post). This is why I was very excited to hear about the 8 megapixel camera on the EVO. I had high hopes this would finally solve my problem of always having a camera with me.

I am relatively pleased with the photos that the EVO takes. The pictures turn out well and the software is fast (which is a surprise to me). The pictures are the best when the lighting and conditions are at their best but even under harsher conditions the photos still turn out well. Instead of just talking about them I figured I’d show them to you. Enjoy the gallery and let me know what you think or if you think I should try taking a picture under some certain set of conditions. I tried to get an assortment of conditions in the images below (some including usage of the flash).

Things I’ve noticed about taking photos:

  • Lighting is important. If it is dark out the pictures tend to be a bit grainy and not as crisp.
  • Certain conditions cause the software to take a bit longer to snap the photo. I believe this to be when the conditions aren’t the best and the camera is trying to focus.
  • You have to stay VERY still. It seems like the camera is very susceptible to blury pictures if you move even a little. I’m guessing this is because there isn’t stabilizing software which would slow taking the photo down.

As an added bonus I’ve included a random video I took with the camera. I wasn’t overly interested in video but I figured I would give it a test run anyways.

Posted in Technology | Tagged , | Comments closed

EVO Unboxing

I decided to take everyone along with me on my journey of opening my new HTC EVO. I know this has been done a bunch already but I wanted to do it anyways.

The items contained in the shipping box:

The contents of the box

The contents of the box


The contents of the shipping box including the phone (in its packaging) and the rebate forms.

The phone packaging was a bit strange. It reminded me of something I’d get a microwave dinner in.

HTC EVO Packaging

HTC EVO Packaging


HTC EVO Packaging

HTC EVO Packaging


HTC EVO Packaging

HTC EVO Packaging

All the stuff that was in the phone packaging (still in their packaging).

Everything in the EVO Package

Everything in the EVO Package

Everything out of the package and unwrapped. The list of items include: A return envelope for an old phone, cable, USB->Power adapter, battery, phone, “Important Sprint Information” book, “Basics Guide”, “Get Started” in English, “Get Started” in Spanish.

Everything out of the package and unwrapped

Everything out of the package and unwrapped

Now it’s time to get the phone working. Here are the pictures of the battery compartment open with the battery not yet installed and one with it installed.

Open battery compartment (battery not installed)

Open battery compartment (battery not installed)


Open battery compartment (battery installed)

Open battery compartment (battery installed)

The next step in the instruction guide was to plug it in and let it charge.

Cord, Plug and Phone

Cord, Plug and Phone


Ports on bottom of phone

Ports on bottom of phone


USB cable connected to phone

USB cable connected to phone


USB connection to plug

USB connection to plug


USB connected to plug

USB connected to plug


Phone charging

Phone charging

The next step was to turn it on. I wasn’t sure what to expect here so I did as it said and pushed the power button.

Top of phone with headphone jack and power button

Top of phone with headphone jack and power button

Start Up Screens

HTC EVO Startup Screen

HTC EVO Startup screen


4G Startup Screen

4G Startup Screen

After the start up screen it takes off right into “Hands Free Activation.”

Hands Free Activation

Hands Free Activation

I waited a minute though and then my fear was confirmed; there was a problem with activation.

Hands Free Activation Failure

Hands Free Activation Failure

Since I was not working with a Sprint representative I pressed “Manual” as I was instructed to do. The phone did a quick check for network and then informed me that it couldn’t connect. I can’t say that this was a surprise to me. It then launched into a demo of how to use the keyboard. Since I had previously had an iPhone the demo didn’t teach me anything new but I went though it anyways.

Keyboard Demo

Keyboard Demo


Keyboard Demo

Keyboard Demo

After the demo I was taken to the home screen.

Loading Home Screen

Loading Home Screen

At this point I couldn’t get the phone to make calls or connect to the Sprint network. I logged onto the Sprint website and after chatting with a service representative I learned that my number have not completed porting yet (it was coming from AT&T). I called Sprint and had them adjust the time the porting would happen and a few minutes later I was up and running.

*Yes, all the pictures were taken with my iPhone 3GS which I’m probably going to sell.

Posted in Technology | Tagged , | Comments closed

Bike Shed Example

I had never heard of the this until I read this post. To sum it up in a few words the “Bike Shed Example,” formally knows as Parkinson’s Law of Triviality, states that “organisations give disproportionate weight to trivial issues“.

I had never really noticed this before but after I learned about this I see it all the time. I was slightly shocked that I’d never really noticed this before. I started to think about this. I even noticed myself and the group I work with doing this all the time. Why do we do this though?

My take on this differs slightly from the argument given in Wikipedia. I think we do this because humans like the feeling of accomplishing something. Recently I was involved in a discussion where we were talking about how to implement threads and a thread manager in the application I was building. We spent a few minutes on it and them moved on to the next issue without actually deciding on a solution. That seems strange. Threading is a very complex task to undertake so why wouldn’t we want to decide on a solution? I think this is because coming up with the final solution is very difficult and will take much time and thought. There isn’t much instant gratification in deciding on a solution.

A little while later the group was discussing another feature and we spent probably at least 30 minutes discussing button placement and text. This is definitely trivial in comparison to threading. But after thirty minutes we had decided on a solution; we had accomplished something. This I believe is the key point. We didn’t mind discussing the buttons at length because we knew in the end we would have a solution.

Time to accomplish something is important to us humans. In the threading example it could easily take a day of brainstorming and designing to come up with a solution. The thirty minute discussion about buttons gives us that feeling of accomplishment in 1/16th the time (using an 8 hour work day).

Something to think about next time your group is in a drawn out discussion.

Posted in Random | Tagged | Comments closed

Music Filled Weekend

This past weekend just flew by. In short it was 3 days (spread out over 4 days) of audio enjoyment.

The weekend started on Thursday when I went to see PRISM put on by the Sebastian River High School Band and Choir. I am a huge supporter of arts in public schools and this concert is a exemplary example of what can be achieved. It is amazing what can be produce by high school students and their supporting faculty and staff. Every year I see the show I’m reminded of the exciting times I had when I did performances in high school (although I’m partial to marching band shows).

Friday was a scheduled non-working day for me. This worked out great as I didn’t return home until late Thursday night and it gave me time to rest up and finish some chores before the remainder of the weekend.

This leads us to Saturday. I got up Saturday morning and did some errands before heading downtown for the festivities. I wandered around the city for a while and stopped to have a drink and see a part of the Florida Gators game before meeting up with friends. Everyone arrived around 5:30 and we enjoyed some dinner before heading off to see Trans-Siberian Orchestra. The show was outstanding. The show by far is one of the best I’ve seen. Most people I’ve told about them don’t recognize the name but recognize the music. The music is only a small part of their show. The had the most elaborate sound/light/laser/effect choreography that I’ve ever seen. The videos of their shows do not accurately represent the complete awesomeness of the show. Any time they come to a town near you I STRONGLY suggest you go and see them. They are worth every cent of the ticket price.

The weekend wrapped up on Sunday when I went with a few friends over to Tampa for 97X’s Next Big Thing. Next Big Thing is pretty much the same as Buzz Bake Sale, which we’ve attended for years, but this year Buzz Bake Sale was on the same day as the Trans-Siberian Orchestra performance so we opted to go to Tampa instead. Another awesome day of musical enjoyment. We got there in the early afternoon and left right before the end of the last set in attempt to get ahead of the traffic. Overall it was an awesome day. We arrived home around 1 in the morning and I immediately fell asleep. I am extremely glad that I had enough forethought to take Monday off. I would have been miserable if I had to get up Monday morning and head into work.

Overall it was a very busy weekend but well worth it. All the planning feel right into place and everything went smoothly. Hopefully next year I can plan a similar weekend.

Posted in Music | Comments closed

STS-129

At 2:28 this afternoon space shuttle Atlantis lifted off and it was a beautiful launch. I wish I had photos to share with everyone. I try and watch all of the launches and can’t think of the last one I missed. I’ve always been a supporter of the space program along with science and education. It’s hard to believe that there are just a few more launches remaining before the shuttle fleet is retired (I think only five more remain). It hasn’t quite sunk in yet that I’ll never see a shuttle launch into space again after the fleet is retired. I’ve been watching the launches my whole life (my parents and I used to walk over to the golf course across the street to watch them) and I’ll be sad to see them go.

If you want to check out more about STS-129 you can go here.

Posted in Random, Technology | Tagged | Comments closed