Jon Skeet has a nice (and long) response to Eric Gunnerson’s call for programmers to write their own “7 Deadly Sins of Programming”. Really my post here is just an extended “oh, certainly, yes” nod to Jon’s #7 Deadly Sin:

Some of the worst Java code I’ve seen has come from C++ developers who then learned Java. This code typically brings idioms of C/C++ such as tests like if (0==x) (which is safer than if (x==0) in C as missing out an equals sign would just cause an accidental assignement rather than a compiler error. Similarly, Java code which assumes that double and Double mean the same thing (as they do in C#) can end up behaving contrary to expectations.

I know I’ve picked up habits from ten years of Delphi. The one that took longest to go away (and I still do it if I’m not mindful – even after four years) is my (ex-!) habit of prefixing argument names that collide with a class property name with an A, for example void Foo(string aMyProperty) { MyProperty = aMyProperty; } instead of
void Foo(string MyProperty) { this.MyProperty = MyProperty; }. Even though Delphi could disambiguate by using ‘Self’ where I used ‘this’, the VCL used the ‘A’ convention, so I did too.

I still speak with an accent whenever I’m evaluating a new language. However, if I know I’ll be sticking with a particular language I’ll seek out the way of doing things that doesn’t make me look like a badly dressed tourist with a tatty phrasebook.

Farewell, Delphi, you served me well.

(Salute)

Ok, this is old. However, Delphi actions (available from Delphi 4 on circa 1998) were so unbelievably useful that I still can’t believe they haven’t made it into a .NET framework near you. Evidently I’m not the only one – even if I’m up to four years behind in actually sourcing one of several C# implementations ;)

Continue reading »

© 2014 ZephyrBlog Suffusion theme by Sayontan Sinha