A site devoted to discussing techniques that promote quality and ethical practices in software development.

Wednesday, April 8, 2009

A case of deja vu

An article I have just read from ACM Queue is almost like that movie by Denzel Washington except that this is about a failed software package:
the seeds of failure are all too obvious, at least with the benefit of hindsight. The two warning signs that really jump out are the absence of any coherent statement of requirements or goals (note, for example, that the notion of performance appears to have been an afterthought) and the fact that the team chose a technical approach they had few qualifications for—namely, writing PC software while avoiding any use of Microsoft technology.
This article also points to another reason why this failed product fails:
effort quickly turned into a matter of technology looking for a problem to solve (an all-too-common occurrence)
What had been identified by Peter are the cause of failure in my experience. It is not a RIA but a .Net application which ended up best summed up as a .Not application (Not a .Net application but a half-baked one). In this case it was faddish to be a .Net application so they need one! This failure contains many lessons that are worth exposing and will be covered in future blog posts.

In my situation, there required no hindsight to know the right atmosphere for failure; the foresight was arrogantly rejected prior project began; the management was too amateurish and haughty to ask for advice and to receive any. Their steadfast refusal to recognize their failure causing the company huge amount of ongoing waste and their customers excessive expensive run time resources as well as missed opportunities. The resultant is a big embarrassment of a comatose .Not product.

Tuesday, April 7, 2009

Allowing error message to corrupt download - www.ingdirect.com.au - Not Nice

For the last few months, whenever I downloaded banking data from ING Direct in Quicken format, the download data failed to be imported into my accounting package complaining about import data corruption.

Not easily deterred by this kind of things particularly the downloaded file was a text file and that I was very knowledgeable in QIF file format, I opened the file in a text edit and the reason was so obvious.

What happened was that at the end of the download of the correctly structured QIF data, their .Net web server application must have thrown an exception and their application then formatted the message into HTML format ramming it into the QIF file. Here is the error message:

Server Error in '/Client' Application.

Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customerrors> tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customerrors mode="Off">
</system.web>
</configuration>



Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customerrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customerrors mode="RemoteOnly" defaultredirect="mycustompage.htm">
</system.web>
</configuration>

Not very nice. I doubt the download feature was used much otherwise people would have complained or people just believing mistakenly that the Internet corrupted the download.

Once I deleted the error message from the QIF file, I could import it successfully. Have they actually tested their web application at all? I wonder!

Monday, April 6, 2009

A snapshot view of how Asia's best employers deal with economic down turns.

This is a snap shot analysis of how Asia's best employers deal with the economic down turns:
many of the best employers in Hewitt's survey see the global economic crisis as an opportunity to cement their relationship with their staff, train employees and woo key people from competitors.
According to the survey many are adopting the "Employee first, Customer Second" method:

Forward-looking companies across the region are adopting that business model. HCL Technologies, an IT outsourcing firm based in Noida, India, and a top 25 Hewitt winner, adopted a new vision statement called "Employee First, Customer Second" in 2006.

The idea: by empowering employees and giving them any tools they need to help customers, the business will thrive.
This is very same model used successfully by Southwest Airline, USA that came through 9/11 attacks financially intact with no layoff of any staff. This is how the former CEO James F. Parker explains it in his book, page 168:
At Southwest, we were sometimes asked who we sought to serve first - employees, customers or shareholders. We always said employees come first. We knew the way we treated our employees would determine their attitude towards our company. We knew that if we served our employees well, they would serve our customers well. And if our customers were happy, it was pretty likely the shareholders would be happy too.
That all pretty good sense to me sadly too many companies fail to see this simple rule.


[1] "Do The Right Thing - how dedicated employees create loyal customers and large profits" by James F. Parker, Wharton School Publishing, 2008.

Friday, March 20, 2009

Is there such a word as 'besting'?

I was reading an article on IE8 from InformationWeek and came across this usage that makes me feel uncomfortable:
NSS Labs released an independent study early Thursday showing IE8 significantly besting Mozilla Firefox, Apple Safari, Google Chrome, and Opera in catching and blocking malware. With its SmartScreen filtering, IE8 Release Candidate 1 caught 69% of malware, while Firefox 3.07 caught only 30%.
Emphasis is mine.

Is there such a word called 'besting'. I know Good, Better and Best but Besting? Come on! Surely geek writing does not mean bastardization of English.

First look at IE8

I have expressed my dissatisfaction with IE7 on this blogs for several occasions and offering my conclusion why IE7's uptake fails to materialize and yielding market shares to Firefox.

There are two issues I am really interested in IE8 and they are:
1) I failed to understand Microsoft's irrational pursue of demanding WGA validation during the installation of IE7. Even more distasteful was Microsoft allowed IE7, not an insignificant amount of bytes, to be downloaded without WGA validation then failing the installation on WGA validation failure. This was mean and wasting bandwidth. So I am interested to see if Microsoft wanting to continue this irrational pursue of WGA validation in IE8 that would only further erode its market shares.

2) I want to see if I can still use IE8 in an LUA arrangement as an Windows Explorer with Admin privilege. IE7 can't. This to me is probably less important than say the item 1). If IE8 can be installed without WGA bothering, I will overlook the short comings of this issue because I can almost invoke every control panel applets or MSC files from administrator's console.

It is delightful to see Microsoft has learned a lesson from the IE7 irrational pursue of WGA validation and there is no bothering of WGA validation in IE - downloads or installation. Well done Microsoft.

This is the right thing to do if Microsoft is genuinely keen on protecting users from the evils of the Internets. Besides you can't buy IE even if you want to pay. Let's hope that Microsoft will begin to push this down to Windows users via the Windows Updates.

Actually I tell a small lie. If you are running XP SP2 and that you have not installed the KB932823 update, the IE8 installation insists on you having this update installed. This update is only available to those meeting the WGA validation requirement. In short, IE8 is not fully so generous as Firefox. However, that requirement can easily by-passed. Once that update is installed, IE8 is happy to install it on XP-SP2.

Those with SP3 need not worry and IE8 is very generous in that regard.

It will remain to be seen whether this direction will arrest the erosion of IE market shares by other browsers such as Firefox, Opera and Safari. With the demand for KB932823 meeting WGA validation as mentioned above, I have doubt that IE8 can arrest the erosion.

However, IE8 behaves much like its older sibling and fails to work as a Windows Explorer with administrative privilege, a feature of IE6. As said, I can put up with this mild inconvenience as I can invoke all but a few control panel applets from administrator's console. What I will miss most is the UI to change the ACLs. Fortunately, complex operations requiring the UI support are rare and the use of CACLS command is adequate for most of the usage.

Hence the lack of WGA bothering is more than compensation for the failure to act as a Windows Explorer.

Will I jump back to IE8? Not too sure yet. This is not a matter of performance but more on my fondness for the vast collections of Add-in offered by Firefox. It is like a kid deserting a well-stocked lolly shop - not willingly and likely without dragging kicking and screaming.

I did venture into the IE8 Add-in gallery but it looks very poorly stocked. May be over time, this will change and let's hope so.

Tuesday, March 10, 2009

So beautifully put

I've come across a poem by Janet Minor that sums up so beautifully and entertaining the danger of trusting blindly your spell checker in your word processor and it is reproduced here:
I have a spelling checker
It came with my PC;
It plainly marks four my revue
Mistakes I cannot sea.
I've run this poem threw it,
I'm sure your pleased too no,
Its letter perfect in its weigh,
My checker tolled me sew.
I have seen this kind of malpractice in software development where developers cannot tell the difference between a piece of compiler-happy code and run time logically correct piece of code.

Monday, March 9, 2009

VB.Net can block pass by reference parameter - Is it real?

I was browsing around some MSDN materials in VB.Net and came across this puzzling claim "How to: Force an Argument to Be Passed by Value".

The obvious question that sprang to my mind was: Is this real? I know nothing in CLI that supports this kind of thing. There is also confusing statement in that reference
If a parameter is declared ByRef, Visual Basic expects to pass the corresponding argument by reference. This allows the procedure to change the value of the programming element underlying the argument in the calling code.
If the "value of the programming element" means the object reference or memory address, then that statement is true.

