|
|
Copyright 2005 Randy Charles Morin
Part of the KBCafe Blog Network.
|
This might be Web 3.0. You have to view the samples in Firefox. This could contribute to the death of Flash. It's basically a graphics library written for Javascript.
More and more, I'm coming to the conclusion that who managers think is their best programmer, is often their worse. So, managers could fire their best programmers and improve their organizations. Here's why. If you ask a junior programmer to develop a component to retrieve NS records, then he'll like write a class called DNS.NameServers and implement a public method like Get(domain) return IP[]. Ask a senior programmer and he'll write a DNS library with classes like Request, Response, Resolver, etc. They likely will take approximately the same time, the junior writting 200 lines of code and the senior writing 20,000 very well documented lines. Which do you think is easier to maintain? Which do you think is easier to use?
Quite often, when we talk about server up-time, we talk about how many nines. The nines indicate uptime. One nine uptime means 90% up-time. Two nines means 99%. Three nines 99.9%. And so one.
The truth is that almost every application is exactly 1 nine. In order to be less than 1 nine, you have to be down for 72 hours in one month. I suspect that happens to many applications, but not month-after-month. In order to be 2 nines, you have to be down for less than 7 hours per month (3 nines is less than 1). If I look at websites I use, almost all of them are down for at least 7 hours per month, but rarely 72. I don't have any stats, but I suspect that 80% of the websites have 1 nine up-time.
Conclusion: We need a new scale. 98% up-time is very good for a website. 91% is very bad. Yet, both are the same nines.
The last couple websites that I worked on where we hired a graphic designer, we ended up blowing our deadlines because the graphic designers couldn't do their jobs. I have three problems in particular with their performance on these projects.
Software development really isn't as hard as it seems. There's some basic things that can make it really easy. When you don't do these things, then softtware development can get very complex, very quickly.
This is four basic tools for removing the complex in software development. How many are you using?
I ported some code to an environment that required an HTTP proxy to get outside the firewall. The code is very simple and worked immediately.
System.Uri proxyURI = new System.Uri("http://64.202.165.130:3128");
System.Net.GlobalProxySelection.Select = new System.Net.WebProxy(proxyURI);
The faster Intel makes the computers, the slower Microsoft makes them. I remember years ago unzipping 1000 small files in less than one minute. Now, unzipping those same files on a faster computer takes several minutes. Why? Simple. As Intel makes the computer faster, Microsoft writes more robust code to make it look cool, but perform ever more slowly. The graphics in Vista are grinding my computer to a halt.
I just finished applying the Facebook API to import a resume into ResumeBay. I have to say that Facebook has the most complex API that I've even developed against. It's so complex, that it clearly out of the capability of the average developer. To start, you have to redirect the user to the Facebook website in order to login. Once the user returns to your site, the real complexity begins. Even after the user has logged-in and you receive an authtoken, you still have to get a session id. Stop. getSession is a REST call and all the REST calls require a signature parameter. The signature parameter is an MD5 of a string. The string is the catenation of all parameters in name=value format with a secret string appended. Each API also has a call counter that must increase with each new method call. Now I have the session id. Call another API to get the user id and finally a last API call to get the user profile. Don't forget that you have to enumerate every field you want in the profile in another comma delimited parameter. A total of 100+ lines of code just to get the user's profiles. Imagine if I wanted to do something complicated.
Of late, I've started expanding the amount of websites that I'm starting. As such, I've realized that their is tremendous value in a default set of code where I can start programming. For instance, today I decided to add to that, the ability to email the webmaster all unhandled exceptions. Anyhow, here's the best solution I found.
TextSnippets has a great collection of useful code.
At least once a month, someone sends me a link to their new consumer Web 2.0 compliant website. I click the link to their website and it launches IE 7.0 and the site looks like someone threw-up on my browser window. I then load the same webpage in Firefox and it's beautiful.
I have access to stats from various websites and the percentage of users that use Firefox is usually between 20 and 30%. The percentage using IE 7.0 is between 15 and 20%. The percentage using IE 6.0 is between 40 and 50%. All other Web browsers are below 4% with IE 5.0 and Safari having as much as 3.x% share at best.
I assume that 55 to 70% of this Web 2.0 company's visitors are lost. Now, I'm not saying that every single webpage needs to work on every browser and I'm certain some of my webpages don't work in some browsers, but when your homepage doesn't work for the majority of your visitors, then you really have major problems. I know most developers use Firefox exclusively, but you really have to test your stuff in IE7 or failure is inevitable.
One of the biggest problem in software development is over-design. Most programmers will often over-design their software and cause bugs in the process. The best example of this is the phone number control. Ask a programmer to develop a control that accepts phone numbers and you'll often get a control that has keystroke validation that forces the phone number to the standard (xxx)-xxx-xxxx format. This is what my cellphone expects. Why is this incorrect? I can't enter extensions. I can't enter overseas phone numbers. I can't enter alpha equivalents. A simple input box that limits the length of the string to 64 characters is clearly a better solution, but most programmers will over-design on this simple task. In fact, it's a given that somebody will suggest that I'm wrong in the comments.
I use NUnit a lot. In fact, I doubt many have written more NUnit tests than I. I think I've written about ten thousand tests. I love the entire idea of regressive unit testing. That's one reason I believe my software is less buggy than most. Unfortunately, NUnit is extremely buggy. Fortunate that it is used by very technical people, because if you wrote software this buggy for mundane users, then you'd likely have no users at all. With each version of NUnit, thousands of bugs are fixed and thousands more are introduced. I just upgraded my NUnit to the latest 2.2.9 and of course, hundreds of tests are broken. Here's a simple code fragment they broke.
using System;
namespace TestHarness
{
[NUnit.Framework.TestFixture()]
public class UITests
{
[NUnit.Framework.Test]
public void SurfHomepage()
{
System.Windows.Forms.WebBrowser browser
= new System.Windows.Forms.WebBrowser();
browser.Navigate("http://www.r-mail.org");
while (browser.ReadyState !=
System.Windows.Forms.WebBrowserReadyState.Complete)
{
System.Windows.Forms.Application.DoEvents();
}
}
}
}
What the NUnit team did was hardcode NUnit to use the MTA apartment thread, which no longer works with the .NET 2.0 WebBrowser object that requires STA. If you run this test, then you get the following error.
TestHarness.UITests.SurfHomepage : System.Threading.ThreadStateException : ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment.
Another problem with NUnit is that its horribly documenting. Searching for a solution to this problem was extremely difficult. A dozen of red herrings before I found two threads that vaguely identified the solution. Which I'll document better here.
The solution is to create a .config file for your tests. Follow these steps.
If you are using the NUnit console instead of the NUnit GUI, then local the .config file in the same folder as your test DLL and rename it accordingly.
Geocode.ca is an awesome web service. Given various criteria, it'll return longitudes and latitudes in XML. Here's a C# programming sample.
The most frustrating error in ASP.NET is when you locate your Web folder outside of the wwwroot folder. If you copy file to that location, then giving the ASPNET or IUSR_XXX user access doesn't always help. You also have to give permission to IIS_WPG. I pier developer had this problem 3 years ago and simply couldn't find this solution even after days of research. Hopefully, this will save someone somewhere some time.