johan...@sun.com wrote:
[snip]

The search() method in client.py is getting large and heavily indented.
If possible, please extract some of that code into other methods.
The short version is that while it's possible, I don't think it's sensible at this time. In order to get any significant left shift of the code, the extraction needs to start from inside the while page_again loop. justs, st, widths, ssu, and header_attrs are all variables that need to retain their state over the entire time the while loop is occurring, and can be changed while inside the while loop. Essentially, this means that the an extraction would look like (just eye balling it): justs, st, widths, ssu, header_attrs = foo(searches, justs, st, widths, ssu, header_attrs, attrs)

The other approach would be to just take each section of indented code inside the loop of the results, and turn that into a separate function.

Sure, I can do either of those, but it suggests to me that the extraction is being done only for indentation purposes, which makes me think that our indentation scheme is problematic (since this is hardly the first time we've encountered this issue) and makes me less inclined to extract the code than if it actually represented a coherent chunk of functionality.

Of course, I could just be missing an obvious grouping, so if you have a suggestion for how to better slice and dice things, please let me know.

That said, I'm still looking for at least one non-meta-comment review on this webrev:

http://cr.opensolaris.org/~bpytlik/ips-10515-v1/

Thanks,
Brock


Thanks,

-j

_______________________________________________
pkg-discuss mailing list
pkg-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to