Hoist on an idealogical petard?

September 30, 2007

I read this article in the Mercury about Farmers refusing Government aid. Either because they were too proud or didn’t want to be seen as welfare bludgers. Many’s the time on internet forums that I’ve seen people sneering at Welfare recipients and abusing them as “useless bludgers and a drain on our society”. Others have remonstrated with them, saying “I sincerely hope you’re treated better if you need a helping hand.”.

So what happens when the shoes on the other foot? You spend your entire life sneering at, and verbally bashing, welfare dependents, minority groups, unions and all the other lefty groups. What happens when you need help from welfare, but you’ve been bashing them your entire life? You can’t accept help - who wants to be branded a welfare cheat by your mates? Better for you and your family to starve to death than to be seen as a hypocrite. Right?

Hoist on your own idealogical petard.

Oh Dotnet, how I hate/love thee…

September 21, 2007

I ran into another ridiculously annoying but extremely minor feature of .NET. It isn’t a bug, rather an omission. Ever tried inserting dates into an SQL Server table? It won’t accept the format ‘dd/mm/yyyy’, but will accept the format ‘yyyy-mm-dd’. Except there’s no format for ‘yyyy-mm-dd’.

So if you want to insert a date in SQL from ASP.NET, you need to use either of two methods -

DateTime dt = new DateTime();
System.Globalization.CultureInfo culture = new CultureInfo("en-AU", true);
if (txtDOB.Text.ToString() != "")
{
dt = DateTime.Parse(txtDOB.Text.ToString(), culture, DateTimeStyles.NoCurrentDateDefault);
}
string txtDate = dt.ToString("yyyy-MM-dd");
return txtDate;

Fortunately a colleague who’d been looking at the problem longer than I had found a better solution -
DateTime dte = Convert.ToDateTime(dob);
string dateText = dte.ToString("yyyyMMdd");

BTW, you can’t convert a string directly into a date format (eg. Format(”yyyyMMdd”). You have to convert the string into a date and then into the format you want. Ridiculous. I wonder what other “odd features” I’ll find in DOTNET. This is the problem with programming languages from big corporations. When one Division doesn’t talk to another, this is the result.

Behold Dotnet

September 17, 2007

About 9 months ago our Department had a meeting to determine which technology platform we were going to use for future development projects. We’d been focusing on Java and JSP. Until one of our co-workers demonstrated Visual Studio 2003 and the new .NET components. Needless to say, after years of JSP and Classic ASP, everyone was pretty impressed. Instead of laboriously hand-coding a textbox for fifteen minutes, you can drag-and-drop a textbox control in a second. What’s not to like?

As a result, we’ve started quietly developing new projects in the .NET platform. After two months, I’ve got to admit I’m pretty impressed by what I’ve seen thus far. I would estimate that 75% of the activities you previously had to manually code in ASP Classic can be done using web controls. For instance, database-based transactions were a nightmare to code in ASP Classic. In ASP.NET 2.0 you only need the SQLDataSource control. Another pain was customising the appearance of multiple webpages, which is easily done using Master Pages.

The only disadvantage I can see thus far is the fact that it’s proprietary software, and therefore costly to implement. But it’s a necessary tradeoff when you consider the shortened development time. Unless you’ve got a bias against Microsoft, I’d definitely recommend .NET for web-based development. IMHO, it’s the only decent thing Microsoft have successfully produced over the past 5 years.

Darned newfangled technology

September 2, 2007

My parents recently installed an air-conditioner in their lounge room. I’d never realised how old they were until I saw them trying to cope with the new aircon. My father’s favourite heat source in winter is the heat-bank in our lounge room. He still insists on keeping the heatbank on, despite the fact that the aircon does a better job of keeping the room warm. Believe me, the irony isn’t lost on me.

I’d heard that as people get older, they have greater difficulty adapting to new things. I’d never really believed it until I’d seen it with my own eyes.