MS Petshop 3.x, your thedailywtf.com material times 1000

For the soon to be released major update for LLBLGen Pro, v1.0.2004.2, I'm porting the Microsoft Petshop project v3.x to show some of the new code implemented in the upgrade. Now, I've seen a lot of crap code in my life but what Microsoft dares to offer as an example for .NET is beyond, well... , crap. Sorry to say this, but after working with the Microsoft Petshop code for a few hours, my eyes bleed. This isn't an example, it's code solely ment to run as fast as possible in the benchmark tests to show how fast .NET can be.

I truly wonder if this goo Microsoft calls Petshop 3.x is doing any good for .NET. Anyone looking at the code can only be shocked. The code is completely unmaintainable, inconsistent and can only set the wrong example, to put it mildly. A lot has already been said about this Microsoft Petshop version (and the previous versions weren't any better) but I'd like to suggest that MS uses a couple of hours to write a proper example using the Petshop code, to show new .NET enthousiasts it's not common to write code chewing-gum goo-style but to write solid, readable, maintainable code and .NET can help you with that.

Now if you will excuse me, I've some bleeding eyes to cure...

11 Comments

  • If performance was the goal, then they acheived it. Let's face it, good design will *sometimes* come at a cost of performance... albeit minimal, IMVHO, compared to the sanity you will save while maintaining the code going foward.



    I'm sure you're well aware of this though since, after all, O/R mapping is pretty much the epitome of examples when it comes to this kind of tradeoff. ;)

  • It would be interesting to compare it to the Java version in that regard.

  • Have you ever looked at non-example code that comes out of Microsoft? Like the old packaging and deployment wizard in VB6? Some of that stuff is scary bad too.



    You have to realize that the group that's always talking about the proper way to write code is a completely different group than the groups that are WRITING code. hehehe. Great design only gets you so far, then you have to bow to the gods of performance and perceived performance. :)

  • It's not an example, it's just marketing.



    Look at the Java version of the Petshop...



    As Marsh pointed out good designs comes often at a tradeoff with performance, and the purpose of the MS Petshop was to outperforms Java, which suffers from prejudices of being "too" slow (doing what?)...

  • Hi Frans,



    Looking forward to seeing your port. It will also come in handy for all llblgen users out there to see how best to use llblgen with an asp.net application.



    Will you be adding an example of webservice support?



    Thanks,



    John

  • I always wondered how an on-line pet store would ship a saint bernard.

  • They got so much crap for the first release by Vertigo Consulting that they tried to be more OO but really only showed that they do not have a good handle on what is a decent OO example. I scratched my head about this thing quite a lot when it first came out. That whole business with having the object model all seperate off by itself was odd. Thats just one item. Anyway I think its fantastic that your creating a bigger sample than whats avail for LLBLGen thus far. It definetly will cut down on support calls from me :-) and others. Thanks for doing that.

  • My thoughts exactly.

  • "Looking forward to seeing your port. It will also come in handy for all llblgen users out there to see how best to use llblgen with an asp.net application.



    Will you be adding an example of webservice support? "

    Yes, as full support for webservices is implemented in 1.0.2004.2, and the petshop code has a webservice so I'll add that too :).

  • Can't wait ;-)



    John

  • yay! Petshop.LLGLGen Pro. :)

Comments have been disabled for this content.