<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
	<title>Comments for Behind The View</title>
	
	<link>http://www.behindtheview.com</link>
	<description>Development blog about PHP, coding and everything behind the view</description>
	<lastBuildDate>Tue, 22 Jun 2010 20:37:46 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/BehindTheViewComments" /><feedburner:info uri="behindtheviewcomments" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Comment on Multiprocessing part 1: Quick &amp; Dirty by dkrydie</title>
		<link>http://feedproxy.google.com/~r/BehindTheViewComments/~3/Rd7unXUQEFk/</link>
		<dc:creator>dkrydie</dc:creator>
		<pubDate>Tue, 22 Jun 2010 20:37:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.behindtheview.com/?p=158#comment-298</guid>
		<description>59hraG  &lt;a href="http://qpdfxbokqufk.com/" rel="nofollow"&gt;qpdfxbokqufk&lt;/a&gt;, [url=http://opstvoqzjwmk.com/]opstvoqzjwmk[/url], [link=http://pcobamujkbrg.com/]pcobamujkbrg[/link], http://hzawniydxzwt.com/</description>
		<content:encoded><![CDATA[<p>59hraG  <a href="http://qpdfxbokqufk.com/" rel="nofollow">qpdfxbokqufk</a>, [url=http://opstvoqzjwmk.com/]opstvoqzjwmk[/url], [link=http://pcobamujkbrg.com/]pcobamujkbrg[/link], <a href="http://hzawniydxzwt.com/" rel="nofollow">http://hzawniydxzwt.com/</a></p>
]]></content:encoded>
	<feedburner:origLink>http://www.behindtheview.com/2009/12/09/multiprocessing-part-1-quick-and-dirty/comment-page-1/#comment-298</feedburner:origLink></item>
	<item>
		<title>Comment on Multiprocessing part 1: Quick &amp; Dirty by how much should i weigh</title>
		<link>http://feedproxy.google.com/~r/BehindTheViewComments/~3/zFXJMrZm8Bo/</link>
		<dc:creator>how much should i weigh</dc:creator>
		<pubDate>Sat, 01 May 2010 15:50:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.behindtheview.com/?p=158#comment-231</guid>
		<description>lol nice story dude.</description>
		<content:encoded><![CDATA[<p>lol nice story dude.</p>
]]></content:encoded>
	<feedburner:origLink>http://www.behindtheview.com/2009/12/09/multiprocessing-part-1-quick-and-dirty/comment-page-1/#comment-231</feedburner:origLink></item>
	<item>
		<title>Comment on PHP, Hell or Heaven: Data types by Justin LeClair</title>
		<link>http://feedproxy.google.com/~r/BehindTheViewComments/~3/Miz1wABQ0HY/</link>
		<dc:creator>Justin LeClair</dc:creator>
		<pubDate>Fri, 30 Apr 2010 19:32:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.behindtheview.com/?p=144#comment-229</guid>
		<description>$a    = 'car'; // $a is a string
$a[0] = 'b';   // $a is still a string
echo $a;       // echos 'bar'

(string)"false" == (int)0 //evaluates to true.

This is why dynamic typing could be considered bad. However, assuming the developer knows the rules of the type juggling of a programming language, this rarely poses a problem, and provides a large degree of freedoms that would only be available via casts otherwise.

Not that forcing casts is a bad thing. Essentially, most scripting languages (PHP is a scripting language) check to see if the data type implied is the same as the data type saved when variable operations happen. If not, some sort of heuristics engine identifies what it is, and makes the cast. Normally, in C++ or any other static data type language, the user would specify the cast.

The issue here is that of speed, in which any scripted language is going to have issues with. Assigning a integer value to an integer variable is extremely fast in C++, because it doesn't bother to run through checking and casting, as that is checked compile time. In PHP, the same operation would be slower, as the engine has to actually check that the variable being assigned a value really is an integer variable. A further performance hit happens if it is, for example, a string, as the engine has to figure out what's being assigned, taking into account the context it's being assigned in and the value being assigned.

None of this prevents or encourages bad programming, in my opinion. A person having issues with type casting in C++ could just cast every variable in every situation to allow compile, but that's going to lead to horrible bugs and maintainability problems, not to mention a performance hit. You can suck at programming equally in PHP and C++.

All that said, the examples at the top could actually be time saving and useful. Replacing characters in a string by accessing the individual characters by array index can shorten code, producing what one may consider a more elegant solution. Also, evaluation of 0 to false is not necessarily uncommon, as other programming languages return '1' for true when a boolean is accessed as a string or integer, and '0' for false, so why shouldn't it work the other way? It's a matter of opinion, really.

In the end, you'll find that most scripting languages are made to be flexible with variables, pricing programmer productivity as more valuable than performance. This is usually a true fact, except in cases where performance is paramount, which generally has to do with media processing or heavy math, neither of which are usually handled in the domain of scripting languages.</description>
		<content:encoded><![CDATA[<p>$a    = &#8216;car&#8217;; // $a is a string<br />
$a[0] = &#8216;b&#8217;;   // $a is still a string<br />
echo $a;       // echos &#8216;bar&#8217;</p>
<p>(string)&#8221;false&#8221; == (int)0 //evaluates to true.</p>
<p>This is why dynamic typing could be considered bad. However, assuming the developer knows the rules of the type juggling of a programming language, this rarely poses a problem, and provides a large degree of freedoms that would only be available via casts otherwise.</p>
<p>Not that forcing casts is a bad thing. Essentially, most scripting languages (PHP is a scripting language) check to see if the data type implied is the same as the data type saved when variable operations happen. If not, some sort of heuristics engine identifies what it is, and makes the cast. Normally, in C++ or any other static data type language, the user would specify the cast.</p>
<p>The issue here is that of speed, in which any scripted language is going to have issues with. Assigning a integer value to an integer variable is extremely fast in C++, because it doesn&#8217;t bother to run through checking and casting, as that is checked compile time. In PHP, the same operation would be slower, as the engine has to actually check that the variable being assigned a value really is an integer variable. A further performance hit happens if it is, for example, a string, as the engine has to figure out what&#8217;s being assigned, taking into account the context it&#8217;s being assigned in and the value being assigned.</p>
<p>None of this prevents or encourages bad programming, in my opinion. A person having issues with type casting in C++ could just cast every variable in every situation to allow compile, but that&#8217;s going to lead to horrible bugs and maintainability problems, not to mention a performance hit. You can suck at programming equally in PHP and C++.</p>
<p>All that said, the examples at the top could actually be time saving and useful. Replacing characters in a string by accessing the individual characters by array index can shorten code, producing what one may consider a more elegant solution. Also, evaluation of 0 to false is not necessarily uncommon, as other programming languages return &#8216;1&#8242; for true when a boolean is accessed as a string or integer, and &#8216;0&#8242; for false, so why shouldn&#8217;t it work the other way? It&#8217;s a matter of opinion, really.</p>
<p>In the end, you&#8217;ll find that most scripting languages are made to be flexible with variables, pricing programmer productivity as more valuable than performance. This is usually a true fact, except in cases where performance is paramount, which generally has to do with media processing or heavy math, neither of which are usually handled in the domain of scripting languages.</p>
]]></content:encoded>
	<feedburner:origLink>http://www.behindtheview.com/2009/11/27/php-hell-or-heaven-data-types/comment-page-1/#comment-229</feedburner:origLink></item>
	<item>
		<title>Comment on Mai Ocean, a PHP bot server by fnqlulhaime</title>
		<link>http://feedproxy.google.com/~r/BehindTheViewComments/~3/LZqjn8LYQA8/</link>
		<dc:creator>fnqlulhaime</dc:creator>
		<pubDate>Wed, 27 Jan 2010 00:24:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.behindtheview.com/?p=103#comment-73</guid>
		<description>KzBMNr  &lt;a href="http://ngblhlrcpykg.com/" rel="nofollow"&gt;ngblhlrcpykg&lt;/a&gt;, [url=http://cnwohyccgieh.com/]cnwohyccgieh[/url], [link=http://xnqhkswcwuni.com/]xnqhkswcwuni[/link], http://nosabxjrenoq.com/</description>
		<content:encoded><![CDATA[<p>KzBMNr  <a href="http://ngblhlrcpykg.com/" rel="nofollow">ngblhlrcpykg</a>, [url=http://cnwohyccgieh.com/]cnwohyccgieh[/url], [link=http://xnqhkswcwuni.com/]xnqhkswcwuni[/link], <a href="http://nosabxjrenoq.com/" rel="nofollow">http://nosabxjrenoq.com/</a></p>
]]></content:encoded>
	<feedburner:origLink>http://www.behindtheview.com/2009/11/23/mai-ocean-a-php-bot-server/comment-page-1/#comment-73</feedburner:origLink></item>
	<item>
		<title>Comment on PHP, Hell or Heaven: Documentation by Wouter Bulten</title>
		<link>http://feedproxy.google.com/~r/BehindTheViewComments/~3/0uIkVJytzIg/</link>
		<dc:creator>Wouter Bulten</dc:creator>
		<pubDate>Sun, 06 Dec 2009 20:49:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.behindtheview.com/?p=152#comment-30</guid>
		<description>That's true but sometimes you learn cool things. Today I learned when you output:

\x07

The terminal beeps, how cool is that? ;)

(found here: http://www.php.net/manual/en/function.system.php)</description>
		<content:encoded><![CDATA[<p>That&#8217;s true but sometimes you learn cool things. Today I learned when you output:</p>
<p>\x07</p>
<p>The terminal beeps, how cool is that? <img src='http://www.behindtheview.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>(found here: <a href="http://www.php.net/manual/en/function.system.php)" rel="nofollow">http://www.php.net/manual/en/function.system.php)</a></p>
]]></content:encoded>
	<feedburner:origLink>http://www.behindtheview.com/2009/12/05/php-hell-or-heaven-documentation/comment-page-1/#comment-30</feedburner:origLink></item>
	<item>
		<title>Comment on PHP, Hell or Heaven: Documentation by Tomaž Muraus</title>
		<link>http://feedproxy.google.com/~r/BehindTheViewComments/~3/hPpTr6keSt0/</link>
		<dc:creator>Tomaž Muraus</dc:creator>
		<pubDate>Sun, 06 Dec 2009 11:58:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.behindtheview.com/?p=152#comment-29</guid>
		<description>I agree, PHP documentation is very clear and well-written.

User contributed notes can also sometimes come handy, but you should watch out because some of them contain bad information / practices.</description>
		<content:encoded><![CDATA[<p>I agree, PHP documentation is very clear and well-written.</p>
<p>User contributed notes can also sometimes come handy, but you should watch out because some of them contain bad information / practices.</p>
]]></content:encoded>
	<feedburner:origLink>http://www.behindtheview.com/2009/12/05/php-hell-or-heaven-documentation/comment-page-1/#comment-29</feedburner:origLink></item>
	<item>
		<title>Comment on Interesting topics by Wouter Bulten</title>
		<link>http://feedproxy.google.com/~r/BehindTheViewComments/~3/Vwj6ZQrt-hg/</link>
		<dc:creator>Wouter Bulten</dc:creator>
		<pubDate>Mon, 30 Nov 2009 21:26:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.behindtheview.com/?p=148#comment-28</guid>
		<description>Yeah, #4 is definately interesting. I am already using a technique to do that but I have also found some other interesting solutions to that 'challenge'.</description>
		<content:encoded><![CDATA[<p>Yeah, #4 is definately interesting. I am already using a technique to do that but I have also found some other interesting solutions to that &#8216;challenge&#8217;.</p>
]]></content:encoded>
	<feedburner:origLink>http://www.behindtheview.com/2009/11/29/interesting-topics/comment-page-1/#comment-28</feedburner:origLink></item>
	<item>
		<title>Comment on Interesting topics by David</title>
		<link>http://feedproxy.google.com/~r/BehindTheViewComments/~3/xDyQ38FY5Yc/</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sun, 29 Nov 2009 22:50:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.behindtheview.com/?p=148#comment-27</guid>
		<description>I'm interested at topic #4 and #6.</description>
		<content:encoded><![CDATA[<p>I&#8217;m interested at topic #4 and #6.</p>
]]></content:encoded>
	<feedburner:origLink>http://www.behindtheview.com/2009/11/29/interesting-topics/comment-page-1/#comment-27</feedburner:origLink></item>
	<item>
		<title>Comment on Mai Ocean, a PHP bot server by Interesting topics | Behind The View</title>
		<link>http://feedproxy.google.com/~r/BehindTheViewComments/~3/6Y3fRSrIsxA/</link>
		<dc:creator>Interesting topics | Behind The View</dc:creator>
		<pubDate>Sun, 29 Nov 2009 22:26:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.behindtheview.com/?p=103#comment-26</guid>
		<description>[...] (You may have noticed that I copied some from the Mai Ocean introduction post.) [...]</description>
		<content:encoded><![CDATA[<p>[...] (You may have noticed that I copied some from the Mai Ocean introduction post.) [...]</p>
]]></content:encoded>
	<feedburner:origLink>http://www.behindtheview.com/2009/11/23/mai-ocean-a-php-bot-server/comment-page-1/#comment-26</feedburner:origLink></item>
	<item>
		<title>Comment on PHP, Hell or Heaven: Data types by Wouter Bulten</title>
		<link>http://feedproxy.google.com/~r/BehindTheViewComments/~3/urjLuYM_NCE/</link>
		<dc:creator>Wouter Bulten</dc:creator>
		<pubDate>Sun, 29 Nov 2009 11:50:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.behindtheview.com/?p=144#comment-25</guid>
		<description>Writing something about PHP CLI is indeed a good idea. I tested compiling PHP but objects are not yet supported so it didn't work for me.

However, the newest version of PHP has a new functionality called PHAR files which can be used to 'compile' multiple files into one. The downside is that you still have to run that file through:

&gt; php file.phar

I'm going to gather some more resources about PHAR files and compiling and see what comes out ;)</description>
		<content:encoded><![CDATA[<p>Writing something about PHP CLI is indeed a good idea. I tested compiling PHP but objects are not yet supported so it didn&#8217;t work for me.</p>
<p>However, the newest version of PHP has a new functionality called PHAR files which can be used to &#8216;compile&#8217; multiple files into one. The downside is that you still have to run that file through:</p>
<p>> php file.phar</p>
<p>I&#8217;m going to gather some more resources about PHAR files and compiling and see what comes out <img src='http://www.behindtheview.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	<feedburner:origLink>http://www.behindtheview.com/2009/11/27/php-hell-or-heaven-data-types/comment-page-1/#comment-25</feedburner:origLink></item>
</channel>
</rss><!-- Dynamic page generated in 0.958 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-06-24 21:25:57 -->
