Re: One True Braces for Refactoring?
<yahoogroups <at> jhrothjr.com>
2003-08-04 18:04:09 GMT
----- Original Message -----
From: "manaster <at> pobox.com"
<manaster.at.pobox.com <at> yahoogroups.at.jhrothjr.com>
To: "refactoring <at> yahoogroups.com"
<refactoring.at.yahoogroups.com <at> yahoogroups.at.jhrothjr.com>
Sent: Monday, August 04, 2003 1:39 PM
Subject: [refactoring] One True Braces for Refactoring?
> Hi, all,
>
> I know it's beating a dead horse, starting religious wars, and all
> that, but the group's been pretty quiet lately...
>
> I'm doing a fair amount of refactoring lately, trying to better
> understand the Perl language and how it's used.
>
> The first thing I find myself doing is imposing the "Whitesmiths"
> style of indentation - braces indented with the block they enclose,
> each brace on its own line.
>
> [Disclaimer: I've always preferred this style, so feel free to call
> my objectivity into question.]
>
> Having the code organized this way seems to me to make it much easier
> to extract methods, also to _see_ where opportunities for extraction
> exist. With wonderful code editors, it shouldn't matter how the code
> is indented for actually performing the refactoring, but even under
> such circumstances I think brace placement ("bracement"?) affects our
> ability to spot refactorings. Well, mine, anyway.
>
> And wonderful code editors are far from ubiquitous. Even in the
> crappy ones it's pretty easy to grab entire lines, outdent them, and
> plop them somewhere else.
>
> So... Any thoughts? Any defenders of K&R out there, who prefer it
> specifically with respect to refactoring?
I find most languages I know have two or three "styles" that work,
with a couple of variations each. I suspect that whichever one you
prefer has more to do with famialiarity and comfort level than any
objective measure.
Since I program mostly in Python (no braces at all) I find the
discussions kind of amusing.
John Roth
The One True Way leads to the One True Dead End.
>
> Peace,
> --Carl
>
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/sO0ANB/LIdGAA/ySSFAA/umvwlB/TM
---------------------------------------------------------------------~->
To unsubscribe from this group, send an email to:
refactoring-unsubscribe <at> yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/