<?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>scriptNode &#187; questions</title>
	<atom:link href="http://scriptnode.com/tag/questions/feed/" rel="self" type="application/rss+xml" />
	<link>http://scriptnode.com</link>
	<description>Tips and tricks for web developers.</description>
	<lastBuildDate>Tue, 01 Sep 2009 18:46:41 +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>Software Development Meme</title>
		<link>http://scriptnode.com/article/software-development-meme/</link>
		<comments>http://scriptnode.com/article/software-development-meme/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 23:50:21 +0000</pubDate>
		<dc:creator>Matt Hackett</dc:creator>
				<category><![CDATA[Novice]]></category>
		<category><![CDATA[careers]]></category>
		<category><![CDATA[interviews]]></category>
		<category><![CDATA[just-for-fun]]></category>
		<category><![CDATA[questions]]></category>

		<guid isPermaLink="false">http://scriptnode.com/?p=171</guid>
		<description><![CDATA[
I&#8217;ve been tagged by the insanely creative Jacob Seidelin, which means it&#8217;s my turn to fill out the Software Development Meme!

How old were you when you first started programming?
I was about 12 years old. That combined with my love of Nintendo really makes it sound like I never left the house, but I found time [...]]]></description>
			<content:encoded><![CDATA[<p>
I&#8217;ve been tagged by the insanely creative <a href="http://blog.nihilogic.dk/2008/09/software-development-meme.html">Jacob Seidelin</a>, which means it&#8217;s my turn to fill out the <strong>Software Development Meme</strong>!
</p>
<h3>How old were you when you first started programming?</h3>
<p>I was about 12 years old. That combined with my love of Nintendo really makes it sound like I never left the house, but I found time to play sports and get in trouble, really&#8230; &#8230;</p>
<h3>How did you get started in programming?</h3>
<p>A mysterious friend of mine (Jim MacDonald, who all but doesn&#8217;t exist online) and I used to play games all day, like <a href="http://www.rpgclassics.com/shrines/nes/dw1/">Dragon Warrior</a> and <a href="http://www.rpgclassics.com/shrines/genesis/shiningforce/">Shining Force</a>. Then one day he wondered how games were made, and found&#8230;</p>
<h3>What was your first language?</h3>
<p>QBASIC! This has gotta be the easiest language to learn, and that says a lot in an age where PHP exists. I think more developers would benefit from starting with this fantastically simple language.</p>
<h3>What was the first real program you wrote?</h3>
<p>I wrote a program I simply called <strong>Dragon</strong>, which was a direct ripoff of Jim&#8217;s game <strong>Wizard</strong> or something. It used QBASIC&#8217;s <code>DRAW</code> commands to draw shapes and <code>PLAY</code> for sound effects. It was a single-battle, turn-based game pitting you (a knight) against a dragon. It was amazingly bad but pretty fun (for 12-year-olds anyway).</p>
<h3>What languages have you used since you started programming?</h3>
<p><strong>Professionally:</strong> Only <a href="http://php.net/">PHP</a> and JavaScript</p>
<p><strong>For fun and/or school:</strong> BASIC, C, C++, Perl, Python, QBASIC, Turbo Pascal, Visual BASIC</p>
<h3>What was your first professional programming gig?</h3>
<p>Working for <a href="http://blog.davglass.com/">Dav Glass</a> at <a href="http://schoolcenter.com/">SchoolCenter</a>. I was a PHP programmer making a measly $10/hour coding content management tools for K-12 schools. I was quickly promoted to lead designer (odd, right?), then when the company realized we needed engineers more than designers, put back into the development department. About a year after <a href="http://yuiblog.com/blog/2007/03/29/yuiteam/">Dav moved to Yahoo!</a>, I followed.</p>
<h3>If you knew then what you know now, would you have started programming?</h3>
<p>Oh <strong>hell</strong> yes. I&#8217;m always trying to learn as much as I can. Learning new languages is fascinating, and learning more about what you already are familiar with to me should be a daily exercise. If I had had the knowledge I have now when I was younger, I can&#8217;t imagine what I would have built by now. Interesting to think about!</p>
<h3>If there is one thing you learned along the way that you would tell new developers, what would it be?</h3>
<p>In a normal curriculum in school, students are taught to read well before they are taught to write. I&#8217;m not sure why this isn&#8217;t the case in programming. You&#8217;ve always got these wannabe developers that try to run before they can walk, and they end up tripping. There&#8217;s no shame in beginning modestly.</p>
<p>I recommend to <strong>anyone of any</strong> programming level: read other people&#8217;s code. The Internet is the <strong>ideal</strong> place to learn.</p>
<h3>What’s the most fun you’ve ever had… programming?</h3>
<p>Everytime I learn a new language, my first task is to build a game. I&#8217;ve been doing this for over a decade, in every single language I&#8217;ve dabbled in. But I think it was the most fun in QBASIC. I built an intentionally awful game called <a href="http://seanbaby.com/readers/richter1.htm">Seanbaby&#8217;s Magic Bus Ride Trip</a> for you guessed it&#8230; <a href="http://seanbaby.com/">Seanbaby</a>. Working in <a href="http://paletteswap.com/misc/games/benzer/">Flash is really fun</a> too, but <a href="/lab/spacius/">nothing beats JavaScript</a>.</p>
<h3>Who’s next?</h3>
<p>Let&#8217;s go with <a href="http://foohack.com/">Isaac Schlueter</a>, since he&#8217;s a great writer and always has interesting things to say!</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptnode.com/article/software-development-meme/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Interview Questions Part 1: PHP</title>
		<link>http://scriptnode.com/article/interview-questions-part-1-php/</link>
		<comments>http://scriptnode.com/article/interview-questions-part-1-php/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 09:08:04 +0000</pubDate>
		<dc:creator>Matt Hackett</dc:creator>
				<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[careers]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[questions]]></category>

		<guid isPermaLink="false">http://scriptnode.com/?p=39</guid>
		<description><![CDATA[
I interview a lot of people. Sometimes for a specific task, and sometimes just because we need more engineering power. In the latter case, it&#8217;s
usually enough to be a good, experienced engineer in almost any language. But usually we&#8217;re hiring for a job heavy on one language or another, and it&#8217;s my job
to find out [...]]]></description>
			<content:encoded><![CDATA[<p>
I interview a lot of people. Sometimes for a specific task, and sometimes just because we need more engineering power. In the latter case, it&#8217;s<br />
usually enough to be a good, experienced engineer in almost any language. But usually we&#8217;re hiring for a job heavy on one language or another, and it&#8217;s my job<br />
to find out if the candidate is fluent.
</p>
<p>
This is the first part of many articles I&#8217;m going to write about common interview questions in the vague and mysterious world of web development.<br />
There are of course an almost infinite amount of questions one <strong>could</strong> be asked during an interview, but my questions are typically going to be<br />
more about syntax and semantics than the probably more revealing questions on algorithms and problem-solving.
</p>
<p>
Without further ado, here are some common questions engineers get asked to see if they understand the basic syntax of <a href="http://php.net/">PHP</a>.
</p>
<ul>
<li><a href="#q-1">What are the differences between single and double quotes?</a></li>
<li><a href="#q-2">What are the differences between <code>include()</code> and <code>require()</code>?</a></li>
<li><a href="#q-3">What does the <code>===</code> operator do?</a></li>
<li><a href="#q-4">What does <code>$$</code> signify?</a></li>
<li><a href="#q-5">What are the various ways to append to an index array?</a></li>
<li><a href="#q-6">How do you debug in PHP?</a></li>
<li><a href="#q-7">Create a class and extend it.</a></li>
</ul>
<p><a name="q-1"></a></p>
<h3><abbr title="Question">Q</abbr>: What are the differences between single and double quotes?</h3>
<p>
<strong><abbr title="Answer">A</abbr>:</strong><br />
The primary difference is that a string enclosed with double quotes is parsed. A string enclosed in single quotes is just a string literal.
</p>
<p><textarea class="php" cols="50" name="code" rows="10"><br />
var $foo = &#8216;bar&#8217;;</p>
<p>echo &#8216;The value of foo is: $foo&#8217;; // The value of foo is: $foo<br />
echo &#8220;The value of foo is: $foo&#8221;; // The value of foo is: bar<br />
</textarea></p>
<p><a name="q-2"></a></p>
<h3><abbr title="Question">Q</abbr>: What are the differences between <code>include()</code> and <code>require()</code>?</h3>
<p>
<strong><abbr title="Answer">A</abbr>:</strong><br />
The most prominent difference is that <code>require()</code> will throw an error if it fails to include the given file, and <code>include()</code> will not.
</p>
<p><a name="q-3"></a></p>
<h3><abbr title="Question">Q</abbr>: What does the <code>===</code> operator do?</h3>
<p>
<strong><abbr title="Answer">A</abbr>:</strong><br />
Triple equals checks for both value and type:
</p>
<p><textarea class="php" cols="50" name="code" rows="10"><br />
$foo = &#8216;bar&#8217;;<br />
$pos = strpos($foo, &#8216;b&#8217;);</p>
<p>if ($pos) {} // false: 0 is a falsy value<br />
if ($pos !== false) {} // true: 0 is not of the same type as false<br />
</textarea></p>
<p>
I like to ask if the engineer can think of an example (like the one above).<br />
It&#8217;s almost guaranteed that a programmer that has been developing in PHP for an extended period needed <code>===</code> before.
</p>
<p><a name="q-4"></a></p>
<h3><abbr title="Question">Q</abbr>: What does <code>$$</code> signify?</h3>
<p>
<strong><abbr title="Answer">A</abbr>:</strong><br />
Double dollar sign signifies a variable variable:
</p>
<p><textarea class="php" cols="50" name="code" rows="10"><br />
$color = &#8216;red&#8217;;<br />
$red = &#8216;#ff0000&#8242;;</p>
<p>echo $color; // red<br />
echo $$color; // #ff0000<br />
</textarea></p>
<p><a name="q-5"></a></p>
<h3><abbr title="Question">Q</abbr>: What are the various ways to append to an index array?</h3>
<p>
<strong><abbr title="Answer">A</abbr>:</strong><br />
[see code]
</p>
<p><textarea class="php" cols="50" name="code" rows="10"><br />
$my_array = array(1, 2, 3);</p>
<p>$my_array[] = 4;<br />
array_push($my_array, 5, 6);</p>
<p>$my_array[count($my_array)] = 7; // This is possible but dumb<br />
</textarea></p>
<p>
I like this question because it&#8217;s easy on the surface, and engineers will almost always get the first two. When I say there&#8217;s one more way, an engineer&#8217;s<br />
response is usually pretty revealing. Getting an answer like, &#8220;No there&#8217;s not,&#8221; shows (unearned) arrogance.<br />
Candidates that figure it out on their own show thinking on their feet.
</p>
<p><a name="q-6"></a></p>
<h3><abbr title="Question">Q</abbr>: How do you debug in PHP?</h3>
<p>
I think it&#8217;s probably most common for developers to use the quick-and-dirty <code>echo</code> statement. A better practice is to use <code>error_log</code><br />
or an external debugging library, because they won&#8217;t muck up the page and potentially cause other bugs.
</p>
<p><a name="q-7"></a></p>
<h3><abbr title="Question">Q</abbr>: Create a class and extend it.</h3>
<p>
Not really a question, but still important.<br />
I also ask about constructors and deconstructors, and make sure the candidate knows how to call the extended class&#8217;s constructor:
</p>
<p><textarea class="php" cols="50" name="code" rows="10"><br />
class Foo {<br />
	function __construct() {}<br />
	private function privateMethod() {}<br />
	public function publicMethod() {}<br />
}</p>
<p>class Bar extends Foo {<br />
	function __construct() {<br />
		parent::__construct();<br />
	}<br />
}<br />
</textarea></p>
<p>
I also like to ask if <code>public</code> is required (it&#8217;s not because it&#8217;s the default state), and make sure that the engineer knows about <code>protected</code><br />
as well.<br />
I like to have conversations about object-oriented programming rather than just asking syntax questions, because I&#8217;ve found it&#8217;s easier.
</p>
<p>
That&#8217;s it, really. These questions are just to see if an engineer is familiar with the surface of the language.<br />
It could be argued that PHP is simple and quick to learn, and that these questions would shine a positive light on someone who spent a few hours reading about<br />
PHP, and a negative light on experienced engineers who are fantastic but not very familiar with PHP.<br />
It&#8217;s a valid argument, but again, this is just to test PHP knowledge.
</p>
<p>
If you know any questions similar to these, I&#8217;d love to hear about them in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptnode.com/article/interview-questions-part-1-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
