in

Foo Theory

Partners in Community - serving up some ice cold Kool-Aid!
Welcome to footheory.com.  The bloggers and contributing members on this site are consultants, project/program managers and software architects working across the US.  Our community will focus on Microsoft technologies, .NET architecture, software patterns & practices and just plain stream of consciousness.

this.Reflect(); - Donn's Weblog

The technology Blog of Donn Felker
  • Unnecessary Abstractions

    Jason Bock had a similar title to this post awhile back … and I found a forehead-slapper today when reviewing some code in a app I’m working on during my free time. I seriously said “What the <ExplativeGoesHere>”.

    Here’s the code:

    image

     

    There is absolutely no need to do this. This is exactly WHAT the IPAddress class does. The worst part is that the programmer who developed this knew that the IPAddress Class existed.  I’m amazed daily.

    Posted Aug 27 2008, 12:29 PM by donnfelker with no comments
    Filed under:
  • Twin Cities Code Camp – Oct 11

    Posted Aug 27 2008, 11:47 AM by donnfelker with 1 comment(s)
    Filed under:
  • Twin Cities Give Camp Update

    imageThe Twin Cities Give Camp site has been updated.

    If you would like to volunteer, you can sign up on the volunteer page and if you or your company would like to sponsor the event, you can sign up on the sponsors page.

    If you have any questions, please email us from the contact us page.

    Side note: I have been having an intermittent problem with Grafffiti loading properly on the site. At times when you visit you will receive the graffiti cms error page. If you try to access the site again, it will go away. If you get an error, please let me know as I’m trying to sort it out with the host. Thanks!

  • Insane Flight Prices

    I was on my favorite travel pricing site today and I was looking up how much flights were from MPLS to Des Moines. Now I'd probably never-ever fly to Des Moines because I believe its only about 3.5 hours away via car. But with gas prices these days you have to check it out. When I used to live in Phoenix, a group of friends and I would always go to Vegas every year. We drove a couple of times but we eventually found out that flying was actually cheaper (back then - 6-7 years ago). A round trip ticket would cost us 80 dollars. Talk about DEAL!!!!

     So, wondering if I could score the same for another short flight such as Des Moines would be awesome. 

     YEAH. RIGHT. 

     Look at this scree capture: 

    WTF 

     

    Seriously. Over $700 dollars for a ticket? YOU GOTTA TO BE CRAZY! - or as the New Yorkers in the Bronx where I lived for awhile would say it "Yo dawg, dat price is banana's!"

    Its apparent the airlines no longer have deals (at least in this case). If I do go, I'll be driving. :)

    Posted Aug 22 2008, 06:11 AM by donnfelker with no comments
    Filed under:
  • The Twin Cities Give Camp

    SpoonAndCherry I’ve presented at code camps and given presentations to technical audiences and institutes and I will continue to do so. I have a passion for giving back to the community that has helped me become the what I am today. I’ve decided that I want to give back to the community even further. After doing some research to find someone (or a group) who might already be setting up a Give Camp I’ve come to the conclusion that they don’t exist here in the Twin Cities.

    Therefore, I’ve decided to start up the Twin Cities Give Camp (site not complete). The web site is www.twincitiesgivecamp.org.

    I’ll be updating the site this week with all relevant info in regards to the Give Camp. No dates have been set, but as soon as we have one the site will be updated.

    What is a Give Camp?

    A Give Camp is a weekend-long event where software developers, designers, and database administrators donate their time to create custom software for non-profit organizations. This custom software could be a new web site for the nonprofit organization, a small data-collection application to keep track of members, or a application for the Red Cross that automatically emails a blood donor three months after they’ve donated blood to remind them that they are now eligible to donate again. The only limitation is that the project should be scoped to be able to be completed in a weekend.

    At the Give Camp, there is an expectation of “What Happens at Give Camp, Stays at Give Camp”. Therefore, all source code must be turned over to the charities at the end of the weekend (developers cannot ask for payment) and the charities are responsible for maintaining the code moving forward (charities cannot expect the developers to maintain the codebase).

    Source

    More in depth info can be found here: www.givecamp.org

    Do you want to be a part of this awesome experience?

    We are in need of volunteers, developers, designers, DBA’s, volunteers, Project Managers, Charities, Prizes, Giveaways, sponsors and more volunteers. If you would like to participate or sponsor this event, please let me know. I will update this blog as soon as www.twincitiesgivecamp.org is updated. I will be in contact with the local PMI, IIBA, and ISSA, AITP and local .NET User Groups.

    More info to come soon!

    Posted Aug 12 2008, 09:13 PM by donnfelker with no comments
    Filed under: ,
  • DiscountASP vs. Me

    DiscountASP just won. Argh! I wrote a long blog post (because I dont have access to Live Writer on this PC) and then clicked Publish and it logged me out. Dont understand what I'm talking about? Read on .. 

    Unfortunately, what DiscountASP.NET does not tell you is that due to Community Server 2007’s large memory footprint (~100 megabytes with little to no activity), DiscountASP.NET has to recycle the application pool frequently, sometimes as often as every 5 minutes. The DiscountASP.NET policy is to recycle an individual website’s entire pool once it reaches a size of 100 megabytes.

    Here are the consequences of being forced to recycle the application pool on a CS 2007 server:

    * All logged-in users are logged out;
    * any posts that you may have been writing will be lost if you try to press the submit button;
    * the entire website is brought to a crawl with slow load times;
    * and in essence it makes Community Server 2007 unusable.
    Source - http://www.marketing-ninja.com/hosting/discountaspnet-and-community-server-do-not-mix-despite-what-discountaspnet-advertises/
    *Shakes fist violently*

     

  • Is Premature Optimization Really Evil?

    dominos
    Photo Courtesy of: rosendahl
    My first initial answer is … it depends. (Isn’t that the case for everything?) :)

    Today I had conversation with a colleague and we were discussing how application developers don’t plan ahead.

    This eventually brought up the question/topic:

    “Is premature optimization pure evil?”

    My colleague stated that all optimization should be done up front, while I on the other hand, disagree. In my opinion all development should be done first and then lets figure out where we might have some problems, with some exceptions (which we both agreed upon).

    So, what did we agree upon?

    Lets look at a classic example:

    Developer Joe and his team were asked to create an order management system that could handle up to 10,000 orders a day. This doesn’t sound like that big of an issue, and Joe and his team also agreed. It shouldn’t be a big issue. A fast database, a fast web server, and a few third party controls to interact with. No problem! Heck, this is pretty straightforward they thought. In reality, the requirements were very straight forward, no hidden features, no scope creep, nothing like that. Heck, it was a dream project come true. With that said - development ensued, and two months later Joe’s team delivered the product and everyone was excited to see the product run from end to end. (By the way, this was not done TDD or with any Agile Methods – which IMO would have caught any of our upcoming issues, if the tests were written correctly. But then again “If ‘if’ was a fifth then we’d all be drunk”).

    Joe’s team fired up the application for a demo and ran some orders through it and it worked great. They even ran 10 orders through the system in one minute (~14,400 Orders a day). They had gone above and beyond the call of duty (original requirement being 10,000 orders a day)! They were due for a raise! Life couldn't be better! The system was released and the company started to use it. Orders were flowing through the system without failure and the business was happy.

    Until the company decided to sell an exclusive hot item two weeks later …

    Then SHTF… All of a sudden, customers were experiencing time outs,  orders were being duplicated, and the customer service line was being rung off the hook. Essentially, all hell broke loose. After looking into the system, the developers noticed that the system had only accepted 6,000 orders. What gives? This system should handle 14,400 according to their tests. *everyone is scratching their head at this point*

    Scalability is Relative

    Scalability in this case, is relative. While looking at the stats, Joe’s team realized that those 6000 orders came in in about 1.5 hours. This was the first 1.5 hours that this product was available. At the end of the day the company eventually sold under 10,000 units, so why did this issue happen?

    Lets take a look at some stats:

      Orders Per Minute Time Between Orders (seconds)
    Original Spec (10,000 Per day) ~7 8.64
    Current State (6000 in 90 Minutes) ~67 0.9

    Orders Per Minute Equation: Orders / Minutes          Minutes: (HoursInDay * MinutesInHour)

    Orders Per Second Equation: Seconds / Orders       Seconds: (HoursInDay * MinutesInHour * SecondsInMinute)

     

    Do we see the problem here?

    Again, scalability is relative. In this case, analysis and optimization was not done ahead of the time to anticipate the flood of orders at a peak period. The spec was straight forward:  The system is to be designed to handle an order rate of 10,000 orders a day. The system was designed exactly to the spec, and in this case, the system was designed incorrectly.

    Now, I have a confession… 6 years ago, I was Joe. Yes, I made this very mistake. I was a hero for a couple of weeks, then SHTF. :) Live and learn. Live and learn.

    When We Agreed

    My colleague and I both agreed that in certain instances premature optimization should be done, such as this case. The developers should optimize the order process to handle issues at peak times. Perhaps implementing a order service, based on MQ, or implementing a service bus for this type of high-availability process would be the best. In this case, we agree. All of this analysis and optimization should be done up front because this type of thing WILL be a problem at any peak utilization times. We both agree that neglecting to analyze the problem domain can and will lead to performance problems down the road. Plain and simple.

    When We Disagreed

    My colleague and I still disagree on the statement of “all code should be optimized up front”. In my opinion this is a BDUF approach that I tend to shy away from. I don’t necessary mean that no design should happen up front, but I do think it should be limited. In an agile environment things tend to change, and we need to be able to adapt quickly. Wasting months in front of a whiteboard, with of reams of documentation, and endless meetings only slows the process down if something has to change down the road. Re-updating project baselines, and adjusting documentation and so forth is a huge hassle. I would like to state that there is a place for this type of development though. Some companies do require BDUF approaches because of huge regulatory compliance issues, so sometimes there is not much you can do about it. However process driven approaches such as ITIL and Agile can work together if done properly. With that said, I tend to shy away from BDUF approaches because of a simple example that is also exemplified by Jeff Atwood in a previous post of his (and I agree with him and the many other experts in the field). Jeff adds a third rule to M.A. Jacksons Optimization Rules that I like agree with the most:

    And I would add a third: don't optimize work that doesn't have to be done.  - Jeff Atwood

    This can be demonstrated as a sort routine. Lets say you have a menu that will be populated via user selections and the maximum number of values you can have in the menu is 100. You can either implement IComparable and utilize the List<T>.Sort() method to sort the class (which utilizes the Quicksort Algorithm) which would be SUPER easy but may not be the “Fastest” method of sorting, or you could write an extension method to create your own sort routine to sort the 100 items. At this point we’re splitting hairs. A millisecond, or even 10 milliseconds, wont matter at this point in UI response. We’re only sorting a menu that will never grow beyond 100 items. At this point, pre-mature optimization is evil. There is NO need to rewrite something that that does the job well enough. Can we do it better? Yes! Is there a need to? NO. We wont get any value out of it. The time spend on development is wasted compared to the benefit to the application.

    On the other hand, if the menu had no upper bound limit, then we would want to implement the best sort routine we could because some routines are exponentially faster than others. In this case we would want to optimize early because the possibility of a bottleneck can and might occur in certain situations.

    It all boils down to: “It Depends”

    At the end of the day, the true answer to “Is Premature optimization evil?” is “It Depends”.

    It depends on the problem. It depends on the architecture and design. It depends on analysis of the domain. It depends on the factors which “could” come into play.

    Finally, what it really boils down to is: It depends on MONEY. We can optimize all day and gobs of the companies money in development/optimization costs. This is why deep analysis into the problems need to take place. As architects we need to define the business process that could impact our architecture design and implementation and development of code. At some point we need the business to interject into this analysis and optimization party to say “Listen, I’m willing to deal with X, but I’m not willing to deal with Y”. At that point, our jobs as Architects is to define how much X costs compared to how much Y costs. Only then will the business truly know what should be done juxtaposed with what should not be done.

    To sum it up in my own personal opinion, premature optimization can be evil. We, as architects and developers need to think about the problem at hand before we write a line of code. As I stated above, there is no need for a full 90 page document on the process, but at least whiteboard with your colleagues. Are you a solo developer and need someone to bounce ideas off of? Join your local user group, join some groups online, visit the MSDN architecture forum and ask questions.

  • Mobilizing Your/My Blog - mobile.blog.donnfelker.com

    Having a blog has its benefits, but sometimes people want to access your site via a mobile device and, well…. lets face it, rendering your site across many different mobile platforms, looks, well…. LIKE CRAP. Hell, half the time its unreadable.

    How to Enable Your Site For Mobile Viewing

    If you want to mobile enable your blog, its super-easy with the service provide by mofuse.com (no I’m not getting paid to write this). Literally its only a few steps and you’re done.

    1. Create an account
    2. Plug in your blog url that you want to “mobilize”
    3. Choose the url  you want
    4. You’re done!

    You can view my mobile site at: http://donnfelker.mofuse.mobi/

    Here’s what it looks like in a emulator:

    Basic Mobile Phone Apple IPhone
    image image

     

    Sprucing Up the URL

    Although this is real easy to set up, the URL “donnfelker.mofuse.mobi” just seems clunky to me. Mofuse gives you the ability to set this to a custom domain.

    I wanted my domain name to be representative of the content that was being delivered, therefore I chose mobile.blog.donnfelker.com (it is the mobile version of my blog right?).

    Changing this is fairly simple, however you will have to alter your DNS records. 

    1. Log into your mofuse account and click on the blog that you’ve Mobilized.
      1. image
    2. Click Custom Domain
      1. image 
    3. Enter your domain that you will be using and make note of the CNAME entry you will have to make.
      1. image 
    4. Click save and you’re now done with your mofuse portion of this task.
    Adding a custom CNAME to your DNS records.

    1. This all depends on where your site is hosted and where your DNS is located. Mine is located on my host. *Important note: This will be different for each person, but this is how I alter my DNS with my host.*
      1. Log into your host.
    2. I selected my domain for editing.
      1. image
    3. Clicked DNS Configuration
      1. image
    4. At this point in time my DNS info was displayed to me. It looks like this:
      1. (Click for full size image)
      2. image 
    5. Click “Add DNS CNAME Record”
      1.  image
    6. Add the CNAME record and click Submit
      1. image
    7. Done

    You will have to wait up to 48 hours for this CNAME to take effect. I did mine last night at 9pm and when I woke up at 6 it was already up and running.

     

    Conclusion

    Its super simple to set this up and kudos goes to the guys/gals at mofuse. Now I can go to mobile.blog.donnfelker.com and view my blog on my mobile or send the link to anyone else who wants to see it on a mobile. Excellent!  Good luck in setting up your own mobile blog!

  • Passed the ASP.NET 3.5 Exam

    I took the ASP.NET 3.5 Exam (in beta form) on June 5th at Tech-Ed 2008 and today I received notification that …. I PASSED! Woohoo!

    What does this mean? Well, it means that I’m now an MCTS in ASP.NET 2.0 and an MCTS for ASP.NET 3.5.

    MCTS_Logo

  • Calgary ALT.NET Open Space – August 15-17

    So, are you going? If so, you better sign up quick! Space is going fast!

    What is an alt.net open space?

    First lets define what an open space actually is…

    How Open Spaces Works

    Whoever shows up is the right group. Whatever happens is the only thing that could have. Whenever it starts is the right time. When it's over, it's over.

    An Open Space conference's agenda is decided upon by the conference participants during the opening of the event.

    You can identify an issue relating to the theme of the conference for which you have a genuine passion and for which you will take real responsibility.

    Think of powerful ideas that really grab you to the point that you will take personal responsibility to make sure that something gets done at the conference.

    You may lead sessions, you may participate as an attendee, you may take responsibility for capturing proceedings, or you may just hang out in the halls and talk with interesting people.

    Be prepared to be surprised.

    source: altnetconfcanada.com

    What Topics Will Be Discussed?

    * TDD
    * BDD
    * DDD
    * Agile
    * Lean
    * Practices
    * Technologies
    * and more...

    Check out the open space details here.

  • Tree Surgeon 2.0 Released

    Better late than never…. :)

    Our team coordinator, Bil Simser, announced this same thing on his blog a couple of weeks ago. 

    Tree Surgeon is a .NET Development Tree Generator.

    Basically, we added …

    • Support for Visual Studio 2003, 2005, and 2008
    • Ability to choose unit testing framework NUnit and MbUnit
    • Updated NAnt scripts for .NET Framework 1.1, 2.0, 3.5

    Download the release here

    Posted Jul 13 2008, 09:10 PM by donnfelker with no comments
    Filed under: ,
  • Virtual Earth - End of Life

    This week Microsoft announced that their Virtual Earth product versions 3, 4 & 5 will be retired.

    As part of our planned deprecation schedule for older versions of Virtual Earth, we will be permanently retiring Virtual Earth version 3, version 4, and version 5 in the coming months. If you are currently using one of these versions, please read this notification and the end-of-life schedule that applies to the version(s) of Virtual Earth you are using. Please note, this Virtual Earth version end-of-life plan only applies to Virtual Earth and does not affect the MapPoint Web Service.

    Please note, this does NOT affect the Microsoft Map Point 4.5 Geocoding class that I wrote. This class will continue to do its job. :)

    Related: Google Maps Geocoding Class

    Posted Jul 02 2008, 06:56 AM by donnfelker with no comments
    Filed under:
  • Recommended Reading

    Every now and then I have people who want to know what books I recommend in regards to IT and Software. My list tends to change over time, so I plan on keeping this up to date. I'll be posting this link on the home page, so feel free to check back any time. 

    PatternsOfEntAppArchi

    Patterns of Enterprise Application Architecture  - Martin Fowler

    Great book with great patterns for enterprise architecture. 

    head-first-design-patterns-book-cover

    Head First Design Patterns

    Good intro to design patterns.

    PragmaticProgrammer The Pragmatic Programmer

    Great book for those who like to program but what some more direction on the ways of great software development.
    RefactoringToPatterns Refactoring to Patterns

    Learn how to refactor your code into patterns.
    WorkingEffectivelyWithLegacyCode Working Effectively With Legacy Code

    New to unit testing? Having problems with how to understand and test old code? READ THIS BOOK. This book helps any developer understand "hand-me-down" code. :)
    AgilePatternsAndPRacticesinCS Agile Principles, Patterns and Practices in C#

    Can't be a book written by Robert C. Martin like this one. All around goodness.
    xUnitTestPatterns xUnit Test Patterns

    You know how to unit test? But what about all of these edge cases? How about testing sending emails? How to test file handling?
    FrameworkDesignGuidelines Framework Design Guidelines

    A great resource for someone who is attempting to write a framework for a team. This is not the end-all-be-all, but it is a good resource.
    CodeComplete2_thumb Code Complete 2

    A must read for any developer.
    AgileSoftwareDevelopmentWithScrum Agile Software Development with Scrum

    Get a grip on the development process with Scrum.
    SoftwareEstimation Software Estimation

    Another classic from McConnell. If you need to learn how to estimate better, pick up this bad-boy. If you're agile or waterfall, this can help.
    releaseit Release It!

    Having trouble getting things out the door? This book will help guide you. Completely mind altering book.
    PracticesOfAnAgileProgrammer Practices of an Agile Developer

    Excellent book on agile development.
    LearningWCF
    Learning WCF

    If you're interested in SOA, then you need to learn WCF. This book helps you ramp up and get dirty quick.
    rAgileWebDevelopmentWithrails Agile Web Development With Rails

    Again, in my quest to learn new languages, I decided to whip up some web apps with Rails. Very slick, very nice. If you want to learn how to build web apps with Ruby check out this book.
    EverydayScriptingWithruby Everyday Scripting with Ruby

    In my quest to learn a new language every year, I picked up a copy of this book. It has been outstanding in helping a .NET architect become a dynamic language convert.
  • GMail = Dog Slow

    I've been using GMail since it first came out. I remember getting it and having TWO invites to send to friends. This is back when Gmail invites were going for $100.00 a pop.

    Through the years its been a great service and I've love every single second of it. Its truly the best at keeping track of conversations, and this works wonders for insanely active groups like ALT.NET.

    Over the last couple of months its seemed that Gmail has gotten progressively slower and slower. Through using Fiddler I was able to determine that larger chunks of JavaScript was coming down the wire. The amount of AJAX and DHTML going on behind the scenes brings Gmail to a crawl.

    How to overcome it?

    On the top right hand side of your page, click "Older Version".

    image

    This will load the UI without all the bells and whistles and its about 5 times as fast in regards to response times.

    Unfortunately there is not an option in the preferences to make this stick. As soon as I log in, I immediately click "Older Version". Alternatively you can also switch to "Standard HTML View" at the bottom. But with this, you don't get any smooth AJAX. Its regular HTML page post backs.

  • I Took The ASP.NET 3.5 Beta Exam, and then the red pill

    At Tech-Ed last week they offered the ASP.NET 3.5 Beta Exam. The beta exam is not available in Phoenix, so I decided to give it a whirl on Thursday. I didn't plan to take the test so I didn't have a lot of time to review (maybe 30 minutes of review) and I just dove in and took it.

    Normally MS Exams have about ~40 questions and they take a couple of hours for me to complete. I was expecting the same from this one...

    Nope. This exam had 70 questions. Wowza. I'm assuming the reason for this is one of these scenarios:

    • This is a beta exam and they need to weed out some questions
    • They have bumped up the number of questions in the exam

    So how hard was it?

    Well ... it's a little harder than the 2.0 version. A lot of it is repeated from 2.0, but this new beta exam threw me for a loop in a few areas.

    The areas that threw me for a loop were:

    • WCF Integration Questions (I'm very well vested in WCF, but I just was not expecting it in this exam - there's a WCF exam for that!)
    • Deep AJAX Questions (Don't do much AJAX stuff, lets be honest... JavaScript is not my favorite language)
    • Miscellaneous Mobile Questions

    The main thing about MS exams is that they are LONG and tricky. Sometimes you'll get asked a question and all four answers look right. LOOK VERY CLOSE. You'll see that maybe one word is spelled wrong, or the line's are swapped, etc. They will confuse you. But the main thing to do is be alert. The test will wear on you, its long. By the 2.5 hours in, you'll get tired of the test and you'll want to just hurry through it, don't. Just take your time.

     

    So How Did I do?

    Since its a beta exam, I won't know for about 2-3 weeks. They send your results in the mail. I feel like I passed, but we'll see when the results come in.

    ... and no, I didn't take any pills before or after... :) I'm just joshin' ya'll.

More Posts Next page »
Copyright ASIQS Corporation © 2006, All rights reserved.
Powered by Community Server (Commercial Edition), by Telligent Systems