Miscellaneous software-related stuff

These have been stewing for a while, and I need to share (and in some cases, vent).

TortoiseCVS

First off: TortoiseCVS. Leaving aside the WTF of still using CVS, let's take a look at what I am presented with when I go to resolve a merge conflict:

TortoiseCVS TWF

Mine? Yours? WTF do those mean? This can be really confusing at times.

The .NET Framework

Apparently .NET treats any two methods with the same name and number of non-primitive arguments as identical. That means that the following two methods are indistinguishable:

public void Frobnicate(FrobnicationDelegate frobDel, string targetName)
public void Frobnicate(string targetName, Gizmo frobHelper)

Two problems arise from this. First, Visual Studio (at least VS 2005; that's all I have) uses the same mechanism to track method usage, so right-clicking on a call to Frobnicate("somestring", new Gizmo()) and selecting "Go to Definition" causes Visual Studio to ask which one I meant, even though it's obvious which one I meant if you pay attention to the argument types. Furthermore, if the Gizmo class is defined in the NiftyGizmos assembly, the assembly I am working on doesn't have a reference to NiftyGizmos, and I call Frobnicate(someFrobnicationDelegate, "omgwtf"), the compiler will complain that it doesn't know what a Gizmo is! YOU DON'T NEED TO KNOW WHAT A Gizmo IS!!! I'M NOT CALLING THAT METHOD! ARGH!

I think this sort of distinction works out fine if at least one set of arguments at some common position in the argument list of both methods have different primitive types. Note that string is NOT a primitive type; it's a class in disguise.

The Fruits of JavaSchools

There's also this. I can't help but wonder if that recommendation is the result of the focus on Java that is so common in colleges and universities today. You just can't teach pointers in Java; the syntax doesn't make the difference between references and actual values clear. I've seen people get confused by this. Honestly, if you can't understand the difference between C#'s out and ref parameter types, you are a code monkey, not a programmer.

Needless Complexity

Designing a needlessly complex system will not make your penis bigger. Needless complexity just makes anybody who has to maintain your code fantasize about printing your nightmarishly huge abomination, getting it bound in hardcover, and beating you to death with it.

The Zen of Visual Basic

(based on code provided by PSWorx on The Daily WTF)

Public Function TreeToString(Root as Node) as String
 Dim i as Node
 TreeToString = Root.Name & "("
 For Each i in Root.Children
  TreeToString = TreeToString & TreeToString(i) & " "
 Next i
 TreeToString = TreeToString & ")"
End Function

If you find yourself confused by this, note that in Visual Basic (and all other BASIC dialects I am familiar with), the return value is set by assigning a value to the name of the function. The name of the function can also be used for recursive calls. For reference, the same code in C# would be

public string TreeToString(Node Root)
{
  string returnValue = Root.Name + "(";
  foreach(Node i in Root.Children)
  {
    returnValue = returnValue + TreeToString(i) + " ";
  }
  returnValue = returnValue + ")";
  return returnValue;
}

Essentially, all this does is convert a tree structure to a S-expression. The VB version, while somewhat odd-looking to those not familiar with VB (and probably many who are), has a certain Zen quality to it.

Comcast

This isn't really software-related, but it's related to a network, so close enough. Stories like this are what keep me away from Comcast.

Lest We Forget

This post about the Debian/Ubuntu OpenSSL debacle is old news, but it's news that needs to be remembered. I think that blog post does a pretty good job of explaining what happened

Serialization of output? What's that?

From the output of nmake (under somewhat adverse circumstances):

NMAKE : NMAKE : ffataal etrarlo re rUr1o0r7 7U:1 0'5"8C::\P rtoegrrmaimn aFtielde s (bx86y)\ MuiscerrosSotopf.t

Compiler on Crack?

Unhelpful error message

How's this for an unhelpful error message? In fact, it seems that the compiler has gone completely insane, until you realise that SID is part of the base class, not the Image class.

VIPRE

VIPRE fail

Sunbelt VIPRE. Everyone where I work knows it and hates it. Usually, a scan takes about 20 minutes. Occasionally, though, it will get hung up on something, like the Qt SDK. Why? Hell if I know. It can also get hung up on the GStreamer DLLs if the Clementine music player is open and playing music (or paused). It will just loop forever on a few GStreamer DLLs, and the file name it displays will have a bunch of random junk after it, suggesting a buffer overrun or omitted NUL terminator. Oh, and I'm not the only one who doesn't like VIPRE.

MSDN Fail?

Regarding this: in my experience the part about needing a second call to ReleaseWriterLock if attempting to acquire a reader lock while already holding a writer lock is completely false. I'd love to hear if it is still false in the context of Mono (2.0 or 4.0 profile) or .NET 4.0.

Microsoft Video 1 (aka MS-CRAM)

Here is a real failure of a video codec. I recently received a video encoded with this codec. Compressing it with DEFLATE (the algorithm used by ZIP files) reduced it to about 20% of its original size. Using a non-shit codec like H.264 got it down to about 0.1% of its original size. The sad thing is that I think the file was produced by FRAPS. I thought FRAPS was better than that.

And now I no longer have any unread messages in my mailbox (most of the above came from stuff I sent to myself from work). That sure feels good.