12 messages in com.perforce.p4ruby[p4ruby] Canvassing opinions...| From | Sent On | Attachments |
|---|---|---|
| Tony Smith | 07 Dec 2004 09:12 | |
| Bennett, Patrick | 07 Dec 2004 09:42 | |
| Tony Smith | 07 Dec 2004 10:08 | |
| Bennett, Patrick | 07 Dec 2004 10:24 | |
| Shackelford, John-Mason | 07 Dec 2004 11:08 | |
| Johan Nilsson | 08 Dec 2004 00:11 | |
| Tony Smith | 08 Dec 2004 06:25 | |
| Bennett, Patrick | 08 Dec 2004 06:42 | |
| Shackelford, John-Mason | 08 Dec 2004 08:18 | |
| Tony Smith | 08 Dec 2004 08:20 | |
| Tony Smith | 08 Dec 2004 08:24 | |
| Tony Smith | 09 Dec 2004 05:47 |
| Subject: | [p4ruby] Canvassing opinions...![]() |
|---|---|
| From: | Bennett, Patrick (Patr...@inin.com) |
| Date: | 12/08/2004 06:42:10 AM |
| List: | com.perforce.p4ruby |
-----Original Message----- From: p4ru...@perforce.com [mailto:p4ru...@perforce.com] On Behalf Of Johan Nilsson Sent: Wednesday, December 08, 2004 3:12 AM To: p4r...@perforce.com Subject: RE: [p4ruby] Canvassing opinions...
What about appending _field instead? Prepending underscores certainly means less typing, but it's a bit too cute (i.e. ugly) for me. Some alternatives:
client.root_field = "/tmp" client["root"] = "/tmp" # redefine to validate client.fields["root"] = "/tmp" # same
[Bennett, Patrick] I didn't discuss the actual naming issues since it's not something I particularly care much about. I agree with Johan though. If I had my choice though I wouldn't go with the _ prefix. It looks too much like a reserved 'system' name to me (coming from a C++ world).
Anyway, what's the problem with name collisions - you mean that the existing users expect an 'update' method (doing Hash#update) available on the 'spec' object?
[Bennett, Patrick] Woa, wait a second... It currently returns a Hash. Users should fully expect to actually *use* that Hash as a Hash!!!! A complete new dup'd copy shouldn't be necessary to rely on its Hash'ness. ;)
With the risk of breaking compability, why not use delegation/aggregation instead and provide e.g. to_h/from_h methods in the Spec class?
[Bennett, Patrick] Absolutely not. Breaking compatibility for, well, a rather 'simple' feature is unacceptable IMO. I make extensive use of the P4Ruby API. Any change in behavior for me is a big deal.




