<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pervasive Code &#187; JavaScript</title>
	<atom:link href="http://www.pervasivecode.com/blog/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pervasivecode.com/blog</link>
	<description>Jamie Flournoy's Software Development Blog</description>
	<lastBuildDate>Mon, 08 Feb 2010 00:36:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Evaluating Future Web Application Technologies</title>
		<link>http://www.pervasivecode.com/blog/2007/11/12/evaluating-future-web-application-technologies/</link>
		<comments>http://www.pervasivecode.com/blog/2007/11/12/evaluating-future-web-application-technologies/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 23:22:30 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[outsourcing]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[strategy]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2007/11/12/evaluating-future-web-application-technologies/</guid>
		<description><![CDATA[Technical Architecture is a Form of Investing. I&#8217;m reminded of this sort of thinking because of recent news from RubyConf 2007.

First, IronRuby joins Ruby.NET in providing a Ruby runtime on .NET. They&#8217;re at different stages of completeness, and building on different .NET runtimes (DLR vs. the regular CLR), but the important point is that Microsoft [...]]]></description>
			<content:encoded><![CDATA[<p>Technical Architecture is a Form of Investing. I&#8217;m reminded of this sort of thinking because of recent news from <a href="http://www.rubyconf.org/">RubyConf</a> 2007.<br />
<span id="more-48"></span><br />
First, <a href="http://www.ironruby.net/">IronRuby</a> joins <a href="http://plas.fit.qut.edu.au/Ruby.NET/">Ruby.NET</a> in providing a Ruby runtime on .NET. They&#8217;re at different stages of completeness, and building on different .NET runtimes (<a href="http://blogs.msdn.com/hugunin/archive/2007/04/30/a-dynamic-language-runtime-dlr.aspx">DLR</a> vs. the regular CLR), but the important point is that Microsoft is investing in dynamic languages. Is it ready for production today? Probably not. But keep an eye on Ruby, Python, and JavaScript if you&#8217;re a .NET developer.</p>
<p>Second, <a href="http://docs.codehaus.org/display/JRUBY/2007/11/02/JRuby+1.1b1+Released">JRuby 1.1b1</a> has been released and as expected is considerably faster (see <a href="http://headius.blogspot.com/2007/11/top-five-questions-i-get-asked.html">item #5 in this link</a>) than the standard &#8220;MRI&#8221; runtime. JRuby joins <a href="http://www.jython.org/">Jython</a> and <a href="http://www.mozilla.org/rhino/">Rhino</a> in providing a JVM-based runtime for a dynamic language, with features designed to help developers mix and match the dynamic language code with Java code.</p>
<p>See the trend here? Python, Ruby, and JavaScript are emerging as the dynamic languages of the future for .NET and Java developers.</p>
<p>The hard work done by Sun and Microsoft to make their VMs work well is being leveraged by the next wave of languages. Threads, high performance I/O, memory management, and portability are all features that are quite expensive to get right, and the .NET and Java platforms have pretty much achieved that at this point. (Piggybacking newer, higher-level languages on these mature runtimes means that you get a mature new language runtime faster than if each language&#8217;s runtime were built from scratch and painstakingly debugged in isolation from the others.)</p>
<p>There are still some hurdles (performance, type safety fears, lack of mass market acceptance, ECMAScript 4 standardization and adoption, etc.), but in 2 or 3 years, things are going to change dramatically in the web application development world. The seeds of this change are already sown, and it&#8217;s just a matter of time. Threads, SQL, OOP, and garbage collection are all features of web application architectures that were initially controversial, but have now met with general acceptance. Dynamic languages are clearly the next step.</p>
<p>Obviously, Java and C# are far from dead, and in 10 years people will still be coding in Java and C#, because as with other languages like C and assembly, the newest and highest-level language isn&#8217;t automatically right for every project. But if you&#8217;re building web applications, most of what your code does falls into the categories of string manipulation, collection operations, or file and socket I/O. Image processing, crypto, full text search, and other CPU-heavy, byte-twiddling features may be part of your application, but you&#8217;re not writing the image scaler, RC4 cipher, or inverted index yourself; those are done in a library, probably written in C, and you&#8217;re just calling it. So your needs are likely to be similar to the sweet spot of dynamic languages: maximum expressivity and the fancy features to let you write clever code, making you productive and making the code as clean and elegant as possible. In other words, they put developer productivity first (lower labor cost and shorter development schedules) at the expense of runtime performance. Since hardware gets cheaper over time but <a href="http://www.laputan.org/mud/mud.html#Forces">code gets uglier over time</a>, this is probably the right choice to make for most web application projects.</p>
<p>Another interesting benefit of layering instead of starting over is that the integration between dynamic languages and Java or CLR languages is much nicer than managed vs. unmanaged code in .NET or, even worse, JNI in Java. That is, it won&#8217;t be a bloody mess to mix and match code, from a technical feasibility standpoint. This matters, because <a href="http://chadfowler.com/2006/12/27/the-big-rewrite">The Big Rewrite</a> is among the <a href="http://www.joelonsoftware.com/articles/fog0000000069.html">Things You Should Never Do</a>. But little bitty rewrites are fine, especially if you have a thorough test suite to help you avoid breaking things. (By the way, dynamic languages are <i>great</i> for writing automated tests.)</p>
<p>Which of these three (JavaScript, Python, or Ruby) is going to be dominant 5 years from now? I don&#8217;t think any of them will be. The dynamic language community is fragmented, and the various vendors and big sponsors of these three languages are fairly entrenched already. Microsoft is investing in all three; Google has standardized on Python and JavaScript to the exclusion of Ruby; Sun has hired the JRuby team; Mozilla is heavily invested in JavaScript; Adobe supports JavaScript in AIR but not Ruby or Python, etc. </p>
<p>In fact, if you encapsulated the glue code sufficiently well, you could mix and match JavaScript, Python, and Ruby in your application, and port your hideous hydra between the JVM and .NET. You would be wasting a lot of effort since the three languages are largely similar, but you could do it. Alternatively, you could create a portability layer between the DLR and the JVM a la WxWindows, and write-once-debug-everywhere in a more productive language than Java.</p>
<p>These are all repugnant ideas, but only because as I write this and as you read this, we probably realize that to attempt this today would be a huge task. But what about in 2010? Probably not so gross. What about an application that could be executed on Silverlight, AIR, Firefox, SWT, and Mono, unmodified? How about a mobile app that runs on smartphones regardless of the runtime (.NET vs. J2SE)? Not gross at all, and not unthinkable if your app is written in JavaScript using some kind of portability layer that doesn&#8217;t exist yet.</p>
<p>In the longer term, JavaScript (a.k.a. ECMAScript 4) is likely to become extremely popular. As far as I know it&#8217;s not quite a perfect fit for Steve Yegge&#8217;s <a href="http://steve-yegge.blogspot.com/2007/02/next-big-language.html">The Next Big Language</a>, but it&#8217;s the closest thing there is, and it has two critical advantages over Ruby and Python that will make it successful: C-family syntax (which makes development tools cheaper to build) and effectively unanimous buy-in from vendors and developers.</p>
<p>So, what about the other dynamic languages that people are using in large numbers today? What&#8217;s going to happen to ActionScript, CFScript, PHP, and VB?</p>
<p>ActionScript and CFScript are pretty close to JavaScript by design; I&#8217;ve read that ActionScript 3 is actually compliant with the ECMAScript 4 draft specfication. It&#8217;s pretty clear that Adobe is betting on JavaScript. In the near future (2 or 3 years) I predict that Adobe will rev its products and support ECMAScript 4 across the board.</p>
<p>PHP and VB.NET/VBScript will hang around for a long time because they&#8217;re approachable and already very popular, but they&#8217;ve already peaked, and will steadily decline as developers switch to C# (on the .NET side) and Rails (on the Linux side), and then JavaScript as soon as a serious web app framework and an ISP-friendly runtime exist. Microsoft will keep investing in VB to keep customers happy; Yahoo will keep investing in PHP because it is so heavily invested in PHP already; new developers will find PHP to be an easy starting point for light duty web development, with tons of documentation and free applications that they can download and hack. But PHP will not inherit the kingdom from C# or Java, and the languages which do achieve mainstream success after C# and Java will do everything that PHP does language-wise, and the market momentum around those languages will make them better than PHP at what PHP does. Developers will ask themselves why they would write the client side and server side in two different languages, especially when the server-side language is more expressive and has better portability and libraries. That&#8217;s not true yet, but it will be in a couple of years. In 5 years or so PHP and VBScript will go the way of Perl CGIs: still used, but by a community a tenth of the size it is today.</p>
<p>What about the new Java-based dynamic language, Groovy? Groovy is interesting, but it&#8217;s too late. The Java mainstream of vendors and developers only recently managed to convince the world of &#8220;serious&#8221; C++ developers that automatic garbage collection and JIT compiled bytecodes can actually work in a high traffic context. The next battle, to promote the dynamic language features that Java lacks but which Groovy brings, will take years to fight. Once a developer makes a decision to not use standard Java, Groovy is on a more or less level playing field with the JVM-hosted versions of Python, JavaScript, and Ruby, but each of those languages has far greater adoption than Groovy, and each of them has greater opportunity for leverage on other runtimes than Groovy. For a Java developer, once the door is opened to other languages, the only advantage Groovy has is that its syntax is familiar. Compare this to JavaScript which web developers also need to know how to use; why learn a third language (Groovy) in addition to Java and JavaScript? Over time the simplicity of coding and debugging in JavaScript on client and server, together with dynamic-language productivity, will overcome the momentum of the Java standard, and web developers using server-side Java now will gradually replace it with JavaScript on the JVM. Conservative attitudes in the mainstream Java community (including Fortune 500 companies and the many offshore development firms that write code for them) will make this take quite a while &#8211; probably 5 years before JavaScript becomes a common part of the architectures that currently use J2EE, and 10 years before Java goes the way of COBOL (maintained forever but not used for new projects).</p>
<p>So in conclusion, keeping an eye on the future value of a technology, including who&#8217;s investing in it and who&#8217;s talking about investing in it, is critical to making your own investments today. In five years you&#8217;re not going to be using the same technology stack that you are today, and your project&#8217;s success and your own salary will be tied in large part to how well you invested today.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2007/11/12/evaluating-future-web-application-technologies/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Mozilla Platform&#8217;s Catch-22 Problem</title>
		<link>http://www.pervasivecode.com/blog/2007/04/30/the-mozilla-platforms-catch-22-problem/</link>
		<comments>http://www.pervasivecode.com/blog/2007/04/30/the-mozilla-platforms-catch-22-problem/#comments</comments>
		<pubDate>Mon, 30 Apr 2007 23:00:58 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Thunderbird]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[labor]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2007/04/30/the-mozilla-platforms-catch-22-problem/</guid>
		<description><![CDATA[Starting with Netscape 4.5, I&#8217;ve used Netscape, then Mozilla, then Thunderbird for email. I have a similar relationship with Firefox. I&#8217;ve watched with great hope and been disappointed over the years as Thunderbird bugs that really annoy me just&#8230; stay. I think I know why. It&#8217;s because Firefox and Thunderbird are built in such a [...]]]></description>
			<content:encoded><![CDATA[<p>Starting with Netscape 4.5, I&#8217;ve used Netscape, then Mozilla, then Thunderbird for email. I have a similar relationship with Firefox. I&#8217;ve watched with great hope and been disappointed over the years as Thunderbird bugs that really annoy me just&#8230; stay. I think I know why. It&#8217;s because Firefox and Thunderbird are built in such a way as to create a catch-22 situation &#8212; one that actually discourages new contributors.<br />
<span id="more-23"></span><br />
Here&#8217;s a good example of a bug that would seem to be trivial to fix: <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=271222">&#8220;Entire message&#8221; quick search criteria is only the body</a>. You can&#8217;t search the entire message in Thunderbird. Can&#8217;t do it. Never been possible, as far as I know. Lots of people noticed it; it&#8217;s been marked as an &#8220;enhancement&#8221; in &#8220;New&#8221; status for years, even though it&#8217;s quite obviously a bug in my opinion. So, go to the source code, find the part where it decides what parts of the body to search, and make it search the whole thing. Should be easy, right?</p>
<p>Hell no. Firefox and Thunderbird are built using an <a href="http://www.mozilla.org/docs/#core">incredibly complicated set of tools and technologies</a> created by the Netscape and Mozilla folks, specifically for the purpose of building Firefox and Thunderbird.</p>
<p>Low-level stuff is written in C++, but if you know C++ already you still have to learn their coding standards and class libraries. Yeah, it&#8217;s great that they have coding standards and libraries; I&#8217;m just sayin&#8217;, that&#8217;s more stuff you have to learn in order to write a single line of low-level code.</p>
<p>High level stuff is in a combo of JavaScript and XML. Of course you have to learn the XUL platform stuff, so just knowing JavaScript and XML isn&#8217;t sufficient. You&#8217;ll also probably need to learn to use the low-level classes from the XUL side, so that you can get anything done.</p>
<p>Now if you want to actually build it, you&#8217;ll also need to understand their build system, and maybe their installer. You might need to learn how their help system, documentation system, internationalization sytem, etc. etc. work.</p>
<p>Now, I&#8217;m in awe of the monumental amount of new and working code that the Mozilla community has created. But the problem is just that: they built this huge application stack, and in order to get working on Firefox or Thunderbird, you have to learn a big chunk of that stack.</p>
<p>In theory, this wouldn&#8217;t be any more of a barrier than if they had coded to a single platform&#8217;s GUI widget set, class library, etc. But if I were to learn .NET and Visual Studio, or Cocoa, or GTK+, I would then have skills that I could use to work on thousands of other applications, either open source or commercial. That&#8217;s because those technologies are designed for general purpose application development.</p>
<p>The Mozilla application platform, however, has no life of its own outside of Mozilla. There&#8217;s an effort to extract it and make XULRunner a viable standalone platform that you could build your own XUL applications on, but that&#8217;s currently just a &#8220;stable developer preview&#8221;. What that means is that it&#8217;s still not suitable for use if you wanted to, say, <a href="http://www.songbirdnest.com/development">build your own iTunes killer</a> with it. It&#8217;s almost there, and maybe if you throw a lot of effort at it you could hack it so it&#8217;s usable, but as-is, it isn&#8217;t readily useful.</p>
<p>So, when a developer (such as myself) looks at this technology set, they ask themselves the question, &#8220;can I justify spending this much time learning all this stuff just to fix a little annoying bug?&#8221; If you spend a week or two downloading and learning and hacking and that gets you a certain amount of skill with the technology set, was it worth it? Maybe you could go get a job working with this technology set, except almost no one else is using it, not even open source projects.</p>
<p>When a corporation looks at this technology set, they have to ask a similar question: &#8220;is this the platform that will give me the best bang for my developer buck?&#8221; If they invest the time and money in hiring developers to work on this mostly-complete platform, so that they can then build an application with it, will it pay off? What about alternatives? Will the pool of available developers be so small that the project will fail before it starts?</p>
<p>These are not insurmountable barriers; some folks know some of these technologies already or only want to work on a corner of the application, so the overhead is smaller. Or, they may really want to work on Firefox or Thunderbird very badly. For an employer or open source project, their goals may match the goals of the original platform designers very well, in which case the payoff of using the Mozilla platform would be much higher than if you were (for example) making a Windows-only IM client.</p>
<p>But the barriers do exist, and they discourage the platform and the applications built with it from being improved. Developers don&#8217;t want to spend all that time learning things they can&#8217;t use elsewhere, and employers don&#8217;t want to pay developers to fix the platform so that other projects could find it useful. <a href="http://developer.mozilla.org/en/docs/XULRunner_Hall_of_Fame">A few projects do exist</a> and obviously somebody somewhere is working on Thunderbird bugs, but for a platform this sophisticated with this much mindshare (via Firefox), it&#8217;s remarkably unsuccessful in terms of adoption by developers.</p>
<p>All it would take to fix this would be some cash. Somebody could donate (or spend, in pursuit of a business goal) money toward the completion of XULRunner for general use, and toward clear and useful beginning developer documentation for the rest of the Mozilla platform.</p>
<p>Any takers? I could thrown in a hundred bucks or so, but I have a feeling this is more like a $50,000 undertaking. Otherwise we&#8217;re stuck waiting for Joost and a handful of others to slowly move it along.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2007/04/30/the-mozilla-platforms-catch-22-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
