|
Re: ambiguity backtrack - accessors and persistent locals: msg#01222lang.ruby.general
Hi -- On Tue, 13 Aug 2002, Gavin Sinclair wrote: > The syntax (for "setter methods") "object.field = value" implies > simplicity. If you need to jump through various hoops every time a > field is written, you probably want a method that implies it does > something serious. Saying something simple while doing something > complicated will likely make code hard to read. A minor point, > perhaps, but one which, if followed, could again take the sting out > of the writer-method-withoud-explicit-self ambiguity. That's an interesting way to look at it, though I'm not sure it scales very well. I'm thinking of things like hash-like set and fetch methods that operate directly (but transparently) on databases, which I think can be very convenient and not obscure except to the extent that they're designed to black-box-ify the file I/O. I definitely do agree with one part or implication of your point, namely that #field=() methods should set something. I know that sounds obvious, but I think part of what feels shaky to people might be that there's a disconnect between the presence of assignment syntax and the question of what's actually taking place. David -- David Alan Black home: dblack@xxxxxxxxxxxxxxxxxxxx work: blackdav@xxxxxxx Web: http://pirate.shu.edu/~blackdav
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Bug fix for html/fillinform, Philip Mak |
|---|---|
| Next by Date: | Re: Data_Make_Struct Considered Dangerous?, William Djaja Tjokroaminata |
| Previous by Thread: | Re: ambiguity backtrack - accessors and persistent locals, Gavin Sinclair |
| Next by Thread: | Re: ambiguity between local variable assignment and writter method, Charles Hixson |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |