quinta-feira, 26 de julho de 2007

The forgotten parameter

While searching the source code of %IO.ServerSocket to write the previous posts (about sockets and ServerSockets and jobs), I just found out something at least, curious.

The method ListenJob from %IO.ServerSocket has as 6th parameter, pForeground, a boolean value which default is zero (means false in Caché). The (poor and little) documentation of this method even cites this parameter. The name of the parameter might indicate us the idea of controlling if spawned jobs would run in background or not, or even if the own method would run in background or not.

After some tests, I realized that the behaviour of ListenJob method didn´t change, even if I changed this parameter. So I went to see and analyse the source code, and surprise: this parameter IS USED NOWHERE. Oh yes, it´s declared in method's formal description, and nowhere else.

Dumb, very dumb, I thought. But, I decided to give it a chance, and check some possibilities that might have led to this situation.

First theory: this class might be used in older versions of Caché, and to keep compatibility, they just left the method as it was. Theory status: not valid. In this docs of version 5.0, this class EVEN EXISTS.

Second theory: in some newer version, it might be used for something. Theory status: highly not probable. I don't have version 2007.1 here, so I can't see the sources, but as shown on this version's doc, I don't see any diferences at this class.

Last theory: someone just forgot the parameter there, left it alone and useless. Theory status: it's the theory I accept as true, for now.

Just to mention, I use Caché's version 5.2, therefore all links I post to documentation is for this version. So, in previous posts, all links go to 5.2, although in this case, all classes seemed the same, as I looked at 2007.1 docs.

There are things in this world... ¬¬

0 comentários: