<?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>Intrepid Blog &#187; phpavascript</title>
	<atom:link href="http://blog.affien.com/archives/tag/phpavascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.affien.com</link>
	<description>A few thoughts</description>
	<lastBuildDate>Mon, 01 Mar 2010 00:58:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHPavascript</title>
		<link>http://blog.affien.com/archives/2005/03/23/phpavascript/</link>
		<comments>http://blog.affien.com/archives/2005/03/23/phpavascript/#comments</comments>
		<pubDate>Wed, 23 Mar 2005 21:46:00 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[phpavascript]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2005/03/23/phpavascript/</guid>
		<description><![CDATA[Due to the recent hypes around Ajax and web development I&#8217;ve been thinking about a more effective method to write web applications running both on the server as on the client by writing code in just one environment and language instead of two: PHPavascript.
Having all kinds of fancy libraries to help you does help a [...]]]></description>
			<content:encoded><![CDATA[<p>Due to the recent hypes around Ajax and web development I&#8217;ve been thinking about a more effective method to write web applications running both on the server as on the client by writing code in just one environment and language instead of two: PHPavascript.</p>
<p>Having all kinds of fancy libraries to help you does help a lot; but you still got to manage transfering all data from the client and the server and back by hand; which espacially with javascript is quite tricky to do not only because it isn&#8217;t the easiest language to debug but also because every browser tends to do things a bit different with javascript.</p>
<p>It would be nice, I thought, to have a language for developing sererside and client side at the same time:</p>
<blockquote><pre style="font-size: larger">client TextBox mytextbox = TextBox.FromId("mytextbox");

int server function CalculateSum(first, second) {
  return first + second;
}

void client function ShowSum(first, second) {
  mytextbox.text = CalculateSum(first, second);
}

ShowSum(10,1000);</pre>
</blockquote>
<p>Basicly you mark a language entity to be either on the client or server side. The compiler would take care of the rest.</p>
<p>This would be really cool if it would be implemented but there would be quite a few issues:</p>
<ul>
<li>All client side functions and variables can be forged by the user; a naive programmer could put too much trust in functions on the client side</li>
<li>Synchronizing variables on server and client side and executing functions on server and client side could with a suffisticated algorithm be managed pretty decently although it would still create a lot of overhead when the programmer doesn&#8217;t pay attention on the usage of his function/variable location. Having hundreds of variable transfers for one page would be a lot, although very possible when a programmer doesn&#8217;t take care or the compiler is too dumb.</li>
<li>Language features available on the server side and only available on the client side with dirty hacks could be a bottleneck if the programmer doesnt take enough care. How to implement a mySQL connection for instance (not considering the fact that it wouldn&#8217;t be very safe in the first place)</li>
<li>etc</li>
</ul>
<p>Basicly it would be way easier to develop a web application but I don&#8217;t know what would be better: having a hard to handle situation as it is now where you are forced to think efficiently, or an easy to use environment as such a language could provide where everything works with the temptingness of not even thinking about what happens beneath the bonnet.</p>
<p>Although there still are these advantages:</p>
<ul>
<li>Vastly reduced development time</li>
<li>Highly maintainable code; a compiler could even create seperate javascript files for each specific browser and compile to the desired server side language</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2005/03/23/phpavascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
