Skip to content

Coding Horror: Let’s Just Duplicate Our App?

August 17, 2010
tags:
by David McCarter

This post is starting a new series called “Coding Horror”. Just when I though I’ve seen it all, I still am continually blindsided with seeing or having to deal with the worst code ever, either due to poorly trained programmers (or just don’t care) or idiotic decisions by management!

This week I am working on a globalization project for a company here in San Diego. They have two projects (solutions) that need to be coded to allow to be converted into a different language (something I never see a company do when they first write applications). So I wrote all the code to convert all the message boxes in one application then moved over to convert the second application. It only took me a minute or two to discover that 99% of the message boxes were the same!

I contacted the other (lead) programmer working on this project with me (we have both been hired as outside contractors). He told me that they needed a new app that did the same thing but with just a few different screens. So they duplicated the ENTIRE CODE BASE and changed those few screens?!?!?!?!? I could not believe what I heard. I have heard of duplicate code before but a duplicate app?

The programmer that we work with internal to the company fought against this but was overruled by management. I immediately wanted to know “who” made that decision, who could possibly think this was a good idea? Any “good” programmer knows that this creates a maintenance nightmare. Also, the company is essentially paying us double for the work we are doing. Not wise by any stretch of the imagination.

So, I should not complain…. I’m making good money doing work for this company. I’m just wise to their management and if asked, would never accept a position there.

Do you have a coding horror story? If so, please use the About page and send it to me. I will publish it here on dotNetTips.com.

Sql Saturday – San Diego

August 17, 2010
tags:
by David McCarter

SQL Saturday San Diego will be held on September 18th, 2010. To learn more about the FREE event and to register please go to: http://www.sqlsaturday.com/55/eventhome.aspx

I will be speaking on the following topics, I hope you will join me.

Building nTier Applications with Entity Framework Services (Part 1)

Learn how to build real world nTier applications with the new Entity Framework and related services. With this new technology built into .NET, you can easily wrap an object model around your database and have all the data access automatically generated or use your own stored procedures and views. The session will demonstrate how to create and consume these new technologies from the ground up and focus on database modeling including views and stored procedures along with coding against the model via LINQ. Dynamic data website will also be demonstrated. Lots of code! Make sure to attend Part 2.

Building nTier Applications with Entity Framework Services (Part 2)

Learn how to build real world nTier applications with the new Entity Framework and related services. Make sure to attend Part 1.  This second part to the series will focus on using the Entity Framework in an nTier/ SOA world by separating out the different layers using T4 templates and using the new WCF Data Services to easily expose entity models via REST and to Silverlight clients. Lots of code!

All slides and videos can be found here: http://www.slideshare.net/dotNetDave

Please rate my talks by going to: http://speakerrate.com/dotnetdave

Why MEF?

July 16, 2010
tags: ,
by David McCarter

A fellow software engineer at work asked me this very question today and my unedited response is below (except I remove my company name):

Oh you bet I have an opinion! (not that anyone listens to me) But I will warn you before I write it that I just woke up and I’m still recovering from being in and out of the hospital that resulted in two emergency surgeries, so my attitude is going to come through so I apologize in advance.

So we have been able to do dependency injection in .NET for a while but it’s never been that easy so most people did not use it. Now with .NET 4, MEF makes it much easier and I highly recommend it for any program that could be extensible in the future (which I think would include most of the apps at our company). Most people are confused on where to apply MEF. It works great for UI and business logic and should be used for both. Did you know that is exactly how VS 2010 is designed? It’s just a bunch of MEF extensions.

Prism on the other hand if similar but is more of an entire application framework and is much more on the other end of complexity. It is very powerful but takes a long time to learn and to architect correctly. I believe it is the right choice for very large enterprise systems, but the correct time needs to be given to architect it correctly otherwise like most frameworks it’s just going to fall down and be counterproductive. As we all know at our company we are usually not given this time, but if we are this could be a viable option too and maybe better in the long run.

Also another consideration is that the concepts that both these frameworks are alien to most programmers at our company (heck many can’t even write LINQ or Lambda statements). So time will have to be added to the schedule for proper training. This is a requirement!!!!

One another note, I have had the experts on MEF and Prism speak at the group I run, the San Diego .NET Developers Group, which NO ONE at our company attends!!! (they both are my longtime friends and this is why I know so much about this because I have talked one on one with them about these frameworks) It saddens me that we have so many developers at our company and they can’t spare three hours a month to learn about these new technologies (my attitude showing).

I would value your feedback! Use the comment box below.

Boys (Executives) And Their Toys

July 4, 2010
tags:
by David McCarter

I’ve noticed a trend recently since the iPad has been released… before it’s release executives, VP’s and managers were running around with net books since they are lighter and have a battery life of up to 8 hours or more. These actually are a great deal with a price around $299 for the person on the go and stuck in meetings a lot. These net books come with Windows 7 installed so all you need is Office and your up and going in no time including doing presentations.

What I don’t understand is why these same people who as recently as less than a year ago were snatching up these net books like crazy are now doing the same with the new iPad? First off, their net books are not even that old (some of us are dealing with five-year old computers). Second off they are pretty much useless in the Microsoft Windows and Office dominated business world! All they can do is surf the web and read email for the whopping cost of $499 to $820 (without accessories and service plans).

