Thursday, October 14, 2010

Half a Days labour

Hello Source fans!

I just realized a nice anecdotal metric due to some CodeAssitor work I did today.

I noticed when I sat down to work on some regular expression stuff for CA that it was ~1:30 in the afternoon, for some flakey reason, my brain made a mental timestamp. When I finished the feature I was working on I noticed that the time wasy ~5:30.

What's interesting is I completed one whole feature (or at least got the feature from 0 to code complete... which means there hasn't been extensive testing), and quite literally nothing else (no washing breaks, no coffee reheats, no email checking, nothing but code.

The day previous I worked on adding the 0-1 quantifier (?) to Scintilla's basic Regular expression code (RESearch.cxx), and got that feature code complete... unfortunately I didn't notice the time and I was very distracted watching the Chilean miners get free (CHI-CHI-CH LEI-LEI-LEI!), and was doing numerous other things.

Anyway... So I sit down in front of my computer to work on some CodeAssistor stuff and notice the time is 1:34. I check the Scintilla Mailing list to see someone had posted a reply to my ? quantifier work, and someone had. Here is Philippe's email:

On 13/10/2010 20:36, Michael Mullin wrote:
> I've added a small patch to add the ? operator to the built in regular
> expressions in the scintilla version used in CodeAssistor. I haven't
> done any extensive testing, so I guess this is a bit of a 'code
> review.'
> Anyone see bugs? Do you think this patch is useful for the main
> scintilla branch?


Yes, if it works... For this, you should:
- Fix indentation...
- Add documentation of the new operator in the documentation at the start of the file.
The semantic of the operator isn't clear. From a quick glance at the code, it looks like
it is used in place of * with the meaning of 0 or 1 occurrence of the previous token, not
as a modifier to make an operator non-greedy, right?
The latter would be more useful, but it much harder (if possible) to inject in the current
engine. The former can still be useful, though...
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
So for the next 4 hours I
1) added the lazy operator functionality
2) did up the spacing how he wanted + documentation

Anyways, it was 5:27 when I finished.

The most interesting part of this endeavor is that you can see just exactly what I accomplished during those 4 hours.

Anyways, I thought this was an interesting piece of data. Especially because I wasn't planning on timing myself, so I didn't change my work effort at all.

Note: its 5:44 as I finish this blog.

No comments: