Posts

Showing posts with the label BEST PRACTICES

Less is More Redux

In my short happy life as a developer, I’ve run into all kinds of development efforts that include frameworks, libraries, web sites, and much more. The one thing that stands out as an irritant to me is complexity. Specifically, unnecessary complexity. I’ve seen developers author entire library assemblies that provide wrapper utility methods consisting of calls to .NET BCL methods that take one line of code – methods that could have been called inline without even the need for the “helper” classes. I’ve seen frameworks that duplicate code that is already present in the .NET Framework, usually because the developer didn’t know they already existed (e.g., writing your own “connection pool” when the providers already expose a perfectly fine one). I’ve seen frameworks with layer upon layer of interfaces, base classes, derived classes and convoluted, multiple code paths that are inefficient and slow down execution because the developers kept building and building on top of something t...

MSDN Code Gallery Goes Live

“Don't piss on my leg and tell me it's raining.” -- Judge Judy The new MSDN Code Gallery has gone live (although at the time of this original post it wasn't fully functional, e.g. I could not sign in or create a new resource, but as of now it seems to be OK). My take on this is that this is Microsoft's replacement for the User Samples section on the old Gotdotnet.com site. I hope it gears up, there are already some very nice code samples there. We will see what happens. You can download official Microsoft code samples, download user-submitted code, access tutorials and create your own "resource" page to upload your code samples or other offerings. I guess I'll have to read through the Terms of Service once this thing "really" goes live and all of it is working. Whereas Codeplex.com offers source control for real "projects" with multideveloper support, the idea of Code Gallery is to provide a simpler interface for the average develop...

SQL Server: "Don't Reinvent the Wheel" Department

In your travels as a professional software developer, especially when you come into a new position and need to get used to a new enterprise and its programming - related environment - the tools, the programming style, the existing codebase, etc. you get to observe some of the repetitive coding patterns that people resort to in order to solve their problems. One of the most common ones I've observed is where developers do not have a full understanding of how ADO.NET and connection pooling work. It seems almost like instead of seeking out and using best-practices code and techniques, that some people, either through lack of knowledge or just plain being stubborn, feel compelled to "roll their own" DAL and Database layers. Mistakes and poor design often result. Back around 2001, I found the Microsoft Data Access Application Block ("SqlHelper") class, which quickly solved a whole bunch of data access problems for me, and in fact I still use it today - 5 years later ...