Wednesday 1 May 2019

Case sensitivity

Found this piece of code in a message (now deleted) on Stack Overflow, for the language Go:

func addGmp(a, b, c, d, e, f, x, y, X, Y, P *big.Int) (*big.Int, *big.Int) {
    // a,b,c,d,e,f this var (fast in func)
    a.Sub(Y, y)
    b.Sub(X, x)
    ...

The problem is not only that all the parameters have single-letter names that don't say anything about them, the much bigger problem is that there are parameters named x and y as well as X and Y. This is, IMO even worse than something like (in C):

int SomeApi(HWND hwnd, HDC hdc);

Let me reiterate that I am so happy that Delphi (and Pascal) are case-insensitive, and that such abominable parameter names are not possible.