[Newbies] TODO comments and searching

Norbert Hartl norbert at hartl.name
Tue Sep 30 23:09:44 UTC 2008


On Tue, 2008-09-30 at 17:52 -0300, Mariano Abel Coca wrote:
> Actually, I use:
> 
> self toDo: 'Not forget to refactor this!!! It's ugly!!! bla bla
> bla...'.
> 
> And then I look up for senders of toDo: with alt+n
> 
> The implementation is:
> 
> Object>>toDo: aString 
>     "Do nothing, just annotation"
>     ^self
> 
> I think it's more descriptive than just a Symbol flag. But, it all
> depends of what you are used to.

You don't need to pass the string to the method. The string is obviously
a comment. So

"Not forget to refactor this!!! It's ugly!!! bla bla bla..."
self flag: #todo

serves the same purpose. The difference is that flag: is already defined
in the image. Have a look at ProtoObject>>flag:
And you can easily separate your issues by severities than just having
todo.

Norbert

> Cheers,
> 
> -- 
> Mariano.
> 
> On Tue, Sep 30, 2008 at 7:36 AM, Norbert Hartl <norbert at hartl.name>
> wrote:
>         On Tue, 2008-09-30 at 05:31 -0500, Mark Volkmann wrote:
>         > If I put TODO comments in my code to mark things I still
>         need to
>         > finish, is there an easy way to get a list of all of those?
>         For that
>         > matter, how do you search all the code in a given category
>         for a given
>         > string?
>         >
>         
>         Searching for strings inside the code you can do by selecting
>         a string and press ALT-Shitf-e. For your purpose you might
>         have
>         a look at Object>>flag: This way you mark your code this way
>         
>         self flag: #todo
>         
>         Then you can select todo and press Alt-n to get all senders
>         of this symbol.
>         
>         Norbert
>         
>         
>         _______________________________________________
>         Beginners mailing list
>         Beginners at lists.squeakfoundation.org
>         http://lists.squeakfoundation.org/mailman/listinfo/beginners
>         
> 
> 
> 
> 
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners



More information about the Beginners mailing list