<?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; C++</title>
	<atom:link href="http://www.pervasivecode.com/blog/category/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pervasivecode.com/blog</link>
	<description>Jamie Flournoy's Software Development Blog</description>
	<lastBuildDate>Fri, 19 Mar 2010 05:37:52 +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>J2ME: Write Once, Be Disappointed Everywhere</title>
		<link>http://www.pervasivecode.com/blog/2007/08/19/j2me-write-once-be-disappointed-everywhere/</link>
		<comments>http://www.pervasivecode.com/blog/2007/08/19/j2me-write-once-be-disappointed-everywhere/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 05:37:59 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[IA]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[articles]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2007/08/19/j2me-write-once-be-disappointed-everywhere/</guid>
		<description><![CDATA[We developers and other nerdy folk are used to using strange and klunky applications that do something special, and we&#8217;re used to that trade-off.
Eclipse is an IDE so it&#8217;s hard to imagine it not being baroque and difficult to use, requiring weeks of effort to become productive. JBidWatcher has saved me a lot of money [...]]]></description>
			<content:encoded><![CDATA[<p>We developers and other nerdy folk are used to using strange and klunky applications that do something special, and we&#8217;re used to that trade-off.</p>
<p><a href="http://www.eclipse.org/">Eclipse</a> is an IDE so it&#8217;s hard to imagine it <i>not</i> being baroque and difficult to use, requiring weeks of effort to become productive. <a href="http://www.jbidwatcher.com/">JBidWatcher</a> has saved me a lot of money on eBay so I could probably put a dollar value on how much it&#8217;s worth to endure its bizarre UI. <a href="http://azureus.sourceforge.net/">Azureus</a> is fairly fugly also but it does a very good job and has a deep, sophisticated UI that&#8217;s fairly easy to understand, so despite the eyesore, it&#8217;s at least fairly clear. The common thread among all of these is that they are all written in Java, and that they are so valuable that it&#8217;s worthwhile to overlook the ugly UIs.</p>
<p>Now imagine those sorts of trade-offs, but on already difficult to use mobile devices, and aimed at consumers. Are you making a strategically wise choice by sacrificing usability and control over the user interface, and probably access to platform-specific features such as dialing the phone, in order to save money on development? Adam Breindel talks about this in <a href="http://skipmeamadeus.blogspot.com/2007/08/when-building-smartphone-app-resist.html">When Building a Smartphone App, Resist the Siren Song of J2ME</a>.<br />
<span id="more-42"></span></p>
<p>Adam and I worked on a J2ME application and I totally agree with him about the disillusionment of trying to write a single app that would work across phones. Issues include:</p>
<ul>
<li>Complex and difficult application installation procedures for end-users: How do you install the JVM on the phone? How do you get the plain J2ME app packaged up so that the phone will accept it? Does the app require manual user configuration before use? Is there a different launching process from other apps?</li>
<li>Lack of control of the user interface: hardware details such as how many buttons you have, whether there&#8217;s a stylus, etc. differ from phone to phone, and the API to let you code once and let J2ME handle the layout for each device leaves your code very disconnected from what&#8217;s actually happening on the screen.</li>
<li>Not being able to use recent J2ME APIs because even the latest phones only support older, more minimal J2ME APIs</li>
<li>Not being able to do things on a phone that would seem obvious, like dialing the phone, opening a hyperlink in the phone&#8217;s browser, sending an SMS, or making a network connection. Either these are entirely impossible or require phone-specific or JVM-specific tools and procedures to sign your application, or having the runtime nag the user to request permission to do something that they just asked the app to do for them.</li>
</ul>
<p>For all the noise Sun is making about broad J2ME penetration, the developer experience is quite disappointing, and as a result, the user experience is also quite disappointing. You can look up J2ME features and APIs and get excited, but when you actually deploy your app to a handset, it won&#8217;t load, or runs terribly slowly, or looks awful, or simply doesn&#8217;t do the things that the API says will happen when you call it a certain way. Suddenly the strict J2SE and J2EE logo certification programs make sense, because the J2ME approach of making so much functionality specified but optional leaves developers high and dry. The phone supports J2ME version xyz, but write an app coded to that API that works on the emulator and deploy it to a handset and lo and behold, all those optional APIs turn out to be missing even though the handset is capable of that functionality, and <i>some mandatory API functions are not working</i>. <a href="http://en.wikipedia.org/wiki/Here_be_dragons">Here be dragons</a>.</p>
<p>Case in point: can&#8217;t dial the phone on a Treo 650 (at least, not as of a year ago). The J2ME API tells you how to do it. The PalmOS JVM (made by IBM) lets you make the API call, and returns a successful response. Nothing happens. IBM says they&#8217;re aware of this issue. The end. The docs say you can, the code you write says you did, the phone just doesn&#8217;t do it.</p>
<p>Case in point: Every time you start an application and it accesses the network for the first time on a Treo 650, the user is nagged for permission to access the network. Quit the app and start again, nagged again. IBM has a tool that you can use to sign the app, but you have to use their VisualAge Micro Edition IDE which costs hundreds of dollars to do that. Try and find and download the trial version. A year ago, it was not possible. So, making that persistent nag go away probably costs several hundred dollars. (I never verified that it actually works, just that IBM says the way to sign the app so that it&#8217;s trusted is to do that, and that there was no available free way to get that tool.)</p>
<p>These are minor issues, but they certainly interfere with the quick usage pattern of a mobile app, and make it annoying to use your app. Imagine what that would be like if you had a competitor with a native application for that phone, whose application probably cost them more, but their app is better and the user likes it a lot more.</p>
<p>The important distinction here is not cost, it&#8217;s ROI. It costs a lot to develop a similar application for each smartphone platform, using that platform&#8217;s native tools. It would seem to cost a lot less to develop a J2ME app. But that&#8217;s only if you assume that it&#8217;s OK to abandon features and settle for a horrid user experience in the course of development.</p>
<p>It&#8217;s likely that your goal as a development team is to develop an app that has a predefined feature set that you know the device can support, and a predefined UI design that your mobile-savvy UI people are sure will go over well with users accustomed to that particular kind of smartphone. In that case you will almost certainly fail to accomplish that goal using J2ME. You have to scale back your goal so that you&#8217;re satisfied that you got something kinda like what you wanted working on a bunch of phones, and determined users will probably be able to figure out how to install it and make it work.</p>
<p>I call that phenomenon &#8220;write once, be disappointed everywhere.&#8221;</p>
<p>Let&#8217;s continue talking about cost, though. The native apps may require (or suggest) different programming language skills for different devices. It might seem wise to just write everything in C, but I think that&#8217;s a false economy as well. The phone APIs will differ so much that you will really need a native developer for each platform, not a team of generic C developers who will figure out the individual phone stuff and be freely floating resources that you can assign to whatever app version needs their attention. Smartphones may run Linux, may run Windows Mobile, may run PalmOS, may run Symbian&#8230; these are different operating systems with very different ideas of how applications run and coexist. The platform specific knowledge (APIs, appropriate UI feel, device capabilities) is probably an order of magnitude harder to learn and maintain than the ability to get an application working in a given programming language.</p>
<p>How much of a great C programmer&#8217;s skill is really the C language, and how much of it is proficiency with the available libraries on the platform he or she is accustomed to? I think close to 90% of their professional skill set is platform and library familiarity, and 10% syntax and low-level understanding of how the language actually works.</p>
<p>In light of this (just using C doesn&#8217;t mean developers or code are portable across smartphones), consider that there are high level languages available for some smartphones. What if that 90% platform familiarity means they can use a language and/or development environment that makes them 5 or 10 times as productive, after spending just a few days or a couple of weeks learning the language syntax?</p>
<p>After our very disappointing J2ME-on-PalmOS port experience, Adam found <a href="http://www.handheld-basic.com/">Handheld Basic</a> which initially appalled me (oh no, BASIC!) but turned out to be a great choice. It&#8217;s a flavor of BASIC, so learning the language didn&#8217;t take long, and the support happens to be quite good (<i>lots</i> of code samples) so picking up the library portion of that 90% didn&#8217;t take long at all. I imagine that C# on Windows Mobile is similar. As more and more phone start to use Linux as their OS (which will be a particularly huge improvement for PalmOS based phones), you&#8217;ll be able to use Python, Ruby, Mono, J2SE (a whole different animal from J2ME), TCL, or pretty much any other high level language available for Linux. At LinuxWorld 2006 I saw a development device running unmodified GNOME desktop apps running on a PalmOS device alongside PalmOS apps. There are more options appearing all the time, and with the exception of Handheld Basic, most of them are ports of familiar, mature, well understood desktop languages, with class libraries relevant to mobile devices.</p>
<p>So, I recommend that you work in whatever high level language lets you do all the platform specific stuff you want, and if that means a different language per phone, that&#8217;s actually going to be the least expensive way to get to the apps you actually wanted to build. A big chunk of the scary cost of developing native apps goes away, because native doesn&#8217;t necessarily mean abandoning Java for C. (In fact I found Handheld Basic to be a more productive environment for me after a couple of weeks than J2ME was, despite my ~8 years of full time Java experience before starting that project.)</p>
<p>That pretty much means no reuse for you. Sorry, but that&#8217;s the deal right now.</p>
<p>If that unique-app-per-platform cost is too scary, consider a few ways to save money:</p>
<ul>
<li>For networked apps (aren&#8217;t they all?) ask yourself if there&#8217;s some logic that could just as easily be done on the server as on the client. Is there some complicated parsing code on the client that could be simplified by changing the response format from the server to something that&#8217;s easier to parse?</li>
<li>Can you remove or alter certain features from a subset of platforms you intend to support, so that your premium supported platforms get your ideal app, whereas a few less popular phones still get a nice app, but perhaps one that doesn&#8217;t have every feature available on your premium app. You might be reading this and thinking &#8220;but that&#8217;s what you said J2ME would force me to do! Why is this any better?&#8221; The distinction is that you are in control of the decision of what to leave out to save money, whereas with J2ME it&#8217;s the platform vendor who makes that decision for everyone using their platform. If you&#8217;re writing an address book, not being able to dial the phone is lethal; not writing the code to let the user attach a photo to the entries is not.</li>
<li>Can you move some user-facing functionality to the server to make the client simpler? Maybe there are some rarely-used features that could be done via a desktop or mobile web browser, so you can focus on putting the ten-times-a-day features on the handset, and making those features fast and convenient. You probably already made that trade-off in general, but perhaps for some kinds of handset, you&#8217;ll move the dividing line a little further, so that for users of particularly rare phones, some moderately frequent features can&#8217;t be done on the phone. This could also be a good approach for new handset types: design a &#8220;lite&#8221; app and a &#8220;full&#8221; app version, build the &#8220;lite&#8221; app first on each platform, and let user demand tell you whether the full app is worth it. Your developers can tell you much more accurately how much the incremental functionality would cost, since they already have done the lite version. Maybe you&#8217;d provide a VoiceXML interface, or mobile web browser interface, for that feature so that the user can still do whatever the feature requires while they&#8217;re far from a desktop PC.</li>
</ul>
<p>A final consideration: labor. Maybe you have some Java developers, or C developers, and don&#8217;t have developers good at Handheld Basic or C#, so you&#8217;re not inclined to fire them all and hire new developers to do native apps, you&#8217;re thinking maybe C on every handset, or J2ME, is still the right choice. I still say that you should probably use native apps in native high level languages on every smartphone platform. If you&#8217;re committed to a strategy of good apps on a bunch of different phones, I think I&#8217;ve made clear that native apps are the only way to currently get there; J2ME simply doesn&#8217;t let you make good apps. So what&#8217;s left is C code written by C developers vs. high level code written by C developers who have to retrain.</p>
<p>As I said above, I don&#8217;t see much chance that your developers or your code will be portable across different smartphones if you use C. Maybe you&#8217;ll get 5-10% savings that way (some code ported across phones, or some developer hours shuffled between platform teams). But you&#8217;d get a 5-10x cost saving from using something very modern and high-level instead of C, and the overhead of training for the language would be very very small as compared to the large and unavoidable overhead of having to learn what the handsets can do and how the APIs for the handset&#8217;s OS work.</p>
<p>I suppose that means that if you have a bunch of C developers who lack smartphone skills, you&#8217;re in a pickle, but that situation seems kind of unlikely to me (a mobile app company hires a bunch of Unix and Win32 C developers with no mobile phone skills?). More likely is that you&#8217;d find a mobile developer who is proficient with one or more handset OSs and the best tools for each one, and they may be of the opinion that C is the best choice since they can reuse skills and some code across platforms. I would say that in that case you need to convince them to (or more likely encourage them to do what they were already considering, which is to) go ahead and find a highly productive high level programming language/environment for each smartphone platform.</p>
<p>A final possibility if you have a ton of platforms to target and a pile of killer C programmers is to try and port something like Python across most of your target platforms, or to make a very high-level API or domain-specific language that runs inside your own custom C portability layer. You might be able to find an open source option that you can invest some developer hours in, so that the actual application-specific code that you write on each platform is minimized and portable. But I suspect that this would still be expensive and would result in some J2ME-like UI abstractions that ended up being very unsatisfying in the end.</p>
<p>Best of luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2007/08/19/j2me-write-once-be-disappointed-everywhere/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>
