<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, 11 Nov 2016 at 16:24 Reza Naghibi <<a href="mailto:reza@varnish-software.com">reza@varnish-software.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><span style="font-size:12.8px" class="gmail_msg">> variable uses out of order</span></div><div class="gmail_msg"><span style="font-size:12.8px" class="gmail_msg"><br class="gmail_msg"></span></div><div class="gmail_msg"><span style="font-size:12.8px" class="gmail_msg">Right now this seems to be a limitation in the vcc. Im tempted to say this would simply be irksome for the time being. I would have to research how this could be addressed, but im feeling this fix is out of scope right now (and can be fixed independently of this VIP).</span></div></div></blockquote><div><br></div><div>Agreed that it it can be fixed independently, though I do think that the new object powers will make the problem more prevalent. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><span style="font-size:12.8px" class="gmail_msg">> </span><span style="font-size:12.8px" class="gmail_msg">uninitialised objects</span></div><div class="gmail_msg"><span style="font-size:12.8px" class="gmail_msg"><br class="gmail_msg"></span></div><div class="gmail_msg"><span style="font-size:12.8px" class="gmail_msg">This is a very valid concern and good thing you brought this up. When I first read it, I thought about how other languages tackle this, in particular, Java and C. Both languages either error out or warn at compile time about uninitialized variables. So I think we could use the same approach. If you define a variable inside of a control statement (if/else), then that's a compile error due to it possibly being uninitialized and unsafe. So this definitely needs to be addressed and fixed.</span></div></div></blockquote><div><br></div><div>We do not correctly handle object initialization inside of control statements today, so disallowing that at compile time seems like a natural first step. Though there are use cases where it would be nice to be able to do that, so having a plan for what it should be like down the line would help to make sure we don't get it wrong in the mean time.</div><div><br></div><div>Martin</div></div></div>