<!DOCTYPE html><html><head>
<style type="text/css">"body { font-family:'Helvetica'; font-size:12px"}</style>
</head>
<body>On Wed, 04 Apr 2012 19:47:02 +0100, Daniel Barlow <dan@telent.net> wrote:<br><br><blockquote style="margin: 0 0 0.80ex; border-left: #0000FF 2px solid; padding-left: 1ex">  On Mon, Apr 2, 2012 at 4:17 PM, Tom Stuart <span dir="ltr"><<a href="mailto:tom@therye.org" target="_blank">tom@therye.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word">Also, I can't think of many situations in which one sets an instance variable in a Rails controller (with the exception of setting up an object in a before_filter for use in an action - see conversations passim) for any reason other than exposing it to the view. I'm not convinced that changing "@post = foo" to some explicit means of passing the data to the view is a huge inconvenience.</div>

</blockquote><div><br>I agree that from the controller's point of view it's just syntax and "@foo=1" is just as good syntax as "proffer :foo".    But now pretend you're the *view*: there's no way on that side of the interface to for it to specify the data it needs. I think it'd catch a non-zero quantity of bugs[*] if  views could explicitly declare the parameters they depend on and bail out (instead of assuming nil) unless all are supplied.  I've used Erector a fair bit and it does have the right idea here, imo<br>

</div></div></blockquote><div><br></div><div>I elaborated on this idea in my earlier response. Would love to hear more reactions to it.</div><div><br></div><blockquote style="margin: 0 0 0.80ex; border-left: #0000FF 2px solid; padding-left: 1ex"><div class="gmail_quote"><div><br>And though I agree that the complexity of this interface rarely reaches levels where it actually *matters* that much, perhaps that in itself is an artefact of the less-than-optimal convention we have here: the subconscious cognitive burden of having to remember which variable names are important is preventing us from designing cleaner, more expressive, more general programs.  (Or on the other hand, perhaps the same cognitive burden is preventing up from ballsing it up completely - who knows?).  There's an analogy to be made here with lexical vs dynamic scope, and history came down squarely on the lexical side of that debate the first time around.<br>
<br>Except for emacs lisp programmers, obviously.  But they're a special case<br><br><br>-dan<br><br>[*] my bugs, at least.  Your buggage may vary.<br>
<br></div></div>-- <br><a href="mailto:dan@telent.net" target="_blank">dan@telent.net</a> <br><a href="http://ww.telent.net" target="_blank">http://ww.telent.net</a><br><br>
</blockquote><br><br><br></body></html>