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

Eric Wise

Business & .NET

June 2006 - Posts

  • Don't be afraid to throw away code

    I was pondering this today while wielding a shovel to bury the drain pipes that hang off my rain gutters (new house and all, this is the kind of crap I get to do with my weekends).  Shoveling is one of my least favorite activities, but it is simple enough to allow the mind to wander.

    I was trying to pick out some things that I have been prone to do in the past that has hindered my performance as a developer.  One of these things is the need (arrogance?) to code things proper on the very first try.  I don't know how many out there are like me in this respect, but I absolutely hate to have to perform a given task twice.  While this coding "laziness" does inspire one to come up with the best possible design up front, I found that this can be damaging when you are entering a new problem domain.

    Case in point, I'm working on a call tracking system right now that allows sales reps to gather information but also requires them to run through a preset script with responses they can select to load additional scripts... up until now, I'd never really thought about a system like this.  In my youth, I would have sat and agonized over how to properly architect this, ultimately coming up with a design that would probably have some holes in it or not be all that great from a user experience perspective.  This agony was from the hesitance to throw away any work I had previously done.

    Instead of this attitude, I have embraced the attitude for this new domain that I am perfectly willing to trash as much code as is necessary to get this right.  By using some of my codesmith templates and the RAD tools of visual studio I am able to rapidly prototype bits of the system to get a better idea of the gotchas whether they are in the UI or in the business logic.  My first week on the project was spent taking the limited requirements and spinning them into asp .net user controls which I dropped into some test forms in various ways until myself and the end user manager were satisfied with how things were working out.  Then I went back in the second week and ripped out most of the RAD stuff and dropped in cleaner code that follows our internal patterns.

    Rapid prototyping is an excellent way to learn about a new problem domain.  It's definitely not a cure-all as when you're on a tight timeframe and tight budget the extra time may put you into the red zone.  In areas where I have good domain expertise I rarely prototype at all.

  • Just want Karl to know he isn't alone

    Karl made a confession and I just wanted him to know that not only is he not alone, but as far as the Agile Manifesto is concerned, TDD isn't even mentioned.  Too often I think we see people lumping TDD in with Agile when it's not really there at all.

    As far as TDD is concerned, people fall into several camps:

    • No tests at all
    • Tests for complex processes only (my camp)
    • Tests for every single method in the application

    Personally I find both extremes to be rather irresponsible when it comes to the business value and cost of what is being produced.  For example, I don't write unit tests for basic CRUD operations, in general the only time these break is if the database goes down.  It's simply not a productive use of my time to write tests for things that only fail if the database goes down.  Most of my tests revolve around calculations and financial data.

    *shrug* I don't think there's a right or wrong answer to it, but I also don't think people should feel like they should be writing a few hundred tests regardless of the actual domain.

  • Five Signs of the (Development) Apocalypse

    Throughout my time in consulting, mentoring, and full time work I have come to notice a few signs that tend to lead to over budget, late, and failed projects.  The intention of this post is to share these insights, hopefully with a bit of humor and it is definitely not to be taken as religious mantra.  =)

     

     

    Sign 1: “What We Need Is A Rules Engine”

    This statement always hits me like the bell toll of doom.  While I’m certain that there are scenarios that justify a rules engine the most common time I have heard this phrase have been from the small/medium business with a relatively low complexity application and worst of all, the statement appears before a single line of code has been written.

     

    How can you possibly advocate something as complex as a rules engine when you haven’t even seen what coding patterns have emerged yet?

     

     

    Sign 2: “We need to be Future Proof”

    Once again, this is a problem at the start of a project.  Once upon a time I was doing work for a company that was looking to design the next version of its internal software.  Said software was a glorified database I/O application that ran just fine on a single server.  The lead of said project demanded a structure that forced all of the developers to be remoting-friendly and spent a few months designing a back-end framework to wrap remoting calls to make them easier.

     

    The extra (useless) work not only ran the project over time and budget, but also caused confusion to the developers since they had to learn a custom framework which supplied functionality that wasn’t ever being used.

     

     

    Sign 3: “XML-itus / aka configuration hell”

    It seems from time to time in organizations an architect comes along that is absolutely fascinated by the XML concept and wants to put absolutely everything into XML configuration files with the thought of designing this glorious application that never has to be recompiled again.  Don’t get me wrong, I’m a big fan of web.config and configuration files where they make sense… this is a pretty limited scope for me though.

     

    Once upon a time I worked on an application where lists, keys, etc were spread out in various xml files plastered all over the application structure.  The end result is when you were looking for something you had no idea where to find it.

     

    Once upon a time I also worked on a project where an “enterprise framework” required that all stored procedures be placed into a huge xml file with all of their parameter information, etc as child nodes in the stored procedure.  The grand vision of this is that you could make changes without recompile, the grand reality of this was that anytime a database change was made you had to search this 5000 line config file to find the stored procedure and edit the xml config file as well as the database deployment.  Can you say additional points of failure?  Besides which adding or reading new parameters required logic changes anyways.

     

     

    Sign 4: “Bringing Down The Enterprise Hammer / aka round peg, square hole”

    Ah, the glorious enterprise framework.  For some reason it seems like developers feel compelled to create vast frameworks for their organizations and that every project and developer has to use them.  The flaw in this strategy is that the framework is often designed before the code that is intended to use it in which case the framework becomes bloated and often does not address the real problems end of line applications are trying to solve in an elegant fashion.

     

    Common Frameworks should never be written before experiencing the real problem domain.  Instead, developers should practice the following:

     

    1. Code Once
    2. When the code appears a second time notice it.
    3. When the code appears a third time, promote it.

     

    In this way you let your problem domain dictate the common functionality you carry around.

     

     

    Sign 5: “We’ll add staff later as-needed”

    This is a big management blunder that I have seen many times.  They under staff at the start of a project to save money, and plan on adding developers later if the project starts to slip off schedule.  The reality of the situation often is that adding developers to a late project makes the project later.

     

    To developers, the reasons for this are fairly obvious.  When you enter a new project there is a period of low productivity where you are learning the ins and out of the existing application and determining what needs to be done.  Non technical managers often think that a developer is like a phone support person in that all you have to do is put a body in the seat, give a few hour training session and it’s off to the races.
  • Worst of TechEd

    Wouldn't be complete if I didn't speak on the worst of TechEd.

    Bill Gates Steps Down: Bill, next time let me know first so I can sell my stock to avoid the dip and buy it back at a discount.

    Bus Drivers: They frequently missed the dropoff point forcing me to ride around the conference center at least twice, and then the unions went on strike which inconvenienced everyone.

    Windows Workflow Foundation: Of all the new .NET Framework 3.0 technologies this one did the least for me.  I need to look into it some more, I must be missing something, but it seemed like a lot of work (and code) to set up and in the web scenario that I focus on didn't seem to bring a lot of value.

    My free tote bag got lost/stolen: We got a free tote bag on day one that was filled with goodies and mine has either been misplaced or stolen.  I'm going to see if I can weasel another one out of the registration folks tomorrow.

    No WinFX Beta 2 DVDs: I got some cards with links to the new site for .net framework 3.0 where the sdk lives.  It's a > 1GB download though and I really would have appreciated having a dvd instead of having to download it.  Ah well...

    My fatness: Chips, hostess snacks, soda, ice cream.  There were food and drink stations all over the building stocked all day.  I'm going to need to do some serious working out to lose all this poundage.

  • Best Of TechEd

    I suppose I should comment on Bill Gates' announcement, but honestly, if I had 1/20th of his money, I would have retired long ago.

    TechEd was a lot of fun, but tiring.  I didn't make it to Fenway tonight for the big concert tonight because I'm wiped out and I'm going to bed early.  Here is the stuff I found most exciting at TechEd:

    Team System for Database Professionals: It appears to be everything I was hoping for.  This is a very powerful tool which should make working with SQL Server much more productive.

    Windows Presentation Foundation: Wow... all I can say is wow.  Up to this point I had been semi ignoring this because I thought it was a winforms only thing but that is certainly not the case!  I have over the course of several sessions become very interested in this technology for rich intranet apps and I hope to start blogging about it once I get the SDK downloaded.

    The coolest sessions for me were the one on Advanced SQL Querying Techniques by the dot not rocks host, Richard Campbell and the Refactoring to Patterns session, I have to apologize for not remembering the speaker on that one though.  The ten architecture mistakes session was a good break from the technical content and was pretty humorous.

  • Agile birds of a feather session

    Also last night I attended the Agile birds of a feather session hosted by Jeff Palermo.  Very nice discussion with success stories and failures as well as several questions about how to get your organization moving towards the principles of Agile.

    As I often see, being a student of business and development both, developer's biggest problem seems to revolve around them not speaking the same language as business people.  Developers see the principles of agile and they make a lot of sense, but when they communicate this to managers and executives they fail to focus on the aspects that make it good for business, not just developers.  I spoke a bit on this at the session, but I felt compelled to post my observations here as well.

    Business people that are not from an IT background only understand two things when requesting an IT project: Cost and Accountability.

    Cost is the easier of the two issues to address to executives.  Numerous studies can be found that show some disturbing trends in software development.  One is that ~72% of software projects go over budget, fall behind schedule, or outright fail.  72%!!  That's a horrible success rate and in most other fields this would be totally unacceptable.  Would you bet your life savings on something that only had a 28% success rate?  Probably not.  In addtion, studies also show that as you get deeper into a project, it becomes more expensive to fix bugs.  Agile principles such as quick release cycles and customer involvement can go a long way towards reducing these issues.

    Accountability is the more difficult of the two issues to address.  In general, people want to take on as little accountability as possible.  After all, accountability means that someone can be blamed for failure later!  Agile values having the customer as a part of the development team as much as possible.  However, this is how most companies work:

    Department/Customer: I need a piece of software that does x, y, and z.

    Developer: Ok, that'll take me 3 months.

    <developer runs off and codes, customer goes back to their normal duties>

    <3 months pass>

    Developer: Ta-Da!  Here's your software.

    Department/Customer: You know what, this isn't really what I needed, can you change it to a, b, and c?

    Developer: ARG!

    The only way to avoid doing 2-3 months of unecessary work is for the customer to catch the wrong things as early as possible.  To do this you need the customer to be involved, review iterations, and be available to assist with the planning phases of development.  This is a culture change for most organizations though as now the customer, via being part of the development process, becomes just as accountable if not moreso than IT.  This scares a lot of non-IT managers.

    To be successful in implementing agile principles you must successfully convince executives in your company that in order for projects to be more successful, the requestor of the project must be willing to champion it.  By being the champion the manager takes on accountability, and commits themselves to providing the necessary resources for the success of the project.  Don't be afraid to suggest that if the manager resists this accountability that perhaps the project isn't as necessary as they make it out to be.  =)

    Technorati Tags: ,

  • LINQ/DLINQ Birds of a Feather Session

    So I sat through the session moderated by sahil, and I must say it was pretty interesting with a decent dialogue going on.  I had downloaded the beta bits and toyed around with them a bit previously, but not in any thorough detail.

    There was a nice Q&A session at the end, but I didn't get to ask all the questions I wanted to ask, so I'm going to post them here, and hopefully someone in the community will pick them up and run with them.

    1. DLINQ seems to generate some kind of mapping file to the database.  This brought up a concern with me that if I'm embedding this into my .dll in a multiple developer environment.  If developer A makes a dev database change and updates the mapping then developer B fixes an unrelated bug somewhere else and pushes to production, will DLINQ ignore that the schema isn't the same?  IE as long as that database change isn't an explicit field that is being called in the assembly will it ignore it and move on or will it puke?
    2. LINQ queries seem to be able to filter just about any object collection that is IEnumerable... if making a round trip to the database isn't a scalability issue in your environment, how does the performance of in memory object filtering stack up to sorting and filtering on the database?  Since sorting/filtering is what SQL Server does, I'm assuming that it would be more efficient.  In a web environment, doing sorts and filter on the web server instead of the database server could possibly have a significant impact on scalability?

    All in all, it was an excellent session, Sahil and the Microsoft folks did very well fielding the questions.  They also put to bed that the new var keyword is not a variant (whew).  Let me repeat that: var is not variant.

    Technorati Tags: , ,

  • Greetings from TechEd

    Day 1.  I spent the morning getting the lay of the land, the convention center is pretty nice.  I did get some time to play with the team server for database professionals that I blogged about last week and it looks like it is shaping up to be everything I hoped it would be.  I may finally be able to set the sql server management tools aside and do all my work in the Visual Studio IDE.

    The rest of the day I'm going to spend in seminars and I'm still waiting for the vendor area to open up to see what kind of swag they're giving out.  Hoping to run into Eric Sink and the Telerik guys as well.

    Technorati Tags:

  • Review: The Business Of Software

    I've been quite busy with various life things recently, but I was very flattered when Eric Sink offered me a copy of his book, the business of software.  Apparently my hanging around in the joel on software forums paid off.  =)

    Anyways, I'm sure many of you have seen his articles on msdn, and those of you who frequent Joel have seen his posts.  Eric runs Sourcegear which is most notable for it's very nice Vault product which in my opinion is a much better alternative to sourcesafe.

    I'm sure that many of us developers (myself included) have dreamed of throwing off the shackles of the corporate world and starting our own software company.  The "micro-isv" is the popular term for the garage band of the software world these days and Eric Sink having started as a small shop and grown successful has a lot of advice to give out on the subject of micro isvs, business, and development in general.  That's where this compilation of his writings comes in.

    The book is divided into four parts that spread across all the aspects of starting and running a successful business that most computer geeks are weak in like finance, marketing, dealing with people/sales, and hiring.  (Of course, I will overlook his disdain for MBAs *chuckle*)

    Naturally your own business idea may make some of the writings more applicable than others, but I assure you that the more you learn about running any kind of business, the better off you will be.  And to have the opportunity to learn from someone who has been successful in the software business and writes in an approachable, often humerous manner is truly a pleasure.  I recommend this for anyone who is dreaming, in the process, or just curious about the micro-isv phenom.  Besides this obvious target audience, I think that the chapter on "Career Calculus" should be required reading for anyone entering or in the software field.

  • I'm coming around to DLINQ

    If you're interested in DLINQ you should be reading sahil's series on DLINQ as well as the series by Scott Guthrie.

    DLINQ seems pretty neat.  It might be growing on me.

  • Team Edition For Database Professionals

    I got pretty excited when I came across this.  For all the back and forth about stored procedures / ad-hoc the thing that has been missing in the DBA world is a clean interface for DBAs with developers.  I currently use database projects to version my stored procedures, but it's not all that elegant or impressive of a solution.

    It seems like this is going to be addressed!  It also allows for T-SQL unit testing which should be interesting.  If Microsoft successfully pulls this off, does the whole argument about business logic in the classes vs stored procedures go away?  Afterall, both a class and a stored proc exist as a file, and if they are now both in the solution and potentially you could "goto" the stored proc from the data layer code just like you could goto a class...

    Food for thought.

More Posts

Our Sponsors

Free Tech Publications