<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Why JavaScript (or really, ECMAScript)?</title>
	<atom:link href="http://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/</link>
	<description>Thoughts, rants, and even some code from the mind of Barney Boisvert.</description>
	<lastBuildDate>Thu, 11 Sep 2014 09:58:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: dan plesse</title>
		<link>https://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/comment-page-1/#comment-53984</link>
		<dc:creator>dan plesse</dc:creator>
		<pubDate>Mon, 31 Dec 2007 08:24:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/#comment-53984</guid>
		<description>Example  #1 

cfset application.MySQL5_connection = MySQL5.connect(&quot;jdbc:mysql://localhost:3306/opticalalert&quot;, props)&gt;

Example  #2 

cfset application.update_mailinglist_remove = application.sqlserver_connection.prepareStatement(&quot;Update mailinglist SET email = ?, why = ?, Delivery = ? WHERE email = ?&quot;)&gt;

CF 8.X only likes prepareStatements now so. 

Is this still verbose? Then its just ....

Example  #3
cfset application.update_mailinglist_remove.executeQuery()&gt; 

With the new Thread scope I am sure that would work even better or a threadpool scope.</description>
		<content:encoded><![CDATA[<p>Example  #1 </p>
<p>cfset application.MySQL5_connection = MySQL5.connect("jdbc:mysql://localhost:3306/opticalalert", props)&gt;</p>
<p>Example  #2 </p>
<p>cfset application.update_mailinglist_remove = application.sqlserver_connection.prepareStatement("Update mailinglist SET email = ?, why = ?, Delivery = ? WHERE email = ?")&gt;</p>
<p>CF 8.X only likes prepareStatements now so. </p>
<p>Is this still verbose? Then its just &#8230;.</p>
<p>Example  #3<br />
cfset application.update_mailinglist_remove.executeQuery()&gt; </p>
<p>With the new Thread scope I am sure that would work even better or a threadpool scope.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/comment-page-1/#comment-50148</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Thu, 29 Nov 2007 17:39:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/#comment-50148</guid>
		<description>David,

I implemented it more as a proof of concept than an actual for-production-use framework.  However, I was surprised at how utilitarian it was, what with only the Query object and native JS functionality.  Extending the set of &quot;callbacks&quot; to CF is fairly simple; most of the bridge work is in place, so you only have to create your JS interface and implement it with the relevant CFML.  The Query one is actually quite complex because of query parameters, and it doesn&#039;t support  QofQs.  Something like CFLDAP or CFHTTP would be quite a bit simpler to deal with.

However, to answer your question, I don&#039;t really have an intention of making it into something &quot;real&quot;.  I just wanted to see how it&#039;d work, both from an implementation and a usage perspective.  I have this sneaking suspicion that CF9 is going to have Tamarin (the AS3/ECMAScript 4 engine that Adobe donated to Mozilla and which backs Flash Player) embedded in it, and therefore have this sort of support available in the CF server directly.</description>
		<content:encoded><![CDATA[<p>David,</p>
<p>I implemented it more as a proof of concept than an actual for-production-use framework.  However, I was surprised at how utilitarian it was, what with only the Query object and native JS functionality.  Extending the set of "callbacks" to CF is fairly simple; most of the bridge work is in place, so you only have to create your JS interface and implement it with the relevant CFML.  The Query one is actually quite complex because of query parameters, and it doesn't support  QofQs.  Something like CFLDAP or CFHTTP would be quite a bit simpler to deal with.</p>
<p>However, to answer your question, I don't really have an intention of making it into something "real".  I just wanted to see how it'd work, both from an implementation and a usage perspective.  I have this sneaking suspicion that CF9 is going to have Tamarin (the AS3/ECMAScript 4 engine that Adobe donated to Mozilla and which backs Flash Player) embedded in it, and therefore have this sort of support available in the CF server directly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Stamm</title>
		<link>https://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/comment-page-1/#comment-50143</link>
		<dc:creator>David Stamm</dc:creator>
		<pubDate>Thu, 29 Nov 2007 16:24:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/#comment-50143</guid>
		<description>Barney, you rock.  I wish you every success with this project.  I&#039;ve been looking for a CF runtime for Javascript, and was even thinking of writing one myself.  (Boy, was THAT naive!)  Do you plan to continue work on this?

I&#039;m a little astonished by all the negative reactions in the comments.

I&#039;ve been a ColdFusion developer for 8 years, and I love it dearly.  Yay for cfquery and pound signs.  But heck yeah, I want to write my business logic in Javascript while to leveraging the CF platform!

Javascript has syntax and features that appeal to millions of developers.  It is being adopted as the scripting language of choice all over the place.  It has a passionate developer community, and they are continually building better libraries and more sophisticated tools.

We dig JS.  And we don&#039;t care if &quot;dynamic binding is dangerous!&quot; or &quot;closures make give you warts!&quot;  I&#039;ll leave the philosophy of language design to others, and continue using JS quite happily, thank you very much.

If someone wants to write a CF runtime for Ruby, Dylan, Scheme, etc...  rock on!  Those languages are not for me, but I&#039;m not about to rail (no pun intended) against their allegedly dangerous language features.  That&#039;s like mocking someone for using an abacus or a slide rule instead of a calculator.

One last thought: cfscript is not Javascript.  Not even in CF8 with its excellent C-style syntax.  The list of things you can do in Javascript and not in cfscript is ridiculously long.</description>
		<content:encoded><![CDATA[<p>Barney, you rock.  I wish you every success with this project.  I've been looking for a CF runtime for Javascript, and was even thinking of writing one myself.  (Boy, was THAT naive!)  Do you plan to continue work on this?</p>
<p>I'm a little astonished by all the negative reactions in the comments.</p>
<p>I've been a ColdFusion developer for 8 years, and I love it dearly.  Yay for cfquery and pound signs.  But heck yeah, I want to write my business logic in Javascript while to leveraging the CF platform!</p>
<p>Javascript has syntax and features that appeal to millions of developers.  It is being adopted as the scripting language of choice all over the place.  It has a passionate developer community, and they are continually building better libraries and more sophisticated tools.</p>
<p>We dig JS.  And we don't care if "dynamic binding is dangerous!" or "closures make give you warts!"  I'll leave the philosophy of language design to others, and continue using JS quite happily, thank you very much.</p>
<p>If someone wants to write a CF runtime for Ruby, Dylan, Scheme, etc&#8230;  rock on!  Those languages are not for me, but I'm not about to rail (no pun intended) against their allegedly dangerous language features.  That's like mocking someone for using an abacus or a slide rule instead of a calculator.</p>
<p>One last thought: cfscript is not Javascript.  Not even in CF8 with its excellent C-style syntax.  The list of things you can do in Javascript and not in cfscript is ridiculously long.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Go &#187; Blog Archive &#187; ClosurePlus: Pass arguments when executing a Method Closure</title>
		<link>https://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/comment-page-1/#comment-45599</link>
		<dc:creator>Go &#187; Blog Archive &#187; ClosurePlus: Pass arguments when executing a Method Closure</dc:creator>
		<pubDate>Thu, 01 Nov 2007 22:52:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/#comment-45599</guid>
		<description>[...] Some say closures should be avoided because they add memory that is not clearable by the Garbage Collector. (Apparently closures are fairly complex on a low level, each storing a &quot;snapshot&quot; of the function&#039;s scope which can end up creating a tangle of object references.) In my tests so far this does prove true to a certain degree, but is only significant when the closures aren&#039;t cleaned up in your program code, so be sure to null out ClosurePlus references when you&#039;re done with them! Heavy use of closures (as in millions) does seem to leave a bit more un-GC&#039;d memory clutter, but moderate use of ClosurePlus shouldn&#039;t be any worse than using the standard Event model.Here&#039;s a good discussion thread I found on the topic. [...]</description>
		<content:encoded><![CDATA[<p>[...] Some say closures should be avoided because they add memory that is not clearable by the Garbage Collector. (Apparently closures are fairly complex on a low level, each storing a "snapshot" of the function's scope which can end up creating a tangle of object references.) In my tests so far this does prove true to a certain degree, but is only significant when the closures aren't cleaned up in your program code, so be sure to null out ClosurePlus references when you're done with them! Heavy use of closures (as in millions) does seem to leave a bit more un-GC'd memory clutter, but moderate use of ClosurePlus shouldn't be any worse than using the standard Event model.Here's a good discussion thread I found on the topic. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/comment-page-1/#comment-43174</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Wed, 17 Oct 2007 18:07:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/#comment-43174</guid>
		<description>Justin,

The typechecking is one of the reasons I&#039;d love to have an ECMAScript 4 (e.g. ActionScript 3) interpreter instead of a ECMAScript 3 (e.g. JavaScript) interpreter.  With the 4th edition, you get typing as well as default values for parameters (and therefore optional parameters).  So you could write this:

function doIt(param1:UUID, param2:Array=[]):void {
}</description>
		<content:encoded><![CDATA[<p>Justin,</p>
<p>The typechecking is one of the reasons I'd love to have an ECMAScript 4 (e.g. ActionScript 3) interpreter instead of a ECMAScript 3 (e.g. JavaScript) interpreter.  With the 4th edition, you get typing as well as default values for parameters (and therefore optional parameters).  So you could write this:</p>
<p>function doIt(param1:UUID, param2:Array=[]):void {<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>https://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/comment-page-1/#comment-43159</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Wed, 17 Oct 2007 15:50:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/#comment-43159</guid>
		<description>Looks like the code snippet didn&#039;t show,

[cffunction name=&quot;doIt&quot; output=&quot;false&quot;]
    [cfargument name=&quot;param1&quot; required=&quot;true&quot; type=&quot;uuid&quot; /]
    [cfargument name=&quot;param2&quot; required=&quot;false&quot; type=&quot;array&quot; default=&quot;#arrayNew(1)#&quot; /]
[/cffunction]</description>
		<content:encoded><![CDATA[<p>Looks like the code snippet didn't show,</p>
<p>[cffunction name="doIt" output="false"]<br />
    [cfargument name="param1" required="true" type="uuid" /]<br />
    [cfargument name="param2" required="false" type="array" default="#arrayNew(1)#" /]<br />
[/cffunction]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>https://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/comment-page-1/#comment-43158</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Wed, 17 Oct 2007 15:41:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/#comment-43158</guid>
		<description>Regarding the verbosity of CFML, in your example (and I realize its just an example) the CFML version could be written in cfscript and look exactly like the JS alternative provided beneath it. The benefit of using the ML syntax vs a JS approach is when you go beyond the basics to include arg validation, type checking ect. Take for example:


  
  



Interesting post by the way!</description>
		<content:encoded><![CDATA[<p>Regarding the verbosity of CFML, in your example (and I realize its just an example) the CFML version could be written in cfscript and look exactly like the JS alternative provided beneath it. The benefit of using the ML syntax vs a JS approach is when you go beyond the basics to include arg validation, type checking ect. Take for example:</p>
<p>Interesting post by the way!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Muzak</title>
		<link>https://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/comment-page-1/#comment-43085</link>
		<dc:creator>Muzak</dc:creator>
		<pubDate>Wed, 17 Oct 2007 09:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/#comment-43085</guid>
		<description>&quot;cross-browser supportâ€ as in &quot;JS isn&#039;t cross-browser&quot;, cfml couldn&#039;t care less.</description>
		<content:encoded><![CDATA[<p>"cross-browser supportâ€ as in "JS isn't cross-browser", cfml couldn't care less.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/comment-page-1/#comment-43011</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Wed, 17 Oct 2007 01:36:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/#comment-43011</guid>
		<description>Muzak,

While nothing you quote is factually incorrect, it&#039;s quite inflationary in nature.  Looking at the page as a whole (from a community-edited Wiki), you see a rather fragmented collection of comments from a collection of authors with different viewpoints.  To quote a rather more consistent source (the Google Maps API docs) &quot;The Google Maps API encourages the use of function closures...&quot;.

Closures definitely have gotchas, but the same could be said for SQL databases, and no one runs away from those.  You just have to know how to use them to best effect, avoid the pitfalls, and you&#039;ll be fine.

I don&#039;t understand your &quot;cross-browser support&quot; comment, however.  All browsers support closures, and have since &quot;forever&quot;.  IE has memory leaks in certain cases, but they can be addressed without too much fuss, certainly more easily than you can address some of the rendering bugs that it has.  This is also a non-issue on the server side.</description>
		<content:encoded><![CDATA[<p>Muzak,</p>
<p>While nothing you quote is factually incorrect, it's quite inflationary in nature.  Looking at the page as a whole (from a community-edited Wiki), you see a rather fragmented collection of comments from a collection of authors with different viewpoints.  To quote a rather more consistent source (the Google Maps API docs) "The Google Maps API encourages the use of function closures&#8230;".</p>
<p>Closures definitely have gotchas, but the same could be said for SQL databases, and no one runs away from those.  You just have to know how to use them to best effect, avoid the pitfalls, and you'll be fine.</p>
<p>I don't understand your "cross-browser support" comment, however.  All browsers support closures, and have since "forever".  IE has memory leaks in certain cases, but they can be addressed without too much fuss, certainly more easily than you can address some of the rendering bugs that it has.  This is also a non-issue on the server side.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Muzak</title>
		<link>https://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/comment-page-1/#comment-43000</link>
		<dc:creator>Muzak</dc:creator>
		<pubDate>Wed, 17 Oct 2007 00:36:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/2007/10/16/why-javascript-or-really-ecmascript/#comment-43000</guid>
		<description>IMO, nested functions are a big &quot;no no&quot;.

It&#039;s even advised against in the Core Javascript Reference:

A closure preserves the arguments and variables in all scopes it contains. Since each call provides potentially different arguments, a closure must be created for each call to the outer function. In other words, each call to outside creates a closure. For this reason, closures can use up a lot of memory. The memory can be freed only when the returned inside is no longer accessible. In this case, the closure of inside is stored in result. Since result is in the global scope, the closure will remain until the script is unloaded (in a browser, this would happen when the page containing the script is closed). 

Because of this inefficiency, avoid closures whenever possible, i.e. avoid nesting functions whenever possible.


And what about cross-browser support?</description>
		<content:encoded><![CDATA[<p>IMO, nested functions are a big "no no".</p>
<p>It's even advised against in the Core Javascript Reference:</p>
<p>A closure preserves the arguments and variables in all scopes it contains. Since each call provides potentially different arguments, a closure must be created for each call to the outer function. In other words, each call to outside creates a closure. For this reason, closures can use up a lot of memory. The memory can be freed only when the returned inside is no longer accessible. In this case, the closure of inside is stored in result. Since result is in the global scope, the closure will remain until the script is unloaded (in a browser, this would happen when the page containing the script is closed). </p>
<p>Because of this inefficiency, avoid closures whenever possible, i.e. avoid nesting functions whenever possible.</p>
<p>And what about cross-browser support?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