If you tell them their iPad is a toy or a waste of money they say that they can “remote desktop” into their office computer to do work. That’s right folks, they can dial into their $1,000+ office computer with their $500+ iPad to get work done! Am I the only one that finds this a total waste of money during a recession?

Keep in mind that they are spending this money on iPad’s when budgets are tight and while the people that really need new computers or updated computer hardware are not getting it.

Boys and their toys.

San Diego Code Camp 2010

June 6, 2010
by David McCarter

Code camp 2010I hope everyone in southern California is planning to attend this years SoCal Code Camp in San Diego on 6/26 – 6/27. It’s always a great time and lots of free training!

I will be presenting the following sessions and I hope you will attend. Also, check out my new .NET discussion site called DotNet Army!

For those of you who can’t make it to the conference, I will be recording all of my sessions and posting them here.

Back-2-Basics: Exception & Event Instrumentation in .NET (Saturday June 27th @ 1:45 Room 126)

This session will instruct any level of programmer on how to easily use tracing that is built into .NET to log and analyze Exceptions and events that occur during application runtime. This is invaluable to fix bugs that only happen while the application is running. .NET TraceListeners will be discussed in detail along with how to write your own custom TraceListeners. I will also discuss and provide code for my centralized exception/ event logging system that allows applications at customer sites or on multiple servers to log to central database. Developers or technical support personal can then view these entries via an ASP.NET web site.. Note: You must be present to receive code for this presentation. Free USB thumb drive for everyone (while supply lasts)!

Back-2-Basics: .NET Coding Standards For The Real World  (Saturday June 27th @ 12:30 Room 126)

This session will guide any level of programmer to greater productivity by providing the information needed to write consistent, maintainable code. Learn about project setup, assembly layout, code style, defensive programming and much, much more. We will even go over some real in production code and see what the programmer did wrong in “What’s Wrong With this Code?”. Code tips are included to help you write better, error free applications. Lots of code examples in C# and VB.NET.

Building nTier Applications with Entity Framework Services (Part 1) (Saturday June 26th @ 12:15 Room 129)

Learn how to build real world nTier applications with the new Entity Framework and related services. With this new technology built into .NET, you can easily wrap an object model around your database and have all the data access automatically generated or use your own stored procedures and views. The session will demonstrate how to create and consume these new technologies from the ground up and focus on database modeling including views and stored procedures along with coding against the model via LINQ. Dynamic data website will also be demonstrated. Lots of code! Make sure to attend Part 2.

Building nTier Applications with Entity Framework Services (Part 2) (Saturday June 26th @ 1:30 Room 129)

Learn how to build real world nTier applications with the new Entity Framework and related services. Make sure to attend Part 1.  This second part to the series will focus on using the Entity Framework in an nTier/ SOA world by separating out the different layers using T4 templates and using the new WCF Data Services to easily expose entity models via REST and to Silverlight clients. Lots of code!

All slides and videos can be found here: http://www.slideshare.net/dotNetDave

Please rate my talks by going to: http://speakerrate.com/dotnetdave

Pictures and Video

SoCal CodeCamp Fullerton - 2009

Layout Techniques for Windows Forms Developers

June 3, 2010
by David McCarter

Here is a great post by Karl Shifflett  from the Microsoft Expression Team to guide Windows Forms developers in the proper way of window layout in Silverlight:

http://blogs.msdn.com/b/wpfsldesigner/archive/2010/06/03/layout-techniques-for-windows-forms-developers.aspx

Resources for Developing on Windows 7

May 12, 2010
by David McCarter

Back-2-Basics: Exception & Event Instrumentation in .NET

May 11, 2010
tags:
by David McCarter

Here is a video from a session I did at the San Diego .NET Developers Group Feburary of this year on TraceListeners in .NET and much more.

Back-2-Basics: Exception & Event Instrumentation in .NET from David McCarter on Vimeo.

Why I Love Being a Microsoft MVP: Reason 1

May 7, 2010
by David McCarter

There are many reasons why I love being in the Microsoft MVP program and today I’d like to share what I think is actually my second favorite one. I have been trying to track down, for most of the week, a major issue we have been having with a Windows service we wrote here at work with .NET 3.5. The symptom is that the private memory set would keep going up and the service would eventually crash. Using the DebugDiag tool from Microsoft (I now love this tool!) I found out it was coming from the unmanaged part of the mscorlib and the XmlSerilizer. The issue came into the forefront when logging code was being called from multiple threads.

After days of trying different things to overcome this issue, I finally turned to my MVP list (list server) and posted the problem along with the error and stack trace. In less than 1 1/2 hours I received an email from someone within Microsoft providing feedback. That feedback along with other emails from my fellow MVP’s lead me to find the solution and we are currently moving it to our development servers for testing!

To me, it’s awesome to have Microsoft’s ear when help is needed in a hurry or I just have a question. I often receive input from Microsoft people actually on the different product teams like Entity Framework and WCF Data Services.

For more on the MVP program go to: http://mvp.support.microsoft.com/

Why Rest?

April 29, 2010
by David McCarter

I just found a really great video on why REST is gaining so much popularity. This is how we plan to build a API where I work to deliver data to 3rd party vendors.

 http://channel9.msdn.com/posts/matthijs/Why-REST-by-Aaron-Skonnard/

 The session is great from beginning to end, but be sure to watch the demos and questions asked at the end.