var RantLevel : integer;
begin
RantLevel := MaxInt;
end.
I again lost a few hours today, tracking the silliest problems of them all. A problem that is so easy to get rid of, once you stop listening to all the hype.
One of the forms (in Delphi 7) does not load. Cannot find the class implementing a component... Works on my development machine, breaks on the build server. Why? Oh why? ... Depending on the order in which your units are loaded in the EXE file, the class gets registered on time, ... or not.
Solutions to this? Soooo simple. In Java and (until recently) in C# / .Net you do not rely on dynamic retrieval of classes. Your forms are created by actual code that gets compiled when you build your application. Yes, you heard correctly: static checking by the compiler; does not find all bugs; just avoids losing hours on silly things. Now of course the hype is to remove this life saver, and replace that by XAML. Unfortunately one day or another I will no longer have the choice, and I will have to use it :-(
Don't you ever learn? As you may know, there are two main classes of bugs. The ones that are due to a bad algorithm, locally; an array index that is off by one. And there are those bugs that are due to a bad state left by some code that triggers problems in another part of the program; a variable does not get initialized, or contains a string when it should contain an integer.
The latter are an order of magnitude harder to track down. Statefulness considered harmful...
Adding statfulness adds comfortable nesting places for the nastiest bugs. Having types being dynamically changed (eg by having type definitions be executable statements like in Python) adds statefulness where there was none previously.
Wednesday, April 23, 2008
Yet another silly debugging session
Publié par Stephan Leclercq à l'adresse 3:01 PM
Libellés : Dynamic typing
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment