Devlico.Us
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @devlicious

Derik Whittaker

Thoughts on Software Development, .Net, OOP, Design Patterns and all things cool

December 2007 - Posts

  • Free Microsoft Press E-Books

    I found out today that the MSPress is giving away 3 new book. 

    For more information check out this link

    Enjoy

    Till next time

  • Classic, true love from a former co-worker :)

    Today I ran into this wonderful blog posting.  In this posting the author is sharing a letter he received from a former co-worker.  I know that most of us have had this feeling about someone else's code, but this guy actually said something about it.

    This is great.  What makes this great is that the blog author does not understand why he got this letter in the first place (this is my interpretation of his coments) .

    Check it out here

    It is new years eve, a day for a little humor.

    Till next time,

  • Why using the index for data retrieval is evil

    Today I was refactoring some sql procs along with the corresponding .net code that called the procs.

    My primary focus was to implement some new business rules (ways to get totals) in the proc.  In doing so, I completely re-wrote the proc.  In the end the return values (column names) were the same, but the column order was different.  To my amazement when I ran the application the numbers where in the wrong fields.

    As I started to track down the error I stumbled across this ugly evil.

    Estimate = (int)dataTable.Rows[0][0];
    InProgress = (int)dataTable.Rows[0][2] + (int)dataTable.Rows[0][1];

    Please people don't access data in a data table by hardcoding the index value.  Yes I know this is the 'fastest' way get the data out, but it is also the most brittle.  For less brittle code try the following.  Yes I know that if the column name changes your code breaks.  But at least in this case the application will throw an exception, not return the wrong value

    Estimate = (int)dataTable.Rows[0][ dataTable.Columns.IndexOf("Estimated") ];

    Sorry, just rate it when i have to fix evil code by lazy developers.

    Till next time,

  • What is a name, besides identity?

    Over the past 2-3 days there has been an uproar over at the altnetconf list.  Oops, I meant the cli_dev list.  This uproar is because of a single action.  Changing the name of the list.

    Some would like to argue that the name of the list is not important.  That the name of the list is simply an 'ID'.  That changing the name does not change the identity of the list. 

    However, I would argue that changing a name is to shed its old identity and be giving a new identity.  Now maybe this is exactly what was intended, maybe not.  But this action is not one to be taken lightly.  As changing the identity of something is a very dangerous action, as is apparent by reading the various posts on the list.

    The reality of it is this.  At the end of the day, the group will move on.  Feelings that are now hurt will get better.  The mud that is being slung will be washed off.  And assuming the community can pull through, we will be stronger for it.

    However, if the community cannot pull though this, then it was really not much of a community at all.

    My 2Cents on the matter

    Till next time,

  • Why Use Continuous Integration -- Beginners Overview

    I came across a nice article on CI today, thought I would share.

    You can find the article here

    Till next time, 

  • First Global ALT.NET Decision Makers Assembly

    <joke>
    Last night we held the first Global ALT.NET Decision Makers Assembly in
    Chicago, IL and the following items were discussed and approved.
    Pictures and slides from the event will be made available later.

    * Chicago, IL was proclaimed World Capital of ALT.NET
    just because its location seems highly convenient

    * Thread in the mailing list will be moderated and blocked
    if it doesn't contain an User Story

    * The verbiage of all our communications should not force
    readers to use google or another dictionary site more than
    once per paragraph. We will start with MTV-level of
    vocabulary and go from there.

    * As soon as the number of Mac users reaches 50% we will consider
    renaming the movement to option.net

    * To better reflect our professionalism level, our manifesto
    should be written in a DSL format. Bonus points if done
    using an LOLCODE internal DSL.

    * Members of the Assembly should be awarded lifetime R# licenses

    * A monthly meeting will be held to discuss new stereotypes for
    the developers "not in the know". The current list is very
    limited with only Mort, 501 Developer, Joe Developer, Average
    Developer, and "the folks out there".

    * Any new members named Scott will require background check

    * The ALT.NET Drinking Game has been defined as:
    "If someone says Mort, drink one.
    If Jeremy D Miller says Mort, drink two."

    </joke>

    OK, calm down. Just a silly joke :)

    But, in all seriousness, there WAS actually an alt.net
    gathering last night in the Chicago area. Derik Whittaker,
    JDN, and myself got together to talk geek over some beer and
    apetizers.
    We did end up also talking about alt.net and how we could contribute
    positively to get something going here in Chicago.

    Anybody else in the area that would be interested in starting
    some user group or at least informal events like last night's?

    (This posting was taken from the alt.net message board with permission from Sergio, besides, i was there, so I can post this :))

     Till next time,
     

  • NUnit 3.0, comments by Charlie Poole

    I came across some comments by Charlie Poole today (via the alt.net news group) about the future of NUnit.  As devoted user of NUnit, I am always interested in the direction of the product.

    Here is the posting, give it a read - here

    Till next time,

  • Replacing the KISS principle with the KIDD principle

     

    I am pretty sure most of us have heard of the KISS (keep it simple stupid) principle.  But I would like to coin a new principle.  This is the KIDD principle.

    So, what does KIDD stand for?


    K – Keep
    I – It
    D – Difficult
    D – Dummy


    Sadly it appears that way to many software developers follow the KIDD principle, not the KISS principle.  It is no wonder that so many applications suck.

    Till next time.

     

  • This code sucks....

    How many times as developers have we taken a look at someone else's code and said 'This stuff sucks' or 'WTF where they thinking'?  I know I have said this plenty of time.  I also am pretty sure that others have said this about my code.  In fact I am KNOW I have said that about my own code when I have to go back at a later date and maintain it.

    Why do we say this about other peoples code?
    Why is that as professional developers we take a look at the code developed by the craftsmen before us and say, this code is crap?  I think I know the answer:

    • It really is crap
      Sometimes time code is written by either unskilled developers, or simply in a manner that goes against all rational thought.  Sadly I am sure this happens more often then we would like to believe, but it is true.

    • It follows no discernable patterns
      There is nothing harder then reading code that follows no pattern.  This type of code tends to make everyone (even the author) scratch their head in wonder. 

      The sad thing is that code that is without pattern, is worse (in my opinion) then crappy code that follows patterns.  At least crappy code that follows a pattern can be easy to fix/maintain.

    • We don't understand the context of the code, or thoughts of the developer
      Even the best code can be 'crap' if the next guy does not understand why it was written the way it was.  As professionals, we have to assume that the coders before us 'had a reason', or they would not have written what they wrote.

    • We are envious of the code, but are too ashamed to admit it
      This is the hardest for me to admit.  There are times where we as professionals run across good, clean, concise code that is 'great' by all measure of the word.  But it may be over my head, or it may be following a pattern that is foreign to you.

      When this happens, we tend to put up our defenses and start slinging the 'this is crap' phrase around.

    Do we really mean it?
    When we say mean and hateful things about other peoples code do we mean them?

    • Yes, we are mean spirited people
      Sometimes we do really mean it.  Maybe it is crap, but do we really have to start telling everyone it is crap?

    • No, we just think it is bad code
      Sometimes we say the code is crap, but we really don't mean it.  This tends to happen when the code does not fit our style, or if it is using patterns we don't like.  Just because the code is not to your liking, does not mean it is crap.

      Maybe when we run across code like this we should use it as a time to learn, as a time to expand our horizons, or (gasp) a time to rethink some of our likes/dislikes.

    • No, but it makes us feel better saying it.
      This one goes hand in hand with the one above (We are envious of the code, but are too ashamed to admit it).  It is only human nature to mock that in which we do not understand.  DON'T lets grow as developers, take the time to learn and improve our skills.

    What can we do to prevent it?

    • Nothing, it is human nature.  Sorry :(

     

    The bottom line is this.  As much as we would like to say that what we do is a science, it is not.  It is an art form, and we are artist.  Because of this, we tend to unfairly judge things in which we don't like or don't understand.

    So the next time you run across some code that looks like crap, maybe it is, or maybe it is not.  But either way, just do what you have to do and move on.

    Final words
    When given lemons, make lemon-aid.  When given poop, make poop-aid.

    Till next time,

  • Making the jump back to Consulting

    For about the past year or so, I have been thinking about jumping back into the consulting game, but this time as an independent.  I was a consultant for about 5 years a while back and had a lot of fun, but the one regret I had was that in 5 years, I was really only on 2 projects.  When I got into consulting I had hoped I would bounce from project to project, technology to technology, but that did not happen.

    So after nights of deep thought, I have decided it was time to give it a go.

    I thought I would list out a few of the different thing that I thought about during my months of debating.

    Deciding Factors (for me)

    • Independence
      Like most people, I have always aspired to be my own boss.  Since I don't have any 'good' ideas for a software product, and I am really not willing to quit my job to open up a small business.  Going as an independent is the next best thing.

      I get to choose my rate (depending on market conditions), I also get to choose the types of projects I work on (again, depending on market conditions).  By being able to be in charge of this, I am essentially my own boss.
    • Change of pace
      No matter what you do for a living, you are bound to get in a rut after a while.  For me, this is now.  I still love writing code, but lately I have been in that development rut that I know so many of you have experienced at one point in time.

      By going solo, I am hoping that the change of pace will bring me out of my rut. 
    • Market conditions
      I live and work in the greater Chicago land area.  And currently the .Net development market is great.  The appears to be a large quantity of jobs, and not enough talent to go around.

    Things to think about when deciding on your rate

    When ever you are thinking you would like to go independent, there are a few things you should consider.

    • Do you need medical/dental insurance?
      For me, I don't.  My wife works full time and I am able to get all my insurance benefits from her via her company.
    • What about a 401k program?
      If the company you work for has a great 401k program, you will be giving that up.  For me, my current employers program is pretty bad.  There is no guarantee matching, and I don't vest anything for at least 3 years. 
    • Who much time off do I want each year?
      As an independent, you do NOT get paid for time off.  So sick time, vacation time and holidays are free.  For me, I am rarely sick, and I am willing to take vacation/holiday without pay, so not a big deal for me.

    For some good links on how to determine your rates check out these links.
    - A Guide To Information Technology Consulting Rates
    - Independent Consulting and Back Office Services
    - Consulting Rate Worksheet

    Here is how I came up with my rate

    Step 1
    Choose a target billable rate - for this demo we will say it is $65 an hour (going rate in the Chicago land area).

    Step 2
    Determine your current hourly rate.  This is your salary divided by 2080, total number of 'work' hours in a year.  Now you have a baseline for what you make now, including benefits.

    Step 3
    Now that we have our rate, we need to determine how much all our expenses are going to cost and subtract them out.

    1. 401k matching - lets say your company will match up to 3k a year (and you get the full matching).  At 3k a year, this is worth $1.44 an hour off your billable rate.
    2. Health insurance (cost if you had to buy it own your own) - lets say you need to cover you and your family, this could cost you about 5-6k a year.  At 6k a year, this is $2.88 an hour off your billable rate.
    3. FICA (Social security and Medical tax) - As a employee, your company will pay 7.65% for you, while you pay the other 7.65%.  So, at 7.65%, this is $4.97 an hour off your billable rate.
    4. Vacation/Sick/Holiday time - I assume that I am going to take 3 weeks vacation, 2 weeks holiday time, and 1 week sick time.

    Step 4
    Time to figure out your 'actual' rate after expenses
    65 - 1.44 (401k matching) - 2.88 (Insurance Cost) - 4.97 (FICA) = $55.71

    So, that $65 number is really more like $55.  So, if your salary rate is not at least $10 an hour less then the 'actual' consulting rate, I would say that it is not worth the effort.  For me, I don't have to worry about insurance (on wife's plan) and my company does not have any matching, so the only subtraction I have is the FICA expense.

    So my actual rate calculation is really
    65 - 4.97 = 60.03

    Thoughts for the future

    So, I guess the real question is, will this work out?  Who knows.  I have a 6 month contract (technically, it is contract to hire) to figure this out.  Maybe at the end of my first contract I will really love my client and take the hire option.  Maybe I will like client, but still decide to stay as an independent.  Maybe I will decide that I don't like the independent thing and go back to work for a company.  Who knows. 

    The one thing I do now is this, if I don't give this a try, I will never know.

    Till next time,

  • RedGate you rock, thanks again for the gift

    One of the cool perks of being part of the Devlicio.us group is that we are part of the 'friends of RedGate' program.  Every year at Christmas time they send us this great gift basket.

    IMG_1103 

    This years basket came loaded with sparkling wine, cheese, chocolate, crackers, cheese biscuits, nuts and salmon.

    I just wanted to extend my thanks to both the RedGate and Rachel, they are both great to work with.  If you are not familiar with the product line they offer, you should really check them out.  I personally use their SQL Prompt (every day) and ANTS Profile, and they both rock.

    Till next time,

    P.S. Not to sound like I am complaining, but I wish this years basket had another coffee mug, someone took mine :(.  Oh well, maybe next year.

  • Trust your tools, but only if you know what they are doing.

    Yesterday we were trying to change the session state properties of one of our sharepoint web sites and what resulted was really odd.

    After we made the changes, we started getting the following  in our event log error:
    Error: Failure in loading assembly: Microsoft.SharePoint.Portal,
    Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c

    Here is what we did

    1. opened up IIS
    2. right clicked on the site
    3. choose properties. 
    4. clicked to the ASP.Net tab
    5. clicked edit configuration
    6. clicked to the state management tab
    7. changed the Session State Mode from inProc to StateServer. 
    8. clicked ok, and thought everything was good to go.

    But wait, now NOTHING worked.  Sure, we could still surf to the home page of the sharepoint site, but trying to do anything caused errors.  So, we set everything back to the original values thinking this would solve our problem.  NOPE.

    After trying a bunch of different things and checking on google we finally found the issue (here).   The problem is we trusted the ASP.net configuration tool would do its job correctly, bad assumption.

    Turns out that when you use the configuration tool, it will add an xmlns attribute (xmlns=http://schemas.microsoft.com/.NetConfiguration/v2.0) to the <configuration> node.  For what ever reason, sharepoint does NOT like this node and will not parse the web.config file correctly.

    To resolve this issue, we simply removed the xmlns attribute and everything worked fine.

    I am not sure why the config editor would add this, if anyone knows please share.  Hope this post can help the next poor sap that has this issue.

    Till next time,

More Posts

Our Sponsors

Proudly Partnered With


This Blog

Syndication

News