Posts

ASP.NET MVC – Do I Really Need It?

As a professional software developer, particularly of the Microsoft flavor, you get bombarded with “new stuff”. If you do not instill in yourself a certain discipline, you are sure to be brought down by the sheer complexity of tackling every “new thing” that is sent your way. I say this from personal experience; I do not mean to be negative in any way in saying this. It’s just a fact of life. There are so many “CTPs” and new technologies being thrown at you that it is easy to succumb to “Beta-itis” – the debilitating compulsion to download and play with every new thing, to the point where your productivity as a software developer begins to suffer. It’s even worse if you’re an MVP because when you go to the Summit each year, they throw a whole truckful of even more sexy new “Stuff” at you. Sometimes, its stuff that nobody else has seen before and you had to sign an NDA saying you wouldn’t talk or blog about it. Talk about getting excited! ASP.NET MVC is an example for me. About a ...

SQL Server 2008 Fix: SP1 Install Failure

  For quite a while I could not install SQL Server 2008 SP1, as it reported a failed shared component installation – in this case, Books Online. Problem is I could not find the source MSI to fix it. So here is how I solved the problem:  If any shared components installations result in a failed state, a Registry key is updated. SP1 reads these keys when it starts, and if the value is not “1” (in my case it was “3”) – it will stop. Seems ridiculous to me, but that’s how they do it. And doing a repair may not fix it either – because you may have installed Books Online from an interim standalone MSI installer. if you try to find the original MSI to handle the repair, it might not be the correct one. Edit this key (or the respective key for whatever your fail message says) and ensure that the value is 1: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\100\ConfigurationState\Sql_BooksOnline_Redist That took care of that problem! Now I have a different issue, b...

Why the Economic Stimulus Plan Doesn’t Work

When President Obama was elected, the economy was already sick and getting sicker. If nothing was done, his economic team said, the unemployment rate would keep rising, reaching 9 percent in early 2010. But if the nation embarked on a fiscal stimulus of $775 billion, mainly in the form of increased government spending, the unemployment rate was predicted to stay under 8 percent. Obama bought into a classic Keynesian solution – and so did Congress. Congress passed a huge fiscal stimulus that focused almost entirely on government spending. Yet things turned out worse than the White House expected. The unemployment rate is now in the 10 percent range — a full percentage point above what the administration economists said would occur without any stimulus ! So what should they  do now? The administration seems  determined to stay the course, although recently, the president showed interest in “increasing the dosage” – a bad prescription indeed. A better approach might be to r...

Don’t Break the Interface

Recently while contributing to a test suite that covers some 250 C# DAOs (Data Access Objects) I discovered a couple of issues: 1) There was an implementation of “PrimaryKey” which is defined as a nullable long (long? PrimaryKey) that returned a 0 (zero) if the nullable type had no value. Uh-Oh! 2) There was more than one implementation, e.g., this actually appeared in more than one base class, in different assemblies. Depending on which references you had set, you could get clobbered! Needless to say we’re going to fix that quickly; there are objects that are “older code” that need to be updated to reflect the change. Fortunately our test suite will show immediately which guys need to be updated,underscoring the importance of having robust unit tests. But the real question is, “How did this creep in”? The answer: Most probably, "Stinkin' Thinkin'" by developers. Nullable types are instances of the System.Nullable struct. A nullable type can represent the normal range...

The big Silverlight 4 Question

You get all this honking and hoopla and what not, but nobody seems to think about the big Silverlight 4 Question: Can I install Visual Studio 2010 Beta 2, Silverlight 4 Tools, WCF RIA Services, The November 2009 SIlverlight Toolkit, and Blend 4 Trial on the same machine that I have Visual Studio 2008, Siverlight 3, SIlverlight 3 Toolkit, Blend 3 and so on – and will they co-exist peacefully on the same machine? Answer: Yes! All you may need to do is uninstall your previous RIA Services Preview. Everything else will “just work”. I just did it and tested it all out. Bart Czernicki mentions an issue that you can review here . Disclaimer: No animals were harmed in the creation of the UnBlog post. Your mileage may vary. Oh, and one final note: If you are going to install WCF RIA Services with Visual Studio 2010, you will no longer be able to use RIA services with Visual Studio 2008. They don't install "side -by-side".

