<?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>Chaos Program &#187; programming</title>
	<atom:link href="http://www.chaosprg.com/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chaosprg.com/blog</link>
	<description>Without creativity, the universe would just be columns of numbers.</description>
	<lastBuildDate>Sun, 11 Jul 2010 20:10:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Horrible interview questions and the geeks who love them</title>
		<link>http://www.chaosprg.com/blog/2010/05/horrible-interview-questions-and-the-geeks-who-love-them/</link>
		<comments>http://www.chaosprg.com/blog/2010/05/horrible-interview-questions-and-the-geeks-who-love-them/#comments</comments>
		<pubDate>Sat, 22 May 2010 16:33:26 +0000</pubDate>
		<dc:creator>irv</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[management]]></category>

		<guid isPermaLink="false">http://www.chaosprg.com/blog/?p=371</guid>
		<description><![CDATA[<br />
<b>Warning</b>:  call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'Array' was given in <b>/home/irving1/chaosprg.com/blog/wp-includes/plugin.php</b> on line <b>166</b><br />
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.chaosprg.com%2Fblog%2F2010%2F05%2Fhorrible-interview-questions-and-the-geeks-who-love-them%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.chaosprg.com%2Fblog%2F2010%2F05%2Fhorrible-interview-questions-and-the-geeks-who-love-them%2F&amp;source=irvingprime&amp;style=compact" height="61" width="50" /><br />
			</a>
		</div>
<p>A while ago my boss and I had a discussion about how to interview candidates for a programming job. Not being a programmer himself, the boss wanted me to supply some good questions that would show depth of programming knowledge, especially Ruby on Rails, which is what our site (<a href="http://trailmeme.com">http://trailmeme.com</a> &#8211; tried it yet?) is built in. I think he was a bit surprised that I had very little interest in asking those kinds of questions. Once I explained myself, he was willing to trust my judgment (which is a nice thing to have in a boss). But he isn&#8217;t the first person to find my approach to interviewing candidates to be different from the norm. This tells me that the rest of the world is doing it wrong and there is need for me to explain some basic principles for the benefit of all those less enlightened than myself (for those who are humor impaired, just ignore the completely insincere self-aggrandizement in the previous sentence and move on).</p>
<p>I remember being interviewed for a position once where the interviewer asked questions straight out of What Color is Your Whatever that Silly Book Was? One of the questions was, &#8220;What would you say is your greatest weakness?&#8221; I decided this would be a bad time to mention my disrespect for people who ask questions like that. Instead, I made up a line about not thinking in terms of weakness, instead playing to my strengths. He liked that answer but didn&#8217;t hire me anyway. Maybe he thought I was trying to hide a deep disrespect for authority. More likely he found someone he could get for less money.</p>
<p>Anyway, this is lesson one: Don&#8217;t ask questions that encourage people to be less than completely forthcoming or honest. Sometimes that may be hard to avoid. &#8220;Why is there a 2 year gap in your education?&#8221; If the answer is, &#8220;I was on trial for murdering a professor but got off because he deserved it,&#8221; it is very unlikely the interviewee will actually explain this. On the other hand, who cares about a gap in education, or even in employment? You can read a lot of programming stuff while waiting for the jury to bring back a verdict.<br />
<span id="more-371"></span><br />
So what kinds of questions do I think are worth asking? I always ask programmers about the tools they use. What kind of IDE (for those readers who are not programmers, that&#8217;s a sort of programmer&#8217;s word processor), what version control. what favorite testing framework? I ask these things because a really great programmer doesn&#8217;t like to do extra work and good tools save work.</p>
<p>More importantly, I ask these questions because in ANY field, someone who has done it for a while and faced many different problems and types of conditions will develop opinions. A car mechanic might develop a preference for Chevys over Fords because the failure rate of some part, and the difficulty of replacing it, is unacceptable. Someone involved in developing commercial real estate might prefer working with a particular contractor over another because of the quality and timeliness of the work. The preferred contractor might prefer a particular building material over another for longevity or ease of installation or even for some completely irrational reason, like having once used that material on the same day the Yankees lost the series (it happens, trust me).</p>
<p>When you work with stuff, you naturally develop opinions about it. This may seem like a radical idea but I&#8217;ve found it to be very dependable. Humans are good at having opinions. In fact, people often have opinions without working with stuff. You can usually figure out who those are when you ask them why they hold an opinion. Someone who has worked with a language or an IDE or some software, will tell you horror stories about what they went through with other languages or packages. That is, they&#8217;ll describe their experience. Someone without experience will rarely be that specific, or that passionate. Worse, they might try to be fair and thoughtful.</p>
<p>I have a stock question that goes something like this: &#8220;Suppose I assigned you to develop a social networking type website. You own the project. You have complete control over the tools you use. Programming language. Operating system. Version control. Data structures. Everything. tell me a little about the things you&#8217;ll choose and why you choose them.&#8221;</p>
<p>My theory is that, even if the person makes choices I would not, if they have reasons for those choices, I can respect their opinion. So far, this theory has not been proved. I<em><strong> </strong>have</em> heard some pretty bad answers to the question. The worst one is the one where they try to seem professional and thoughtful. &#8220;I would choose whatever tools were appropriate for the client&#8217;s needs.&#8221; To me, this is another way of saying, &#8220;I have no idea and I&#8217;ll be damned if I&#8217;m going to commit myself to anything that you could maybe use against me.&#8221; This person will probably never be a good programmer. Programmers make decisions every day. Choosing to use some form of internal caching over a database is a decision that has far reaching consequences. if you don&#8217;t have the courage to make the decision, you&#8217;re going to hold up development while you try to get someone else to take time away from their own job to decide for you. [Note: I'm not claiming this is a perfect example of the idea. It's just an illustration]. Consultation is fine but you should have a preference and be able to express it or what good are you?</p>
<p>My questions seem to be better at getting bad answers than good ones but I find the bad answers very illuminating. If I ask what kind of IDE someone prefers and the answer is, &#8220;What&#8217;s an IDE?&#8221; That tells me I&#8217;m not dealing with a professional programmer. NEXT!</p>
<p>Try the alternative. If I ask, &#8220;How would you solve the n+1 query problem in Ruby on Rails?&#8221; It sounds like a good, solid, technical question. The trouble is that it can be answered after spending about 2 seconds with Google. (The answer is eager loading &#8230; usually. But it&#8217;s a job interview. If you give me a 20 minute answer going over all possible special cases I may worry that you&#8217;ve given it too much thought and really need a hobby). It&#8217;s also in all the books about Rails. It doesn&#8217;t tell me much about your skill level. (Though, again, someone who answers, &#8220;What&#8217;s that?&#8221; Has just flunked computer science 101 and might not get a lot more of my attention)</p>
<p>On the other hand, if I ask, &#8220;What do you use for version control&#8221; and the answer is, &#8220;At my last job we used SourceSafe&#8221; that tells me that you haven&#8217;t given a lot of thought to the question of version control but at least you know what it is. If, on the other hand, the answer is, &#8220;At my last job they used SourceSafe but I hate the locking model. For my own projects I use Git because there&#8217;s no problem with locks and branching and merging are almost effortless. Plus I can use it on the road when network connections are spotty&#8221; &#8211; this tells me that I&#8217;m talking to someone who has given actual thought to productivity. (Okay, actually you can get this answer from 5 minutes with Google. But you have to <em>want</em> to).</p>
<p>I guess the bottom line is that when I ask a question of a job candidate, I don&#8217;t want answers from a textbook. I&#8217;ve been interviewed myself when this was avoided by asking for a specific example of something I did on the job. I&#8217;ve usually been able to come up with answers. It&#8217;s not always easy. In  an interview situation where people may be nervous and even exhausted (ever been the 12th person to interview somebody who has been doing serial interviews all day long? Don&#8217;t expect coherent answers) that may be asking a bit much.</p>
<p>It&#8217;s also possible that I just like to torture people with unexpected questions. But they&#8217;re questions a pro should be able not just to answer but argue about. Arguing for your ideas is one of the basic skills needed for good teamwork. Hey! I never thought of that angle before. Maybe I&#8217;m on to something more interesting than torturing candidates after all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chaosprg.com/blog/2010/05/horrible-interview-questions-and-the-geeks-who-love-them/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Language In, Language Out</title>
		<link>http://www.chaosprg.com/blog/2010/01/language-in-language-out/</link>
		<comments>http://www.chaosprg.com/blog/2010/01/language-in-language-out/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 02:46:28 +0000</pubDate>
		<dc:creator>irv</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[geek stuff]]></category>
		<category><![CDATA[trailmeme]]></category>

		<guid isPermaLink="false">http://www.chaosprg.com/blog/?p=328</guid>
		<description><![CDATA[<br />
<b>Warning</b>:  call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'Array' was given in <b>/home/irving1/chaosprg.com/blog/wp-includes/plugin.php</b> on line <b>166</b><br />
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.chaosprg.com%2Fblog%2F2010%2F01%2Flanguage-in-language-out%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.chaosprg.com%2Fblog%2F2010%2F01%2Flanguage-in-language-out%2F&amp;source=irvingprime&amp;style=compact" height="61" width="50" /><br />
			</a>
		</div>
<p>I learned an interesting lesson at my job today.</p>
<p>Our team recently gained a member who is trained in user experience stuff, actual testing and measuring it, not just eyeballing it like me. During a couple meetings lately, we&#8217;ve discussed the language used on the web site. We&#8217;ve changed the terminology a couple times during the course of development as we thought of new implications and also as we struggled to describe the technology in ways that people who are new to it can understand. When you&#8217;ve been working on a project for a couple years, learning how to talk about it to people who are brand new to it can be a challenge.</p>
<p>What do you mean you don&#8217;t understand what a child node is? It&#8217;s a node directly linked by a default or alternate path from a parent! (Note: Never end this type of sentence with words like &#8220;dummy,&#8221; &#8220;idiot,&#8221; &#8220;moron&#8221; or anything similar. For some reason it doesn&#8217;t go over well.) (See <a href="http://en.wikipedia.org/wiki/Tree_%28data_structure%29">here</a> for a partial explanation of child node)</p>
<p>One result of the changes in terminology is that the web site is inconsistent. Sometimes it uses one term, sometimes an older one that is no longer approved. This might be because we forgot to change it or it might be because someone was writing stuff and forgot that we had changed the term. An attentive reader might be thinking, &#8220;Ah! So you learned you should thoroughly edit everything when you make changes, maybe even have copy written by a professional who will be focused on the words and not think of them as a distraction from the real job of hacking code!&#8221; This would be wrong. Nice try though.<br />
<span id="more-328"></span><br />
We figured out how to get to a better system, starting with having our new usability expert compile an approved dictionary for the web site and all the training materials. She&#8217;s not a technical person like the rest of us (mostly programmers. The boss is not a programmer, but he has a PhD in aeronautical engineering. He understands what a child node is) so she&#8217;s a good choice to repair some of the damage us tech geeks have done to the message.</p>
<p>No, that&#8217;s not the lesson either. It is VERY common for business development experts and all-wise columnists to explain that it is incredibly important for technical people to be able to &#8220;speak to non-technical business managers&#8221; or something like that. The conventional wisdom is that geeks only speak geek and if you can find one who can talk to regular people, you&#8217;ve struck gold. When I read this argument, I usually see Dilbert&#8217;s boss (in my head. I have not starting having such horrifying hallucinations yet) yelling, &#8220;Stop talking to me as if I have a brain! Use smaller words even if they don&#8217;t mean anything!&#8221;</p>
<p><strong>Note to Scott Adams</strong>: I don&#8217;t remember if you&#8217;ve written the particular exchange just described or not. There was a time when, if I laughed at it, I would have been sad at the same time because it was so close to my real life job. Now that I work for a genuine rocket scientist (see above), would you consider having another boss who actually tops Dilbert&#8217;s big words with even bigger and more incomprehensible ones (while still technically accurate) until one of their heads explodes? Just a thought.</p>
<p>Where was I? Oh yes! Today&#8217;s lesson was not about the difficulty of finding technical people who can communicate with the non-technical. That problem will go away by itself when the day comes that the non-technical can drink a potion or take a shot and finally learn some minimal amount of real math (a minimal amount being about how much I know. Real math knowledge would be more like what my boss knows).</p>
<p>There was a real lesson that came out of the language discussion, though. It was that, as we discussed terms that users of our web site should not be exposed to (such as &#8220;node&#8221;) I realized that we could not simply banish those words from out vocabulary <em>because we still needed them</em>. &#8220;Node&#8221; has a meaning. The day one of my colleagues on the project first declared &#8220;everything is a node&#8221; it was a breakthrough that made several developments since possible. Even easy. &#8220;Everything is a unit abstracting all types of structural elements&#8221; or &#8220;everything is one of those web page type thingies and other stuff that we work with&#8221; would not have had the same value.</p>
<p>Sometimes we look at technical language as being like a secret handshake; it&#8217;s just something the in crowd uses to distinguish themselves from the rest of the world. When doctor&#8217;s say &#8220;myocardial infarction&#8221; or when computer science students say, &#8220;It&#8217;s not a hacker. Hacker is an honorable term for someone who likes to fix broken code in creative and efficient ways. The correct term for someone who invades networked systems is cracker&#8221; it seems more like melodrama than technical accuracy.</p>
<p>But there still needs to be technical accuracy somewhere, doesn&#8217;t it? We figured out today that it isn&#8217;t just us. We have plans to open up at least some portion of our code to outside developers. Part of the project is already out there as open source for anyone who wants to get work with it. That was the lesson, or at least part of it. After we have a complete dictionary for how to communicate our ideas to end users, we will probably need another one for when we&#8217;re communicating to other technical people. Those outside developers need to understand that everything is a node. (For some reason that phrase always reminds me of the song &#8220;Everything is Food&#8221; from the Popeye movie that starred Robin Williams in possibly his last really funny role. Maybe it&#8217;s just me.)</p>
<p>Our lesson today was something along the lines of how technical accuracy has to be preserved, even though it doesn&#8217;t help us communicate with end users. We also talked about creating a mapping of one set of terms to the other (a geek to English dictionary, more or less). A way to communicate with the people who aren&#8217;t inside without losing the information we need. It&#8217;s surprisingly hard. I&#8217;ve never heard of a project having that sort of translation layer before, though it seems obvious once you think of it.</p>
<p>But how many centuries have doctors been doing without anything like that either? If I knew some medical terminology, I&#8217;ll bet I could make some money selling a dictionary like that.</p>
<ul>
<li>Myocardial: heart thing.</li>
<li>Infarction: ouchie.</li>
</ul>
<p><strong>Note</strong>: If you&#8217;re wondering what I do on my job that inspired this brilliant post, click the &#8220;trails&#8221; tab at the top of this page, or go to <a href="http://www.trailmeme.com">trailmeme.com</a>. There&#8217;s some cool web tech here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chaosprg.com/blog/2010/01/language-in-language-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better Living Through Happy Code</title>
		<link>http://www.chaosprg.com/blog/2009/09/better-living-through-happy-code/</link>
		<comments>http://www.chaosprg.com/blog/2009/09/better-living-through-happy-code/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 02:54:20 +0000</pubDate>
		<dc:creator>irv</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[geek stuff]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.chaosprg.com/blog/?p=235</guid>
		<description><![CDATA[<br />
<b>Warning</b>:  call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'Array' was given in <b>/home/irving1/chaosprg.com/blog/wp-includes/plugin.php</b> on line <b>166</b><br />
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.chaosprg.com%2Fblog%2F2009%2F09%2Fbetter-living-through-happy-code%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.chaosprg.com%2Fblog%2F2009%2F09%2Fbetter-living-through-happy-code%2F&amp;source=irvingprime&amp;style=compact" height="61" width="50" /><br />
			</a>
		</div>
<p>In my current employment I&#8217;m a website programmer. And a technology researcher and system administrator and probably a couple other things. But that&#8217;s not important right now. It&#8217;s the programming stuff that matters tonight. I have a big deadline coming up in a couple days and I&#8217;ve been putting in some extra hours and I&#8217;ve had something of an epiphany. It&#8217;s probably nothing new to other programmers but it is to me.</p>
<p><strong><em>We need more comment labels.</em></strong></p>
<p>It&#8217;s like this: Programmer&#8217;s make notes in the code we write. They&#8217;re called comments. There are certain commonly accepted prefixes that can start a comment &#8211; so commonly accepted that certain IDEs (for people who don&#8217;t know what that means, think of it as a window you type programs into) recognize them. Some IDEs will apply special highlighting to the labels so they are easy to see. This makes it simple to look at a file and find places where improvements need to be made.</p>
<p>The most common of these labels are TODO and FIXME. Here&#8217;s an example from one of my current projects:</p>
<p><span style="color: #008000;">#TODO: Move this function to the observer</span></p>
<p>For the record, I use TODO  a lot more often than FIXME. It would be nice to never use FIXME but sometimes there are other considerations than making every piece of code perfect. Like lunch. Or the demo that&#8217;s coming up in 15 minutes and the code had <em>better</em> be working (even if it&#8217;s not very pretty).<br />
<span id="more-235"></span><br />
One of the things I like about web developing with Ruby on Rails is that it comes with rake tasks that will go through the code and show you all of those notes. It recognizes the two I mentioned above, plus <em>optimize</em> (which I should use but I keep putting that stuff in as TODO. Bad habit) and even has an ability to look for custom ones.</p>
<p>That&#8217;s wonderful but not portable enough. The whole world recognizes TODO and FIXME. (At least, the whole English speaking world of programmers who read the same kind of reference materials I do). Custom tags, by definition, will be mostly only recognized by the individual or team that uses them. Especially for very large or distributed projects (like a lot of open source stuff), it would be better for the world to agree on an expanded vocabulary of meaningful tags.</p>
<p>I would humbly (or not) propose a few for consideration by the programming community.</p>
<ul>
<li><strong>SEC</strong> or <strong>SECURITY</strong> &#8212; meaning, there&#8217;s a hole here and if don&#8217;t fill it, you&#8217;ll have no one else but yourself to blame when you get hacked.</li>
<li><strong>REMEMBER</strong> &#8212; Use this for reasons why things are done in a particular way. Like <em>REMEMBER: The user&#8217;s are only allowed to do this on alternate Tuesdays.</em> It was trying to use this one that made me think we needed more.</li>
<li><strong>DTU</strong> (DRY This Up. Dry stands for &#8220;Don&#8217;t Repeat Yourself.&#8221; It&#8217;s a principle that makes code more efficient and easier to figure out and maintain. It can be carried too far but so can beer drinking. No, really! Trust me on this one.</li>
<li><strong>REQ</strong> or <strong>REQUIRED</strong> &#8212; As in &#8220;Don&#8217;t blame me. The boss  insisted I do it this way.&#8221;</li>
<li><strong>LEAVE</strong> &#8212; Use this for things people will be tempted to change or remove but something will break if they do.</li>
<li><strong>IDIOT</strong> &#8212; May be a comment directed at yourself or the person who wrote the code. Exclamation point optional. No further explanation is necessary.</li>
<li><strong>OHNO</strong> &#8212; Interchangeable with &#8220;I wish I hadn&#8217;t done it this way.&#8221;</li>
<li><strong>SMITW</strong> &#8212; &#8220;Shoot Me If This Works.&#8221; Counting how many times this one shows up per program (or per 1,000 lines of code) might give some interesting or even scary results. Guaranteed not to correlate in any meaningful way with bug reports.</li>
</ul>
<p>There. That&#8217;s a good start. I hope the programmers of the world find them useful. Oh! There&#8217;s one more that should probably go at the bottom of some blog posts, as well as in many programs:</p>
<ul>
<li><strong>WWT</strong> &#8212; &#8220;Written While Tired.&#8221; Not to be confused with WWD (Written While Drunk) which is assumed for anything written in Java and all college programming courses and it still isn&#8217;t a good enough excuse.</li>
</ul>
<p>Thanks for considering my suggestions. Pass them on and have a nice evening.</p>
<p>WWT.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chaosprg.com/blog/2009/09/better-living-through-happy-code/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
