<?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>Stuff and Junk &#187; Rants</title>
	<atom:link href="http://www.zanfar.com/category/rants/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zanfar.com</link>
	<description>The Ramblings of an OCD Engineer</description>
	<lastBuildDate>Mon, 09 Jan 2012 23:08:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Turn Signals, Malloc, and the Arduino</title>
		<link>http://www.zanfar.com/2009/turn-signals-malloc-and-the-arduino/</link>
		<comments>http://www.zanfar.com/2009/turn-signals-malloc-and-the-arduino/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 09:52:40 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[anduinio]]></category>
		<category><![CDATA[malloc]]></category>
		<category><![CDATA[traffic]]></category>

		<guid isPermaLink="false">http://www.zanfar.com/?p=87</guid>
		<description><![CDATA[Late at night, while filtering the whole of the Internet through my fingers, I've identified a disturbing trend among those who would call themselves "roboticists" or "hardware hackers". Its a trend that, I believe, will soon bring about the end of the casual EE. Imagine a world not dissimilar from the one you know. Same [...]]]></description>
			<content:encoded><![CDATA[<p>Late at night, while filtering the whole of the Internet through my fingers, I've identified a disturbing trend among those who would call themselves "roboticists" or "hardware hackers". Its a trend that, I believe, will soon bring about the end of the casual EE.</p>
<p><span id="more-87"></span></p>
<p>Imagine a world not dissimilar from the one you know. Same styles, same social standards, same society. It looks, feels, and tastes exactly like the world you see when you walk out your front door, except for one small difference: the traffic laws have quadrupled. The right-of-way at a stop sign depends on the color and make of your car, not who arrived first. You must blink your turn signal four times before a turn, and seven before a U-turn. If you want to change lanes, blink twice, wait a full second, then twice more. You are only allowed to raise the volume of your stereo to 6dB above the ambient road noise, and you can only use your windshield washing spray if your view is obscured to less than 60% opacity.</p>
<p>Absurd, I know, but bear with me.</p>
<p>Because of all of these laws, you are required to get re-licensed to drive. It's a much more complicated test, and an astonishing 80% fail. One enterprising DMV employee decides that the test is simply too complicated for more than 20% of the population to understand, so he builds a simulator. The simulator operates just like your car, but it makes all those new rules easier. The turn signal blinks automatically, a voice tells you when it's your turn at a stop light, the windshield cleans itself when its dirty, and your radio volume is self-controlled.</p>
<p>This brings about an exciting new era in driving, suddenly hundreds of people can get their license! There are only a few additional rules you need to know, and everything else is just like before. Aunt Edna passed on her first try, and your club-hopping cousin, who has a cell phone glued to her ear, only takes seventeen attempts to pass. The DMV employee is lauded by the press for freeing the populace from the tyranny of government regulations.</p>
<p>Two days later, you get a call from your cousin: she's in jail and needs you to bail her out. Apparently, after twenty-seven unpaid traffic violations, the police issue a warrant. Aunt Edna was pulled over just yesterday for listening to Hanson's "MMMBop" too loud. In fact, you got a ticket this morning on the way to work because the barista forgot the cinnamon-jalapeno spread on your peach and raspberry bagel, so you made a U-turn, and blinked eight times.</p>
<p>Seems everyone is having these problems for some reason. Meanwhile, the 20% that passed the hard test are watching, and they're laughing.</p>
<p>At you.</p>
<p>They know the truth: as cool as the simulator is, as much as it feels like, tastes like, and smells like driving, it isn't driving. They know that its important to know how loud the road noise is, even if you don't usually turn your radio up that loud. They know that the real reason you use your blinker seven times while making a U-turn is so that the traffic cameras don't ticket you for running a red light. They know that using your windshield washer fluid before the 60% mark actually makes it worse. They know all this because they learned the real rules, the rules the real world is going to judge you by, not the simple rules the simulator uses so that you can get your license easier. It turns out, the devil is in the details, and to be a good driver, you need to know the details.</p>
<p>Now this is an absurd example, but you get my point: you can't play in the big leagues using minor league rules. Some rules are aggravating, some have no point, some are even completely inefficient and only got passed because a senator's son has a yellow fiat and never wants to wait at stop signs. The harsh reality, however, is that if you don't follow the rules, you'll get in trouble, and eventually, no one will ride with you.</p>
<p>This is what the incredible, exceptional world of hardware engineering has been reduced to.</p>
<p>I completely understand the draw of "computing platforms" like the Arduinio. I love the Lego Mindstorms, and they certainly have their place. But sticking two shields together and making your toilet tweet, is not the same as understanding the IP stack or chip-to-chip communication. And making a motion-detecting velociraptor is not the same as understanding sensor design or interrupt vector tables.</p>
<p>My ultimate point is that you don't really want to make your toilet tweet, you want to see if <em>you</em> can make your toilet tweet. The hobbyist community is all about self- and community-education, and if you ignore the rules, you aren't really learning anything.</p>
<p>I've taken quite a few programming classes, and there are two major pass/fail moments in each student's progress where you can tell fairly easily if they are going to cut the mustard. One is the concept of pointers, which tells you if they have the mental capacity for real programming, but to judge the heart of the programmer, ask them to build a stack using nothing but native types. Some will give up, "what do I need this for?" Some will complain that STL or Java already has a Stack class, "why do I need to build this when its already done?" But the true programmers will keep their head down and struggle mightily to produce working code. These students realize that the Stack isn't the point of the exercise. The point is to teach you that <em>you</em> can build a Stack. Granted, the chances of you using it again when someone else has one pre-built that also takes into account templating and inheritance is slim to none, but it taught you about dynamic memory allocation. And someday you're going to be able to laugh at a "programmer" who taught himself by reading Internet how-tos and is confused why adding  1000 elements to his stack takes so long. You'll laugh and tell him about the wonders of malloc, and how memory isn't flat or contiguous, and then hand him that Stack assignment you hated so much in college.</p>
<p>Sometimes the 80/20 rule actually works, and real-world problems are one example. Yeah, 80% of the time you'll be able to ignore most of those pesky rules, but as soon as you try to do something interesting, you'll need to know about traffic cameras and turn signal blink rates.</p>
<p>In closing, the Arduinio may seem like a great thing; for only a few dollars you can get an easy-to-use platform that makes rapid prototyping a breeze. But two projects later, after you've used your PS2 controller to blink LEDs, and changed the speed of a motor based on the humidity of the air, you're going to realize that there isn't a shield to do all the cool things you wanted to do when you started, and you don't know how to build a shield. And if you ask online for advice on building a touchscreen, you're going to get asked if its resistive, capacitive or inductive, and you're not going to know the answer, or why it even matters. Do yourself a favor and start at the bottom; learn why a stylus doesn't work on a capacitive screen. Its a bit more work at first, but you'll be well served by it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zanfar.com/2009/turn-signals-malloc-and-the-arduino/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How Not To Write</title>
		<link>http://www.zanfar.com/2009/how-not-to-write/</link>
		<comments>http://www.zanfar.com/2009/how-not-to-write/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 07:44:39 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[fiction]]></category>
		<category><![CDATA[mistakes]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://www.zanfar.com/?p=81</guid>
		<description><![CDATA[One of my favorite Internet pastimes is reading amateur short fiction. There are several writing sites around that let prospective authors find an inexpensive audience for their work. Someday I might be talented enough to write something both significant and meaningful, but for the time being, I can criticize those who are. In my reading, [...]]]></description>
			<content:encoded><![CDATA[<p>One of my favorite Internet pastimes is reading amateur short fiction. There are several writing sites around that let prospective authors find an inexpensive audience for their work. Someday I might be talented enough to write something both significant and meaningful, but for the time being, I can criticize those who are.</p>
<p><span id="more-81"></span></p>
<p>In my reading, I've come across some common mistakes. Not grammatical, which I can surprisingly ignore, but stylistic mistakes that instantly pull me out of the narrative. Here is a list of the most infamous.</p>
<p><strong>1. Don't write about what your story isn't about</strong></p>
<p>It sounds simple, but many new authors break this rule. A common theme in fiction is to place an otherwise normal character into an extraordinary situation. This involves some kind of life change, and most authors like to set this change up as the first part of their story. If you're doing this, remember, no one is going to care about what happened <em>before</em> the event, your story is about <em>after</em> it. If you must setup, do it briefly. A much better choice is to simply drop the reader into the middle of the story. They'll figure out the details as they go along. <em>In media res</em> worked for Homer, and it'll work for you.</p>
<p><strong>2. Your readers care about your characters, not you</strong></p>
<p>Another very common mistake is "name dropping" or using so much detail about a specific topic in your writing, that it is obvious to the reader that this topic is a favorite of the author's. This mistake has a very obvious exception: if the topic is the topic of the story, describe away, Crichton made a very good living writing technically researched fiction. However, I really don't care about the dual overhead cams in your protagonist's car when he's going to spend the rest of the novel stranded on a desert island.</p>
<p><strong>3. You will never own your characters, don't even try</strong></p>
<p>No matter how clear the picture of your characters is in your head, the reader will come up with their own, and it will be vastly different than yours. <em>Please</em> don't describe the physical appearance of your characters unless it has real value to the plot. There are only two ways this works out, either you describe them early, and your story reads like a bad personal ad, or you describe them late, and your readers start wondering when your lead female dyed her hair. Remember how disappointed you were with the casting of your favorite book-turned-film? Your readers will be too.</p>
<p><strong>4. Bows are boring<br />
</strong></p>
<p>Basic fiction: a protagonist has a problem and she solves it. Sometimes this takes a few tries, or even a few books, but every discrete story has a problem that gets solved. That is where the story ends. Don't write another word unless it leads to another problem, and don't stop until that next problem is solved. Ideally, this would be in a sequel. Don't frustrate your readers by forcing them through another 50 pages of fluff because you can't flesh out those last few ideas floating in your head. If you haven't sealed the deal by the time you walk her to the door, be polite, say goodnight, and leave. Twenty minutes of smalltalk is not going to change her mind.</p>
<p><strong>5. Even Jesus ended up on a cross</strong></p>
<p>Nobody likes perfect people. Perfect people have boring lives that remind everyone else of how not-perfect they are. If your protagonist doesn't have at least a few small and one large negative character traits, your plot will seem forced at best, and your story will have a very finite shelf life. This was important enough that the Greeks set aside an entire category of drama for the fatal flaw called <em>tragedies</em>, and they're way smarter than you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zanfar.com/2009/how-not-to-write/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>On the Virtues of Assembler</title>
		<link>http://www.zanfar.com/2009/the-virtues-of-assembler/</link>
		<comments>http://www.zanfar.com/2009/the-virtues-of-assembler/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 08:10:59 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[assembler]]></category>
		<category><![CDATA[pointers]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.zanfar.com/?p=56</guid>
		<description><![CDATA[I left the private sector in a large part because I was sick of writing code, it is ironic, although in hindsight, not surprising, that I am still surrounded by it. This situation has turned me mildly retrospective, and I've been trying to figure out when it was I finally got, I mean really, natively, [...]]]></description>
			<content:encoded><![CDATA[<p>I left the private sector in a large part because I was sick of writing code, it is ironic, although in hindsight, not surprising, that I am still surrounded by it. This situation has turned me mildly retrospective, and I've been trying to figure out when it was I finally got, I mean really, natively, understood pointers.</p>
<p><span id="more-56"></span></p>
<p>I'm a firm believer that the ability to play with pointers is a talent, not a skill. I don't think it can be taught. Sure, you can lecture on it, and I can get you to pass any multiple choice, fill in the blank, "knowledge of pointers" test, but I've found, and <a href="http://www.joelonsoftware.com/printerFriendly/articles/GuerrillaInterviewing3.html">smarter people agree</a>, that less than half of all people are able to juggle pointer abstraction in their head. I did most of my early programming in high level languages, and never really had to deal with pointers. I understood them, but it took a few seconds on every line of code to dissect it and make sure I was using them correctly.</p>
<p>I realized last week that I get it. Totally. And I blame Assembler.</p>
<p>If you were taught Assembler well, alongside a decent CPU structure course, Assembler is all about pointers. You just don't call them that. You'll learn about addressing, memory locations, address registers and the Program Counter, and you'll figure it out, because you <em>have</em> to figure it out, you can't abstract them away, and at the end of it, without realizing it, you'll have mastered pointers. Even the literals you use are contained in an instruction in a memory location pointed to by the Program Counter. <strong>Everything</strong> in Assembler is a pointer.</p>
<p>A lot of my peers don't understand why I tell them, if they're only taking a few programming courses, to take the lowest-level languages possible. This is the reason. The closer you are to the silicon, the more real examples you'll get about why you're told to do things a certain way. Don't understand what's so bad about strings? Parse one in assembler. You'll never forget it. Why can't you assume a flat address space? Address more than 256 bytes with an 8-bit processor in assembler, and you'll be intimately familiar with paging and banking. Very soon you'll realize the elegance of arrays, that they're not just native to your language (unless you're unlucky enough that they're objects instead), they're native to your processor, and the inner loop of</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>s<span style="color: #339933;">++</span> <span style="color: #339933;">=</span> <span style="color: #339933;">*</span>t<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>is probably a single CPU instruction<sup>[1]</sup>.</p>
<p>I love assembler. I get a rush when I can imagine exactly how the MCU is tossing bits around with every instruction. It's weird, I know, but if you're programming in any real capacity, you should love it to.</p>
<p>[1] On the 68k, it (should be) compiled to something like:</p>

<div class="wp_syntax"><div class="code"><pre class="asm" style="font-family:monospace;">strcpy<span style="color: #339933;">:</span>
  MOVE<span style="color: #339933;">.</span>b  <span style="color: #009900; font-weight: bold;">&#40;</span>A1<span style="color: #009900; font-weight: bold;">&#41;</span><span style="color: #339933;">+,</span> <span style="color: #009900; font-weight: bold;">&#40;</span>A2<span style="color: #009900; font-weight: bold;">&#41;</span><span style="color: #339933;">+</span>  <span style="color: #666666; font-style: italic;">; 14D9</span>
  CMPI<span style="color: #339933;">.</span>b  #<span style="color: #0000ff;">0</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">&#40;</span>A1<span style="color: #009900; font-weight: bold;">&#41;</span>       <span style="color: #666666; font-style: italic;">; 0C11 0000</span>
  BNE     strcpy        <span style="color: #666666; font-style: italic;">; 66F8</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.zanfar.com/2009/the-virtues-of-assembler/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Uselessness of Documentation</title>
		<link>http://www.zanfar.com/2009/the-uselessness-of-documentation/</link>
		<comments>http://www.zanfar.com/2009/the-uselessness-of-documentation/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 09:35:18 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[documentation]]></category>

		<guid isPermaLink="false">http://www.zanfar.com/?p=6</guid>
		<description><![CDATA[I've long been a fan of documentation, it was one of my favorite roles at Data Doctors, and no matter what employment I find, it seems I'm always documenting some procedure or standard. Documentation allows me to exercise both my interest in writing, and my OCD tendencies at the same time. However, I came to [...]]]></description>
			<content:encoded><![CDATA[<p>I've long been a fan of documentation, it was one of my favorite roles at Data Doctors, and no matter what employment I find, it seems I'm always documenting some procedure or standard. Documentation allows me to exercise both my interest in writing, and my OCD tendencies at the same time.</p>
<p>However, I came to a startling revelation today, and that is that documentation is, 90% of the time, worthless.</p>
<p><span id="more-6"></span></p>
<p>Now I work in an industry that relies on documentation. Without datasheets from semiconductor manufacturers, I would be out of a job, and an industry. So when I speak of documentation here, I'm referring to "explaining to people what they should do," or, procedural and standards documentation.</p>
<p>It started today at work. A number of us in the lab are working on design/layout projects simultaneously for the next revision of the <a href="http://wisardnet.nau.edu/">WiSARD</a>. Part of this is generating schematics that not only are correct, but are readable when printed, and have some sort of versioning or tracking information printed on them. In my world, this is usually done with a sheet template (see below).</p>
<div id="attachment_8" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-8" title="Circuit Schematic Title Block" src="http://www.zanfar.com/wp-content/uploads/2009/06/schematic-title-block-300x166.png" alt="Circuit Schematic Title Block" width="300" height="166" /><p class="wp-caption-text">Circuit Schematic Title Block</p></div>
<p>Now, I was the first to reach this stage in my project (I had the easier project) and when I needed to know what the lab's standards were for this, I simply looked up previous schematics, and made mine match as closely as possible using the tools available. There might have been some document in the repository that explained exactly how I was supposed to accomplish this task, but I didn't even look. I simply figured it out.</p>
<p>I ignored the documentation because I'm intelligent enough not to need it.</p>
<p>A few minutes later, Dan needed to do the same thing, and Kenji asked me to show him what I did. I spent the next 5 minutes looking over his shoulder, explaining step-by-step which options to check and buttons to press. On the way back to my desk, I realized that I could have simply handed him my schematic, and had him match it. It would have saved me about 4.5 minutes, and he would have easily figured it out.</p>
<p>Dan could have ignored the documentation because he's intelligent enough, but I forced him to use it, and it wasted us both time.</p>
<p>Later that evening, I was having lunch with a friend who is involved in my school's switch between webmail providers. One of the issues they're facing is how to educate students so that they can transfer their address book between products. After only a few minutes of conversation, we declared that it didn't matter, because the intelligent users are going to take the 15 seconds to <a href="http://www.google.com/#q=importing+contacts+into+gmail">Google the answer</a>, and the unintelligent ones aren't even going to try, they'll just call support.</p>
<p>The users who need the documentation, and can't figure it out on their own, aren't going to look for it. Any way you cut it, creating documentation is just a waste of time.</p>
<p>Now, this isn't a 100% rule, there are times, like component documentation, where you won't be able to sell your product without it. Other times, like in a reasearch or grant project, you will be required to document things. But in the cases where you have a choice, it's pretty much <a href="http://www.myscienceproject.org/j-wall.html">nailing Jello to the wall</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zanfar.com/2009/the-uselessness-of-documentation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