Another Set of Eyes

Insanity: doing the same thing over and over again and expecting different results. --Einstein How many times, as a developer, have you found yourself mindlessly and stubbornly trying to solve a problem (some thrown exception, for example) for an hour, two hours, or even longer, without a solution? This is like the Einstein quote above: madness! What you need to do is get Another Set of Eyes to sit by you while you work your way through the issue. It doesn't even have to be a developer who is very familiar with the codebase you're working on -- the mere act of "changing the paradigm" will enable you to look at the problem more objectively and find the answer quickly. In a team environment, we have a general rule that if you're stuck on a problem for more than 20 or 30 minutes, you put your ego in your back pocket and ask another developer to come sit by you while you demonstrate the issue. Recently another developer I work with asked me over. He admitted having so...

When Unit Tests aren’t Enough

Unit Testing of your work is generally accepted as the mark of a professional developer. However – have you thought about what happens when you make a boo-boo on the tests you create ? You guessed it – everything goes to hell in a handbasket. If the tests are flawed, they aren’t really telling you anything.  Sometimes it can be better (and faster)  to create an old-fashioned, Windows Forms test harness to exercise your “stuff”. Right now, I’m working on a complex project with many dozens of classes – more of them every single day. Often we are asked to make changes to many of these classes. When I do these, all I need to do is fire up my Winforms Test Harness and press one of the buttons. I can have breakpoints in the code at strategic places, and I can view the end result in a DataGridView that’s on the form. Sure, you can do that with a unit test, but then what you’re doing is “testing a test”. Unit Tests are definitely the way to go, but sometimes just being a Duct ...

Why the FED has turned the banking system into the Living Dead

Treasury Secretary Tim Geithner and Federal Reserve Chairman Ben Bernanke have denoted that the recession is over. Now that the DJIA has broken the 10,000 mark, we can expect to  have full confidence that economic growth is here to stay. But the credit markets are in a lot worse condition than some indexes  suggest. Buried within the October 3, 2008 bailout bill, which set up the Troubled Asset Relief Program (TARP), was a provision permitting the Fed to pay interest on bank reserves. Within a week, the Fed implemented this new power and  essentially converted bank reserves into more government debt. As the fed funds rate hovers around zero and existing loans in technical default continue to sit in bank portfolios, why should banks make new loans when they can make money for free with the government? They can now borrow from the Fed and  earn a huge spread by borrowing virtually unlimited amounts of money for nothing and simply lend that same money back ...

Doomed to Repeat History?

Image
William O’Neil, in his excellent book “How to Make Money in Stocks”, has a chapter on the media, news, and market psychology. In this section he has taken the charts of the Dow Industrials from 1921 through 1942, and overlayed on this a chart of the NASDAQ Composite from February 1992 through March 2009, and indexed the data so that the charts both start at 100: What is remarkable about this chart is that the two time periods are almost exact duplicates. O’Neil used the NASDAQ for comparison with the 1929 era as it trades more volume now than the NYSE and represents more entrepreneurial companies. The reason history repeats in this amazing manner is that the markets are made up of millions of people acting almost 100% on human emotions. You can see two important history lessons from just looking at the above chart: 1. This isn’t 1929 right now in October, 2009 – its  Oct 1939. 2. The market (according to history) is not going to be very exciting for a long time – denotin...

On Less is More

Thelonius Monk once said “Wrong is Right”. I say, “Less is More”. All too often we as software developers do data collection of one sort or another, often storing results in a database table or tables, and we suffer from self-induced overkill. We collect too much data, data that we probably will not need. Or, instead of storing the same data and simply updating it’s count on a unique column value via an Insert or Update SQL statement, we end up storing hundreds of unique rows that, because of the data collection overkill we’ve engineered, take up lots of space but don’t really contribute to the “cause”. In addition (and I have certainly been guilty of this) we store our data in database tables that are not normalized, thereby exacerbating the situation. We end up with wide tables with a lot of columns that are inefficient. It is often much easier (and simpler) to start out with a minimalist approach. Less is More. If we determine at a later point that we actually do need “More”, ...