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

Steve Hebert's Development Blog

Steve's Blog - From .Net to dotMath and everything in between.

July 2005 - Posts

  • Garbage Collection Articles: an updated list

    I previously blogged about a set must-read garbage collection articles and issues around directly calling GC.Collect().  Thanks to Raymond Lewellen who recently pointed me to the Maoni blog, and now I definitely need to update this list.  These entries are phenomonal and it's too bad that Maoni hasn't blogged in a while.  Maoni is a CLR Performance Lead at Microsoft.  I thought I saw that his name is Maoni Stephens, but I'm not certain that is correct - so I'll just leave the reference to a single name sort of like Aristotle.

    The first two articles by Jeffrey Richter do a great job at introducing the CLR and how it operates.  Mariani's article goes over some basics and looks at how usage scenarios can affect performance.  The final seven posts are by Maoni and detail how to best use and design for the garbage collector and monitoring runtime performance.

    Garbage Collection: Automatic Memory Management in the Microsoft .NET Framework - by Jeffrey Richter
    Garbage Collection—Part 2: Automatic Memory Management in the Microsoft .NET Framework - by Jeffrey Richter

    Garbage Collector Basics and Performance Hints - by Rico Mariani

    Using GC Efficiently – Part 1 by Maoni
    Using GC Efficiently – Part 2 by Maoni
    Using GC Efficiently – Part 3 by Maoni
    Using GC Efficiently – Part 4 by Maoni

    GC Performance Counters - by Maoni
    Tools that help diagnose managed memory related issues - by Maoni
    Clearing up some confusion over finalization and other areas in GC - by Maoni

  • LSD: AgileManagement.net site and Team System

    I was spending some time over at David Anderson's AgileManagement.net site.

    First, check out his interview with Robert Scoble.  David discusses the background of his influences from Eli Goldratt and W. E. Deming and how these are being molded into Microsoft Team System. He talks to some detail on managing the development process by actively watching the working queues and discusses the impact this has on software projects. 

    Next, checkout his webcast on Lean Thinking within MSF4.  I had no idea that MSF was going this route. 

    My previous view on Team System pricing with respect to MSDN subscriptions has been wavering over the past week or so and this may have completely tipped the scales.  I will post more on that topic shortly.

  • (Amazing) Code Smell - GC.Collect()

    I was reading Jeremy Miller's post on Code Smells and another classic .Net code smell occurred to me.  (I have to say I love the term 'Code Smell' - I use it all the time now. Thanks Jeremy.)

    The most insidious .Net coding smell I've run across is:
    GC.Collect()

    If you search your application and find this call, stop everything you are doing and focus on this problem.  Go check for this problem, I've seen it happen in runtime environments at 4 different companies so far. I recently talked to one programmer who bashed the .Net garbage collection performance because he said the model was to simply consume memory until it runs out of it.  Guess what - once again "GC.Collect()" was being called.

    From what I've seen, GC.Collect typically gets injected into applications when memory resources aren't released.  Rather than understanding the root problem, GC.Collect gets thrown into the mix. The patch of running  GC.Collect() in your application will allow your application to run longer, but the memory allocation changes to a progressive stairstep effect where the process eventually hangs. 

    The Garbage Collector is doing it's job correctly, however it's the routine and predictable calling of the collector that forces normally transient objects to be promoted to a status of "less transient" (my term, not theirs).  If you are calling this within your application you are introducing the same memory allocation path to the compiler each time and the same objects get promoted.  This promotion process is the normal functioning of garbage collection that allows the garbage collector to perform more efficiently and prevents the system from hanging for minutes on end like the old BASICA garbage collector.  Given this behavior and the articles I've read on the subject, I believe garbage collection in a framework environment like .Net and Java is predicated on running at random intervals to the application - allowing for a random distribution of errantly identified 'non-transient" objects. This also helps explain the need for multiple levels of promotion.

    If you run into memory allocation problems within your application, resist the decision to inject GC.Collect() at all cost.  Go out and buy a tool like Red-Gates ANTS Profiler for .NET and take the time to understand the root problem.  If you go the GC.Collect route, you will typically delay the problem until production at which time profiling will include side-effects of the GC.Compiler call and will delay the understanding of the core issues even longer when the cost is greatest.



  • User interface design - seperating the data view from the user view

    I was reading Ranjan’s post on user-centered-design techniques that provides insight into the user interviewing process.  This got me thinking about how we actually apply those results and some of the biases and assumptions we bring with us into those designs. 

     

    Every application has a data view which encapsulates the rules and operations around how data correctness is maintained.  This is not to be confused with the data model, but rather the living, breathing, operational flow of how data flows into and out of the data store.  One of the recurring failures in user interface design results from exposing the user-view to the data-view.  These two views rarely match and it's a constant battle keeping these two views separate.  It's not a coincidence that user interfaces can sometimes start to look like mini-ORM implementations.

     

    The best example of solid design that matches the targeted user is QuickBooks (not Quicken).  Every other accounting software vendor has tried to go after their market and failed – why?  Is Intuit simply destined to own this market?  I think problem goes deeper than that.

     

    Every accounting package starts with a team of accounting professionals and the notion of debits and credits as we are taught in school.  The double entry accounting system has been engrained in the profession since Pacioli’s first textbook written in 1494 and leads to an unbending view of how these systems should be implemented. I am sure the accounting experts at Intuit cringed at the initial design that not only ignored the credit/debit paradigm, but mercilessly taunted it.  To make matters more difficult for the sake of project management, those accountants are fundamentally right just as practicing accountants offer a common disclaimer that QuickBooks isn't a real accounting system.  Here's the rub - they ignore the targeted user and the fact that data is fundamentally not compromised.

     

    When translated to software, the credit/debit model becomes the “data view”.  The fundamental error that every other software vendor has made in this genre is exposing the data-view to the user-view.  From a requirements standpoint, you’ll notice this in design meetings when people say “well you must understand _____ in order to use our product.”  To some degree that is true, but that can easily become a mantra that leads to serious usability problems.

     

    Quickbooks is not the end-all product in accounting. As a company grows larger and requires more intensive accounting abilities they find that they have outgrown the tool and move on to something else.  But Intuit has managed to question the expert assumptions as related to their user based and derived a product that is extremely popular in a market segment far larger than any other in business accounting. Intuit owns the market because they not only listened to the user, but also challenged the ‘experts’. 

  • Freeform discussion on problems and feelings around Wise and InstallShield

    I've been spending some time checking out Duncan Bayne's blog where he is discussing some of his run-ins with InstallShield.  I ran across a particularly interesting post where Duncan and some commenters got into a debate over which product is worse - InstallShield or Wise. 

  • managing disposable objects in a graphical app

    Whenever I deal with disposable objects, I always wrap them in a using() statement religiously. 

    Now that I am writing a graphical application where the drawing engine may paint on different surfaces (24-bit bitmap vs. black and white), I've abstracted a 'Pallet' object with concrete implementations for each Pallet type. This allows me to abstractly ask the Pallet for things like a "BackgroundBrush" or "ShadowBrush". 

    My dilemma is this:  in the BackgroundBrush() method I believe it's better (performance-wise) to say something like:

          if( _backgroundBrush == null ) _backgroundBrush = new SolidBrush(....);
          // test nullness and throw exception here if necessary
          return _backgroundBrush;

    The problem arises if the client code makes the following call:

       using( Brush backgroundBrush = pallet.BackgroundBrush)
       {
          // do something with brush
       }

    My cached brush is now invalid for subsequent calls to BackgroundBrush.  This exception to normal coding practice has to be communicated and I know that it's just asking for trouble. 

    Since the creation of brushes take time, I'd rather have the Pallet object implement IDisposable.  When the system needs the picture drawn, it creates the Surface object and the pallet and wraps these with using() statements.  Using this method, each gdi+ object is created at the last possible moment and disposed at the last responsible moment.  This caching isn't a problem in my usual apps with databases because the real time it takes to create a connection is cached by the system - therefore I always dispose every connection and downstream object.  But this need is different.  I just don't like having a bunch of objects being returned that implement IDisposable but shouldn't have their .Dispose() function called - it just feels like a really bad code-smell waiting to happen .

    I suppose I could solve the problem by returninf an abstracted object, thereby pushing the actual object brush up into the framework , but I'm not there yet in terms of justifying that object. 

  • Aurora (Nail.exe) spyware fix

    I ran into a system infected with the Aurora spyware a couple of weeks ago.  The company maintains that it is not spyware, but it has no removal tool, it throws popups like crazy and it monitors the system and moves itself around using random file names.  As of today, Norton Anti-Virus identifies it but can't get rid of it. Symatec provides a removal tool, but that didn't work either.  I've used two separate spyware checkers and they can't delete it either. You can get more information on Aurora here... http://netrn.net/spywareblog/archives/2005/05/10/got-aurora-nailexe/

    The way to tell if you have Aurora is two-fold:

    First, check for Nail.exe in the C:\Windows directory.  If it's there, delete it.  If it reappears, Aurora is at work on your system.  The other place to check is in the registry under  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon.  The Shell key will have the value "Explorer.exe c:\windows\nail.exe".  If you try to modify this setting back to c:\windows\explorer.exe, the aurora software automatically renames it back to include the reference to nail.exe.

    The latest Symatec definition identifies this virus as "BetterInternet" and provides a remover that doesn't stop the behavior noted above.  To stop the behavior noted above, I took the following steps:

    (1) From a command prompt, go to the Windows/System directory and type dir>nail.exe   (this changes the contents of nail.exe and their software doesn't try to remedy this situation)

    (2) Reboot.  Upon startup you'll get an error message, but ignore it.  You can now delete Nail.exe and it will not reappear.

    (3) Finally, using RegEdit, go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon and change the shell key to "c:\windows\explorer.exe"

    Reboot and your system is now clean.

     

     

  • Bought my PDC tickets today...

    I just bought my PDC tickets today. I sure hope I win the contest - here's my pdc contest entry post.  I'm going to hold off on the airline and hotel reservations until I'm sure everything pans out.

    If I won I was thinking about taking my video camera and posting bits about the show.  I think I'll still take the video camera, but maybe I'll provide picture movies instead because they're much funnier (and less bandwidth)- if you're a fan of MadTV you'll know what I mean.

     

  • GraphML Primer

    Here is a handy GraphML primer that I'm referencing frequently.  The primer starts with a basic node/edge example and builds to more complex graphs and even conversion to an SVG format.
  • LSD Discussion: Push-based development taken too far - Agile

    I sat through a two-day presentation on project estimation and lifecycle selection by Steven Tockey of Construx Consulting.  The material was exceptional as I would expect from a company owned by Steve McConnell of Code Complete fame.


    When we got to the Agile approach, he explained scheduling as follows:
     --------------------------------

    From your prioritized wish list, decide what your next development cycle will create by assigning resources to work items until available resources = 0.  Plan your cycle to operate on a 4-6 week schedule and keep iterating until the wish list is complete.

    He also discussed the fact that Agile doesn’t allow for structured requirements development. As we know, Agile people will tell you “just put it on the prioritized wish list”.  The idea of placing requirements on the wish list is correct, but it is too difficult to be executed and managed well (without proper tools) on varying types of projects where requirements development and critical path become too complex.

     ---------------------------------

    Mr. Tockey’s view of Agile is correct by the terms of Agile, but the root failure in both camps comes from ignoring the differences between push-based and pull-based development.  In pull-based Lean development an arbitrary release schedule of 4-6 weeks is not only silly but it creates bad behavior.  Push-base Agile creates starting and stopping in the development process and also allows for Parkinson’s Law to play a greater role in the project.  While Agile restrains Parkinson’s Law greatly when compared to a Code/Fix or waterfall model, it still allows for ill-effects and your real awareness of underlying problems is limited to a window that opens every 4-6 weeks.  By then the awareness can be dulled by other side-effect interactions that happen as a result of the core problem.


    This leads me to think there needs to be a list of rules for Lean project management systems similar to Chris Date’s 12 Rules of Distributed Databases.  These rules need to be more than just guidelines or suggestions. On these rules, any implemented system can be judged on effectiveness.  For example, one rule might be “any lifecycle model can be followed under lean through gating techniques.”  A second rule that balances the first could be “projects should never be constrained to one lifecycle model during their lifetime due to changing conditions over the natural course of the project.”  It isn't until Lean can be described in these project management terms that it can be embraced by the Construx's of the world.

  • Note to Self: Rolling Wave project scheduling

    I need to check out Rolling Wave project scheduling when I have a chance.  I've been looking at Mark Graban's kanban blog and digging into the articles he has linked - it's fun reading.  I've got a couple of blog topics that will fall out of this, but in the meantime this Rolling Wave approach is very interesting...

     

     

  • Lean Manufacturing blog

    A good friend turned me on to a Lean Manufacturing blog over at blogspot.  He talks down computerized systems, however he has a lot of content on lean topics that appear across the web. I really liked his blog entries titled "Is Your Mediocrity an Emergency?", "New Book Focusing on Lean Failures" and "The Talent Behind China Inc."

    I'm looking forward to diving into this blog some more.

     

  • Intersoft's WebGrid.NET 4

    I just did some number tests on the new version of WebGrid.NET and it looks like a considerable amount of the javascript has been refactored into .JS files.  While an in-place editable grid with calendars can still require about 700KB of supporting javascript, 640KB is contained in obfuscated .JS files that can be fully cached by the client.  It's nice to see them move away from the Embedded JS files that had some setup issues with Windows Server 2003.  It's also nice to see the grid working with Firefox as well as IE - the product was previously IE specific.

    I haven't worked with the rest of the product or used this extensively yet.  I'll blog more as I hit this product.

  • John Deere site simply not viewable in FireFox!?

    I went to the John Deere site last night and this morning with Firefox - the activity indicator goes for a second and then stops with nothing but a blank white page.  I figured their site was down.

    Then, for kicks, I went to the site using IE - it's all there!

    I've never seen an entire site that simply doesn't display in one browser while displaying in another - it doesn't even make a half-baked attempt at displaying the images!  Not even a message declaring "we don't support firefox." I wonder why that is?

    Deere makes really great products, I'll have to put up a picture of my JD 455 power-raking lawn zamboni at some point.

  • American Standard/Trane hiring a TDD Guy

    The company I work for, American Standard/Trane, in White Bear Lake, MN is now hiring a Lead Development Software Test Engineer.  White Bear Lake is a northern suburb of the Minneapolis/Saint Paul metro area and located merely 12.5 miles from Jay Kimble's adopted hometown of Stillwater, MN.

     

    Part of the position involves driving Test Driven Development throughout the organization.  This is especially interesting when you consider that Trane develops tools ranging from low-level embedded devices to web-based enterprise servers.  This is an opportunity to drive the process and pull it together across multiple projects and the testing groups.   

     

    Below are some excerpts from the position description and essential job functions that help explain the scope of the position.   I'm waiting for the full posting on the comany website and will provide a link when it's available.  If you are interested, contact me and I can attempt to answer your questions and send you the full position document along with contact information. 

     

    Position Description

    §           Primarily responsible for leading the implementation and integration of TDD into the Controls Systems Engineering software development process. 

     

    Essential Job Functions

    §         Drive implementation of Test Driven Development into our software development process.

    §         Identify, purchase and implement TDD tools.

    §         Train the development group in the use of the tools and integrate into the software development process.

    §         Work with the Test group to understand the Acceptance testing process and how TDD should feed into it.

    §         Participate in code reviews to ensure design for testability.

    §         Develop a control plan and implement process improvements to ensure our TDD process is delivering the desired results.

    §         Report status of testing progress to the project test engineer, project manager, and department management.

    §         Develop, document, maintain, and improve development testing standards and processes.

    §         Manage and maintain test development environments.

More Posts Next page »

Our Sponsors

Free Tech Publications