In .Net if the object being passed across is a reference object, no matter you pass use ByVal (in C# no qualifier needed) or ByRef (in C# with the ref qualifier), the called function can change the state of the object but only the reference or the memory address of the object can be modified if using ByRef.

So what has VB.Net invented that CLI does not support? Obviously this must be a source level construct and not IL construct. It turns out that there is really nothing new or to trumpet about.

According to the documentation, if you surround the argument, which is specified by the called function to have ByRef convention, with a bracket, you can prevent the called function from modifying the object address, like this:
 Dim a As DemoClass
Dim b As DemoClass
a = New DemoClass(10, "Jack")
b = a
Show(a, "Before")
SomeFunctions.DoSomethingA((a)) ' L1
Show(a, "After")
Debug.Print("Are the same ? " & (Object.ReferenceEquals(a, b).ToString()))

Line L1 shows the protection syntax. The Debug.Print shows object a and b are occupying the same memory location. So the (a) syntax defeats the function's parameter's convention which is specified as:
    public static class SomeFunctions {
public static void DoSomethingA( ref DemoClass a ) {
a = new DemoClass( a.Number + 100, "Bye " + a.Name );
}
}
So how can VB.Net defeat the convention specified by a C# function?

To answer this question you need to examine the IL code generated by VB to see if it is merely a trick. This is the IL code of the above VB.Net fragment:
  .locals init ([0] class [MySupport]MySupport.DemoClass a,
[1] class [MySupport]MySupport.DemoClass b,
// .....
[4] class [MySupport]MySupport.DemoClass VB$t_ref$S0,
[5] bool VB$t_bool$S0)
IL_0000: nop
IL_0001: ldc.i4.s 10
IL_0003: ldstr "Jack"
IL_0008: newobj instance void [MySupport]MySupport.DemoClass::.ctor(int32,
string)
IL_000d: stloc.0
IL_000e: ldloc.0
IL_000f: stloc.1
IL_0010: ldloc.0
IL_0011: ldstr "Before"
IL_0016: call void TestParameterPassing.Module1::Show(class [MySupport]MySupport.DemoClass,
string)
IL_001b: nop
IL_001c: ldloc.0
IL_001d: stloc.s VB$t_ref$S0
IL_001f: ldloca.s VB$t_ref$S0
IL_0021: call void [MySupport]MySupport.SomeFunctions::DoSomethingA(class [MySupport]MySupport.DemoClass&)
IL_0026: nop
IL_0027: ldloc.0
IL_0028: ldstr "After"
IL_002d: call void TestParameterPassing.Module1::Show(class [MySupport]MySupport.DemoClass,
string)
IL_0032: nop
IL_0033: ldstr "Are the same \? "
IL_0038: ldloc.0
IL_0039: ldloc.1
IL_003a: call bool [mscorlib]System.Object::ReferenceEquals(object,
object)
IL_003f: stloc.s VB$t_bool$S0
IL_0041: ldloca.s VB$t_bool$S0
IL_0043: call instance string [mscorlib]System.Boolean::ToString()
IL_0048: call string [mscorlib]System.String::Concat(string,
string)
IL_004d: call void [System]System.Diagnostics.Debug::Print(string)

Notice the local variable 4, VB$t_ref$S0, a compiler generated auto-variable of the same type as the function's parameter. From line IL_001c to IL_001f, the IL code is to stash the object in a to VB$t_ref$S0 and then pass this temporary variable by reference to the called function. The idea is to let that function modifies a sacrificial object without harming the protected one inside the bracket, that is a.

You can achieve the same result in C# as follows:
   DemoClass a = new DemoClass( 23, "Peter" );
DemoClass b = a;
DemoClass tmp = a;
SomeFunctions.DoSomethingA( ref tmp );
Debug.WriteLine( String.Format( "Are they the same? " + Object.ReferenceEquals( b, a ) ) );
The variable tmp is the throw away one. So there is nothing new. It is just a simple convenience trick - nothing more and nothing less.

Blog Archive