Use of flag: (was "Re: Bug tracking")

scottw at scottw at
Tue Aug 4 21:20:43 UTC 1998

At 8:20 AM -0700 8/4/98, Mark Wai wrote:
>Just curious, why you need to do 
>self flag: #knowBug
>instead of just put down the symbol (i.e. just have #knowBug in a line)?
>What is the use of >>flag: ?  


Using "flag:" is just a stylistic choice, which arguably has the following two benefits over just mentioning a naked symbol on a line:

(1)  When you get in the habit of using this kind mechanism seriously (such as to mark methods that you absolutely *must* return to before shipping some code. or to mark methods that you want to be certain are brought to the attention of a colleague, as in "self flag: #noteToFred"), you can end up with quite a few different kinds of flags, and can easily lose track of your own conventions as time goes on.  By looking at all senders of #flag: you can survey all methods flagged in any way.

Also, since there is no spell-check done on the declaration of a symbol constant, if you happen to type the naked line


when in fact you meant #knownBug but you misspelled it, you might never find this again except by serendipity.  If you occasionally survey senders of #flag:, you'll at least have a deterministic path to relocating such strays.

(2)  From the point of view of documentation, it may be more self-explanatory and less off-putting to a user coming upon some such code, if he sees that the mention of the symbol is for the purpose of "flagging".  The novice user who wonders what this is all about might then browse implementors of #flag:, where he would find a direct explanation of the convention.

  -- Scott

More information about the Squeak-dev mailing list