<?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/"
	>

<channel>
	<title>Robert Marianski</title>
	<atom:link href="http://robmarianski.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://robmarianski.com</link>
	<description>Reflections on Software</description>
	<pubDate>Thu, 25 Dec 2008 04:56:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Beauty vs Practicality</title>
		<link>http://robmarianski.com/beauty-vs-practicality/</link>
		<comments>http://robmarianski.com/beauty-vs-practicality/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 04:56:44 +0000</pubDate>
		<dc:creator>rob</dc:creator>
		
		<category><![CDATA[perspectives]]></category>

		<guid isPermaLink="false">http://robmarianski.com/?p=235</guid>
		<description><![CDATA[We can see software development as a duality with beauty on one side, and practicality on the other. Beauty is coming up with a masterpiece of a solution. Practicality is solving our problems with methods that are known to work. These don&#8217;t have to be mutually exclusive, but they usually feel that way.
The advantage of [...]]]></description>
			<content:encoded><![CDATA[<p>We can see software development as a duality with beauty on one side, and practicality on the other. Beauty is coming up with a masterpiece of a solution. Practicality is solving our problems with methods that are known to work. These don&#8217;t have to be mutually exclusive, but they usually feel that way.</p>
<p>The advantage of the practical solution is that we know it will work. We&#8217;ve usually employed it in the past, and we&#8217;re confident with it. Examples of brute force methods come to mind, although they don&#8217;t necessarily have to be. The practical approach is particularly appealing to business, which almost without fail tries to avoid the worst possible scenario. Regardless though, we know we will end up with a working solution in a fixed amount of time, and not just with only scribbles on a whiteboard.</p>
<p>The problem with this is that things can get difficult to work with after a while. Like trying to find something on a messy desk, it&#8217;s always easier to quickly go through the mess. But if we repeat this several times, then it&#8217;s better to organize the desk appropriately first.</p>
<p>Finding an elegant solution can mean modeling our needs as a specific instance of a more general concept. We can also try to fit our needs into a pattern by thinking about them from a different perspective. Generally though, I think elegant solutions share the fact that they make our problems <strong>look simple</strong>.</p>
<p>Looking simple is key. When things are simple, we are able to have many more ideas freely dance about in our heads. Merely keeping complex ideas in our heads can be difficult, let alone finding ways to extend them. And at this rate, we can forget about debugging.</p>
<p>But beautiful solutions are more than just simple. They are a set of neat abstractions, naturally joined together. Each addition compounds on the previous, magnifying the strengths of the whole with a new dimension of power. This continues until the problem itself looks feeble in comparison, like it was created as a reaction to the solution.</p>
<p>Unfortunately, it&#8217;s difficult to create these problem slayers. Our problems usually hide in dark corners, only revealing themselves at inopportune moments. It&#8217;s only then that we realize that our methods are inadequate, and sometimes it can be hard to adapt them. It&#8217;s at this point that we often see the obviousness of our shortcomings. But of course, it&#8217;s always easier to predict the past than the future.</p>
<p>In the end then, we need a healthy mix of both beauty and practicality. We need to cultivate our magnificent visions, while listening to the sobering voice of reality. As Alan Kay said:<br />
<blockquote>Just play it grand.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://robmarianski.com/beauty-vs-practicality/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - language of the web</title>
		<link>http://robmarianski.com/php-language-of-the-web/</link>
		<comments>http://robmarianski.com/php-language-of-the-web/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 18:43:50 +0000</pubDate>
		<dc:creator>rob</dc:creator>
		
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://robmarianski.com/?p=224</guid>
		<description><![CDATA[Currently, php is the most popular language on the web, popular here meaning sheer numbers. There are number of reasons for this, some of them obvious in retrospect. But then again, a lot of things are obvious in retrospect.
Php is easy to get started with. I think this one most of all is the biggest [...]]]></description>
			<content:encoded><![CDATA[<p>Currently, php is the most popular language on the web, popular here meaning sheer numbers. There are number of reasons for this, some of them obvious in retrospect. But then again, a lot of things are obvious in retrospect.</p>
<p>Php is easy to get started with. I think this one most of all is the biggest reason for php&#8217;s popularity. In its simplest form, php is just a powerful templating language. We can take some html, sprinkle in a couple of php tags here and there, and presto, we have ourselves a dynamic page.</p>
<p>Php is easy to deploy. This almost goes hand in hand with php being easy to get started with. Most web servers are already php enabled, so chances are good that things will &#8220;just work&#8221; for us out of the box. If they don&#8217;t, php&#8217;s popularity virtually guarantees that the solution will be easily found online.</p>
<p>Updates are easy to see. All we have to do is save a file, and reload our browser. As a programmer, I can really appreciate this one, since I&#8217;m used to having to restart a process and waiting for it to come back up before I get feedback.</p>
<p>It&#8217;s easy to find somebody that understands php. I can say this for anything that&#8217;s really popular currently, so it&#8217;s not something that&#8217;s specific to php. What php has going for it here is that there is a low barrier to entry, making it easier for a programmer to quickly learn php without having any previous experience.</p>
<p>If I were to sum up php&#8217;s downside then, it would have to be its ability to scale in terms of complexity. Most changes are made in an ad-hoc manner, with little thought for the whole. With respect to systems, this is the wrong approach. We want the overall system to have a strong foundation, and have the individual pieces be the ones that take care of their own messes. Php emphasizes getting the individual pieces working, and they often have to know about each other&#8217;s internals.</p>
<p>For simple systems though, this doesn&#8217;t matter. If we&#8217;re just building a doghouse, we don&#8217;t need to spend the time thinking about having a strong core, because we won&#8217;t need one. If we just slab things together, it&#8217;ll hold. We only run into problems when we use this approach to build a skyscraper.</p>
<p>That being said, I think most sites on the web are simple. There&#8217;s a way to put new data in, a way to control what gets displayed, which could be through a search or not, and maybe a custom workflow for interacting with the data. It&#8217;s often the case that building up these small pieces from scratch is faster than trying to fit them into the context of a larger system.</p>
<p>Even for more complex systems, there is a benefit to prototyping a naive solution, and seeing where it breaks down. Sometimes it&#8217;s not where we expect, and this information becomes tremendously valuable when trying to design a more robust solution.</p>
<p>There are attempts to overcome php&#8217;s shortcomings too. There are many php based frameworks and content management systems out there. Each one of these makes certain separations for you, like MVC, to help ease the burden of maintenance.</p>
<p>There&#8217;s no denying that php does some things well. After all, millions of web sites can&#8217;t be wrong, right?</p>
]]></content:encoded>
			<wfw:commentRss>http://robmarianski.com/php-language-of-the-web/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Cost of Abstraction</title>
		<link>http://robmarianski.com/the-cost-of-abstraction/</link>
		<comments>http://robmarianski.com/the-cost-of-abstraction/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 03:49:35 +0000</pubDate>
		<dc:creator>rob</dc:creator>
		
		<category><![CDATA[perspectives]]></category>

		<guid isPermaLink="false">http://robmarianski.com/?p=190</guid>
		<description><![CDATA[Most programmers follow a progression as their skills improve.
Initially, we have a just make it work mentality. In this phase, there is no structure or attempt at creating any abstractions. If functionality needs to be duplicated in a slightly different fashion, the lines of code get duplicated. We happily trudge along in this phase until [...]]]></description>
			<content:encoded><![CDATA[<p>Most programmers follow a progression as their skills improve.</p>
<p>Initially, we have a just make it work mentality. In this phase, there is no structure or attempt at creating any abstractions. If functionality needs to be duplicated in a slightly different fashion, the lines of code get duplicated. We happily trudge along in this phase until we are met with a project of significant complexity. Here we start to break down, and quickly learn that it becomes difficult to maintain.</p>
<p>In the next phase, which I like to call &#8220;abstraction envy&#8221;, we start to learn the different ways we can architect our applications. We begin to learn the different designs, structures, and patterns that we can use to ease the burden of maintaining applications. As we learn more and more patterns however, we try to apply our newly found knowledge as widely as possible. Given that this is still a learning process, and much of programming is learned by doing, we often pick the wrong <a href="http://robmarianski.com/best-tools-for-the-job/">tool for the job</a>. To use the popular metaphor, we use a hammer, but we&#8217;re not hitting a nail. We slowly start to learn that their are some downsides to these patterns as well, and just because we understand them doesn&#8217;t mean we should use them. If a little is good, that doesn&#8217;t mean that a lot is better.</p>
<p>This next phase I&#8217;m about to describe is the middle ground between the first two. This ideal phase is essentially a zen state of programming. Abstractions are only used when they are necessary. And the abstractions introduced are not just for code reuse, but they create simple, yet powerful ways of thinking about our problems. These types of abstractions are more useful because they more closely match the conceptual, or real problems. You&#8217;ll know when you see one of these because it&#8217;ll seem like the problem was created for the abstraction instead of the other way around. Besides creating perfect abstractions for the parts of the application that need them, the flip side is just as important, if not more so. Abstractions are <strong>not</strong> created for the parts of the application that don&#8217;t need them. Simple things are left simple, and complicated things are possible.</p>
<p>I think most programmers are in the middle state. If you ask a programmer his advice on a particular problem, you&#8217;ll probably get an answer, and you&#8217;ll probably get a lot more information about other problems that get created along the way. Sometimes these problems themselves require complicated solutions, and then these problems cascade.</p>
<p>That brings us to the heart of the problem really. Simple things should be easy to change. If they&#8217;re not, something is wrong. But none of us writes code with the idea that we&#8217;re making certain things harder. We always believe that we&#8217;re improving things. We see some boilerplate, and we think to ourselves, gee, wouldn&#8217;t it be great if we didn&#8217;t have to do that all the time? Let&#8217;s find a way to eliminate it. We move along happily, proud of how much code we&#8217;ve reduced. The problem lies in the future, when we&#8217;re thrown a curve ball. It doesn&#8217;t fit in our strike zone, but we&#8217;ve got to hit a home run anyway. We look at the code, and we realize that it would have been a whole lot easier to do if we didn&#8217;t have to deal with those abstractions we added in earlier. We&#8217;ll have to modify them significantly to make the new problem fit. In other words, the <a title="law of leaky abstractions" href="http://www.joelonsoftware.com/articles/LeakyAbstractions.html">abstraction leaks</a>, because we now have to understand the implementation.</p>
<p>And now we&#8217;re faced with a tough decision. Do we make these modifications - modifications is a good word for this, it&#8217;s usually a hack - or do we scrap them and go for a simpler approach. The hacks are usually easier and we feel more confident that they&#8217;ll work, but they increase the entropy of the system which will make it harder for us to maintain. A bigger <a title="analysis of refactoring" href="http://robmarianski.com/cleaning-up/">cleanup</a> will take more time and is riskier, but is probably a good long term investment in some cases. Unit tests will help in this case, but like good abstractions, I find that it&#8217;s just as hard to write or find tests at the right abstraction level to pull this off.</p>
<p>So how can we avoid getting ourselves into a mess like this in the future? I think the real answer is that we have to get ourselves tangled into a few webs of anarchy before we can learn how to avoid them. But in an attempt to answer the question, instead of erring on the side of introducing abstractions, we can err on the side of leaving them out. Simpler code is usually easier to modify, although that&#8217;s not true for large pieces of spaghetti where a few well placed abstractions trim out a lot of the complexity. But my personal opinion is that it&#8217;s usually easier - and more fun - to add in additional layers of abstractions rather than break free from existing ones. It also feels safer.</p>
<p>But perhaps what should guide us the most in these ambiguous cases is the <a title="surprise!" href="http://en.wikipedia.org/wiki/Principle_of_least_astonishment">principle of least astonishment</a>. If the presence of a particular abstraction is surprising, then it probably shouldn&#8217;t be in there. Another good question to ask ourselves is if the new abstraction actually makes things simpler. If the code is easier to understand with the abstraction, awesome. If it&#8217;s a puzzle to figure out what is going on, and it&#8217;s just there to save on lines of code, change it.</p>
<blockquote><p>It&#8217;s easy to make things. It&#8217;s hard to make things simple</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://robmarianski.com/the-cost-of-abstraction/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Master and the Apprentice</title>
		<link>http://robmarianski.com/the-master-and-the-apprentice/</link>
		<comments>http://robmarianski.com/the-master-and-the-apprentice/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 02:44:16 +0000</pubDate>
		<dc:creator>rob</dc:creator>
		
		<category><![CDATA[approaches]]></category>

		<guid isPermaLink="false">http://robmarianski.com/?p=110</guid>
		<description><![CDATA[Always two there are, a master and an apprentice
When learning a trade, the master/apprentice relationship can be tremendously useful. It is a slow path, but an effective one. It&#8217;s a great way to pass on the lessons from the past.
And not only is the knowledge of skills passed on to future generations, so is the [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Always two there are, a master and an apprentice</p></blockquote>
<p>When learning a trade, the master/apprentice relationship can be tremendously useful. It is a slow path, but an effective one. It&#8217;s a great way to pass on the lessons from the past.</p>
<p>And not only is the knowledge of skills passed on to future generations, so is the knowledge of common pitfalls. As an apprentice begins to make mistakes, the master can correct them immediately, potentially avoiding much of the headache associated with recovering from the error. And we all know that the earlier an error can be recovered from, the smaller the consequences.</p>
<p>However, you don&#8217;t see very much of this in the programming world. I think there are a few reasons for this.</p>
<p>1. Being self taught is encouraged. If you can learn yourself just by rtfm, then you haven&#8217;t wasted anybody else&#8217;s time.<br />
2. Programmers all think that they can solve the problem better themselves.<br />
3. There tends to be a high turnover in the programming industry.</p>
<p>But then, each generation is doomed to repeating the same mistakes. And with programming, it&#8217;s difficult to know when you&#8217;re making a mistake. But, a master can point this out right away, and correct it before it becomes a major problem. This can save an enormous amount of time, and greatly speed up the learning process.</p>
<p>Programmers, and those expecting programming based solutions, are usually impatient. There&#8217;s enormous pressure to release the next best thing yesterday. The programming field also changes rapidly, and it will probably continue to change at an even faster rate in the future. It should be no surprise then that programmers are in a rush.</p>
<p>But the flip side is that it takes a while to become a great programmer. We really need to experience many failures before we can identify how to architect successes. And contrary to popular belief, it takes <a title="programming takes time" href="http://norvig.com/21-days.html">years</a> to become proficient.</p>
<p>If there are no silver bullets, then I think that encouraging master/apprentice relationships can help propel us as a whole in the right direction faster.</p>
]]></content:encoded>
			<wfw:commentRss>http://robmarianski.com/the-master-and-the-apprentice/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Command Line</title>
		<link>http://robmarianski.com/command-line/</link>
		<comments>http://robmarianski.com/command-line/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 22:19:44 +0000</pubDate>
		<dc:creator>rob</dc:creator>
		
		<category><![CDATA[perspectives]]></category>

		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://robmarianski.com/?p=142</guid>
		<description><![CDATA[It&#8217;s interesting to hear so many different opinions on the command line. Many see it as archaic. Others are scared of it. And then there&#8217;s a few who prefer it to all other interfaces. But regardless of how you feel about it, there&#8217;s no denying that it&#8217;s here to stay, at least for the near [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s interesting to hear so many different opinions on the command line. Many see it as archaic. Others are scared of it. And then there&#8217;s a few who prefer it to all other interfaces. But regardless of how you feel about it, there&#8217;s no denying that it&#8217;s here to stay, at least for the near future.</p>
<p>I&#8217;ve mentioned earlier that interacting with a computer can be likened to <a title="Programming is Communication" href="http://robmarianski.com/programming-is-communication/">communicating</a> with it. We usually &#8220;speak&#8221; to it in the physical sense through a keyboard or mouse. On the virtual or software side of things, the most popular interfaces are either through the command line, or a gui (<a title="Menus are for restaurants" href="http://en.wikipedia.org/wiki/WIMP_(computing)">wimp</a> interface).</p>
<p>Command line interfaces allow for more direct communication with the computer. You type words that you want the computer to execute, and it returns the response. Going through a gui is like talking to an interpreter first, and then having the interpreter relay the information. This can be more useful if the interpreter can figure out what you mean and make a more informed request to the computer. But for informed users, interpreters just get in the way.</p>
<p>Where I think the command line really shines is its flexibility. At a moment&#8217;s notice, you have access to virtually anything, all through a single interface. You have access to a large, powerful set of tools that can be widely used with one another. For example, what if I wanted to count the number of files in a directory that had an odd number of lines in them? That were edited in the last week. And have those sent out in an email. Biweekly. Granted, that&#8217;s a contrived example off the top of my head, but one that is virtually effortless to accomplish from the command line, yet difficult with a gui that wasn&#8217;t designed specifically for that.</p>
<p>Another useful feature of the command line is its inherent repeatability. Once a command has been run, it can be recalled, executed as is, or executed with slight variations, all with little effort. This is true for sequences of commands as well. And, if the sequences themselves start repeating in sequence, then they can be moved to a shellscript or function and run with a single command. In this way, the command line allows for the user to create new language that is better suited for the problem, in a <a title="Bottom up programming" href="http://www.paulgraham.com/progbot.html">bottom up</a> approach.</p>
<p>Guis have their place too though. The knowledge required is usually much lower to start being effective with an application. And guis are a better fit to solve visual problems. It&#8217;s much easier to work with a wysiwyg type app when you&#8217;re producing a new design, rather than having to perform transforms with commands and then redisplaying.</p>
<p>But I think the audience is what makes the biggest difference. Programmers, and &#8220;expert users&#8221; have a tendency to prefer command line tools. Novice users are usually afraid of having something go wrong, and find comfort with gui applications. And for the die hard gui guys, all you have to do is tell them:</p>
<blockquote><p>Smith and Wesson was the original point and click interface</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://robmarianski.com/command-line/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Programming is Communication</title>
		<link>http://robmarianski.com/programming-is-communication/</link>
		<comments>http://robmarianski.com/programming-is-communication/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 04:45:51 +0000</pubDate>
		<dc:creator>rob</dc:creator>
		
		<category><![CDATA[perspectives]]></category>

		<guid isPermaLink="false">http://robmarianski.com/?p=162</guid>
		<description><![CDATA[Programming is really just another form of communication. We type in some code, tell the computer that we&#8217;ve got some stuff for it to read, and then it gives us back a response when we run it. The write, compile, run feedback loop is like having a conversation with the computer.
Generalizing a little bit, using [...]]]></description>
			<content:encoded><![CDATA[<p>Programming is really just another form of communication. We type in some code, tell the computer that we&#8217;ve got some stuff for it to read, and then it gives us back a response when we run it. The write, compile, run feedback loop is like having a conversation with the computer.</p>
<p>Generalizing a little bit, using a computer itself is a form of communication. We put some input into the computer, whether we type something in, or use a mouse or some other device. Then the computer responds back to us. It can also work the other way too. The computer can prompt us for action, usually after a particular event occurs. For example, we can have a msgbox alert us of new mail as it arrives.</p>
<p>Thinking about it from a conversational perspective, our interactions with the computer become more effective if we can better articulate what we are trying to do. If we can phrase a question, or a particular action in a more effective manner, then it&#8217;s more likely that we&#8217;ll get a good response back from our computers. Usually, the whole trick comes down to saying the right thing.</p>
<p>And as programmers, the choice of programming language is really just that. It&#8217;s how we choose to describe our application to the computer. Seen from this light, <a title="Succinctness is Power" href="http://www.paulgraham.com/power.html">arguments</a> have been made that if you&#8217;re able to express yourself in fewer words, then you&#8217;re using a better language for the job. It also follows the language parallel in that certain languages have many more words for a particular concept, each with a slightly different meaning. These languages are adept at expressing the subtle variations of this concept. And if a language doesn&#8217;t have a word for a concept, then chances are it doesn&#8217;t know how to express it effectively either.</p>
<p>Programmers generally get a bad rap about being poor communicators. But, if programming is just a form of communication, can this be true? I&#8217;d argue no. The best programmers turn out to be effective communicators too. They really <em>are</em> able to express their points in a clear, concise way. After all, they&#8217;re used to writing clear, concise code.</p>
]]></content:encoded>
			<wfw:commentRss>http://robmarianski.com/programming-is-communication/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Quantity vs Quality</title>
		<link>http://robmarianski.com/quantity-vs-quality/</link>
		<comments>http://robmarianski.com/quantity-vs-quality/#comments</comments>
		<pubDate>Sun, 14 Sep 2008 06:28:23 +0000</pubDate>
		<dc:creator>rob</dc:creator>
		
		<category><![CDATA[perspectives]]></category>

		<guid isPermaLink="false">http://robmarianski.com/?p=102</guid>
		<description><![CDATA[When discussing whether quality is more important than quantity in programming circles, quality will often be cited as the clear winner. The argument is that focusing on quantity only ends up hurting us in the long run. Sacrificing quality usually means taking so called &#8220;shortcuts&#8221;, which can lead to headaches in the future. When the [...]]]></description>
			<content:encoded><![CDATA[<p>When discussing whether quality is more important than quantity in programming circles, quality will often be cited as the clear winner. The argument is that focusing on quantity only ends up hurting us in the long run. Sacrificing quality usually means taking so called &#8220;shortcuts&#8221;, which can lead to headaches in the future. When the shortcuts turn into dead ends, we end up having to take detours to get around them.</p>
<p>But does focusing completely on quality necessarily improve it? We try to justify spending more time improving quality by saying that once it&#8217;s done the right way, the problem is less likely to resurface in other ways. In other words, we&#8217;re spending more time on it now so that we don&#8217;t have to in the future. But what does it actually mean to concentrate on the quality of the application? Just because I try to anticipate future uses of the code, or remove all duplication, or try to document what I&#8217;m doing doesn&#8217;t necessarily mean the code is of higher quality. If there are known bugs and I eliminate those, I haven&#8217;t necessarily raised the bar quality-wise. I could have introduced other defects as side effects, or some security or performance issues. I can spend more time writing tests, but again, I haven&#8217;t improved the quality of the code here.</p>
<p>I&#8217;m not going to make an attempt to define software quality myself. I only wanted to point out that it&#8217;s not completely obvious, and <a title="Refactoring" href="http://robmarianski.com/cleaning-up/">refactoring</a> has its own risks. Instead, I&#8217;ll summarize an interesting story I came across <a title="Quantity vs Qualitly" href="http://www.codinghorror.com/blog/archives/001160.html">here</a>.</p>
<p>In a ceramics class, half of the students were graded completely on quantity of work produced. The other half was graded completely on quality. You&#8217;d think that the quantity students would produce tons of sub par work, while the quality students would produce one amazing work. I did anyway.</p>
<p>I was wrong. The quantity group in fact ended up producing works of higher quality. They were able to learn from their own mistakes. The quality group, while coming up with sound theoretical works, failed to deliver.</p>
<p>This sounds <a title="programming as more art than science" href="http://robmarianski.com/programming-is-more-art-than-science/">very similar</a> to programming. And unless you&#8217;re <a title="My hero" href="http://www.multicians.org/andre.html">this guy</a>, it usually takes a few iterations to get something right.</p>
<p>We tend to learn more effectively through our own mistakes. Just like parents will let their children make their own mistakes, programmers learn to avoid pitfalls by first falling into them. The better programmers are the ones that write more code.</p>
]]></content:encoded>
			<wfw:commentRss>http://robmarianski.com/quantity-vs-quality/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Programming is More Art than Science</title>
		<link>http://robmarianski.com/programming-is-more-art-than-science/</link>
		<comments>http://robmarianski.com/programming-is-more-art-than-science/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 05:19:09 +0000</pubDate>
		<dc:creator>rob</dc:creator>
		
		<category><![CDATA[perspectives]]></category>

		<guid isPermaLink="false">http://robmarianski.com/?p=44</guid>
		<description><![CDATA[You come to nature with all her theories, and she knocks them all flat. -Renoir
Computer science is a misnomer. There is no series of steps to follow that will lead to a great application. There is no methodology that guarantees success. The science that we do have is what I would call &#8220;low level&#8221;. We [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>You come to nature with all her theories, and she knocks them all flat. -Renoir</p></blockquote>
<p>Computer science is a misnomer. There is no series of steps to follow that will lead to a great application. There is no methodology that guarantees success. The science that we do have is what I would call &#8220;low level&#8221;. We can prove that the running speed of <a title="Quicksort Algorithm" href="http://en.wikipedia.org/wiki/Quicksort">quicksort</a> is n log n for the average case. We can find the maximum of a set of numbers in n time. But I can&#8217;t prove that my web application is not going to crash.</p>
<p>What makes the software engineering discipline so different from the other engineering disciplines is that absolutely <strong>all</strong> of the work happens in the design phase. When designing a building, coming up with the blueprints is just the first step. But with programming, the blueprints are everything. Naturally, I mean extremely detailed blueprints. That&#8217;s really what a program is though, right? It&#8217;s just a set of detailed instructions that the computer executes for us. When we&#8217;re creating a building, the building is done when it&#8217;s built. When creating an application, it&#8217;s done when we&#8217;ve come up with the all of the instructions needed. It&#8217;s one more step removed. That&#8217;s why when we&#8217;ve created one copy of an application, it&#8217;s trivial to create n copies.</p>
<p>Anyway, we slowly learn that there is no magic formula to write an effective application. There are guidelines, principles, best practices, but in the end, following all the rules doesn&#8217;t guarantee a masterpiece.</p>
<p>This sounds a lot like the difficulties faced when trying to create a bestselling novel. There are guidelines, and patterns for plot developemnt that have worked well. But in the end, you can follow all the best practices that are out there, and still not come up with a masterpiece.</p>
<p>I know I&#8217;m making it sound like the both of these are very hit and miss. This is not true. Great authors consistently produce great works. Great programmers also consistently produce great applications. While it&#8217;s hard to define what makes the works great, it&#8217;s usually much easier to recognize. What&#8217;s more is that most programmers can agree on who the great programmers are, yet when asked to quantify why, it&#8217;s not easy to come up with an answer. We can all recognize it, but <a title="It's downright impossible to measure productivity" href="http://robmarianski.com/game-of-insight">measuring</a> it is difficult.</p>
<p>Universities however, teach programming from a much more scientific point of view. We&#8217;re taught the fundamentals, big O notation, operating system concepts, basic software engineering and process, and things along those lines. Yet it&#8217;s rare to find a university (at least I haven&#8217;t come across one) that studies the great masterpieces of programming. Or one that takes the worst of programming, and criticizes it.</p>
<p>I think that this scientific approach to teaching programming is fundamentally wrong. We should be taking the hint from the liberal arts schools. They all study the great works of the past, which are endlessly discussed, analyzed, and criticized to great detail. Various writing techniques are dissected, and emulated. Students are encouraged to stray from the path, to <a href="http://robmarianski.com/cleaning-up/">explore</a>.</p>
<p>Maybe the reason why universities take this approach is that most past software has been closed source. It&#8217;s only fairly recently that open source has exploded in a very big way. But that&#8217;s slowly changing. More and more open source software is getting written, and at a faster and faster pace.</p>
<p>But what I&#8217;m seeing happen is that we don&#8217;t have to wait for the universities. We as programmers are coming up with our own ways to learn more effectively. After all, we control what software gets written, so a lot of it is geared towards making our own lives easier. This also includes learning from others, and coming up with better ways of sharing and connecting information. It&#8217;s this trend, which seems to indicate that we&#8217;re getting better faster, that leaves me hopeful for the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://robmarianski.com/programming-is-more-art-than-science/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Game of Insight</title>
		<link>http://robmarianski.com/game-of-insight/</link>
		<comments>http://robmarianski.com/game-of-insight/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 05:31:25 +0000</pubDate>
		<dc:creator>rob</dc:creator>
		
		<category><![CDATA[approaches]]></category>

		<guid isPermaLink="false">http://robmarianski.com/?p=50</guid>
		<description><![CDATA[We&#8217;ve all had our frustrating moments with computers. We bang our heads against the walls for quite some time, and no matter what we try, the computer responds with a clever &#8220;I thought you might try that, here&#8217;s your error.&#8221; And then, we try talking to someone else about it, and they usually have a [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve all had our frustrating moments with computers. We bang our heads against the walls for quite some time, and no matter what we try, the computer responds with a clever &#8220;I thought you might try that, here&#8217;s your error.&#8221; And then, we try talking to someone else about it, and they usually have a brilliant idea that solves everything elegantly. Then we&#8217;re left scratching our heads, wondering why we didn&#8217;t think of that before.</p>
<p>Lots of problems get solved like this simply because they are looked at from a fresh perspective. It&#8217;s easy to get lost in the details of a problem. When we keep our heads down, it&#8217;s hard to realize that we were just approaching the problem from the wrong angle.</p>
<blockquote><p>Programming is a game of insight.</p></blockquote>
<p>I think that sums up the essence of programming. The most significant gains are often those that shed the problem in a new light.</p>
<p>But not all reevaluations of a problem lead to successes. In fact, I would argue that most of them don&#8217;t. But the ones that do work, usually do so in a big way. Given that programming is this give and take process, progress often isn&#8217;t linear. There isn&#8217;t a lot of progress, or it looks like things are getting worse, and then suddenly, there&#8217;s a big jump.</p>
<p>This makes it especially difficult to measure, assuming it&#8217;s even <a title="Productivity is hard to measure" href="http://www.joelonsoftware.com/news/20020715.html">possible to measure</a> at all. Any formal attempts at measurements results in programmers optimizing for the local maxima. This ends up detracting from productivity.</p>
<p>But regardless of whether we can keep track of it or not, it&#8217;s important to foster an environment that encourages creativity. A single idea can change everything.</p>
]]></content:encoded>
			<wfw:commentRss>http://robmarianski.com/game-of-insight/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Laws of the Land</title>
		<link>http://robmarianski.com/laws-of-the-land/</link>
		<comments>http://robmarianski.com/laws-of-the-land/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 21:02:21 +0000</pubDate>
		<dc:creator>rob</dc:creator>
		
		<category><![CDATA[approaches]]></category>

		<guid isPermaLink="false">http://robmarianski.com/?p=29</guid>
		<description><![CDATA[We all go through programming disasters. It&#8217;s hard, if not impossible, to always make the right decisions. And after we&#8217;ve steered the ship back on course and we&#8217;re out of the storm, we try to review if there was any way we could have prevented the storm in the first place. This reflection is crucial, [...]]]></description>
			<content:encoded><![CDATA[<p>We all go through programming disasters. It&#8217;s hard, if not impossible, to always make the right decisions. And after we&#8217;ve steered the ship back on course and we&#8217;re out of the storm, we try to review if there was any way we could have prevented the storm in the first place. This reflection is crucial, and is one of the best ways we can improve ourselves.</p>
<p>What becomes dangerous however, is when these reviews turn into policies, or mandates. To explain why, I&#8217;ll summarize an anecdote which I&#8217;ve come across from the <em>Extreme Programming</em> book.</p>
<blockquote><p>
A mother was baking a ham with her daughter, and she noticed that the ends were cut off. She asked her mother why, to which the mom responded: &#8220;I don&#8217;t know. That&#8217;s the way my mother always did it. I&#8217;ll ask her.&#8221; So the mother asked the grandmother why the ends of the ham were cut off, and she said: &#8220;I don&#8217;t know. That&#8217;s the way my mother always did it. I&#8217;ll ask my mother&#8221;. And the great grandmother&#8217;s response was: &#8220;My oven was too small, so I had to cut off the ends to have it fit&#8221;.
</p></blockquote>
<p>Blindly following policies can lead to extra steps that can work against us. Rather than come up with new policies, it&#8217;s better to come up with principles that can inform future decisions. It&#8217;s more important to understand the reasons behind what those policies would have been.</p>
<p>On that note, dogma itself is dangerous. When we start blindly following rules, we start becoming simple machines. It tends to stifle creativity, which is the worst thing that can happen to programmers. Programming itself, after all, is a creative process.</p>
<p>I&#8217;ve seen a trend by programmers to be <em>completely</em> against any form of duplication. After all, there are extremely compelling motivations for this idea. Programmers have all copy/pasted code to get something working, with the reason being that it usually ends up working much faster in the short term. But then when all that new code needs to get updated, we&#8217;ve all forgotten to make the change to all the pieces that required it. And bingo, we have a new bug.</p>
<p>Then we look back on it and what&#8217;s to blame? Not that we forgot to make the change everywhere, which was just the symptom. The problem was that it was possible to change one of the parts, and forget to update the other. It should have been refactored to avoid the duplication, so that a change in one location would naturally affect all the other paths. This would have prevented the bug from even being possible.</p>
<p>But like most dogmas taken too far, this can get you into trouble. Here&#8217;s a very contrived example, and granted most of us don&#8217;t think this way, but I&#8217;ve experienced somewhat similar arguments for avoiding duplication where I thought it was just silly.</p>
<p><code><br />
a = 7<br />
b = 3 + 12<br />
c = 18 - 2<br />
d = 9 * 6<br />
</code></p>
<p>Try to pretend that these are real calculations, and there are not just hardcoded numbers here. Can you spot the duplication? Normally you&#8217;d say there isn&#8217;t, but I can argue that there is. You have four assignments, and 3 mathematical operations. Isn&#8217;t that duplication? Here&#8217;s the &#8220;reduced&#8221; version:</p>
<p><code><br />
vars = ['a', 'b', 'c', 'd']<br />
arguments = [(), (3, 12), (18, 2), (9, 6)]<br />
ops = [lambda *x:7, operator.add, operator.sub, operator.mul]<br />
for var, args, op in zip(vars, arguments, ops):<br />
&nbsp;&nbsp;&nbsp;&nbsp;globals()[var] = op(*args)<br />
</code></p>
<p>Notice how I&#8217;ve eliminated all the duplication? And wasn&#8217;t it clever of me to fit the simple assignment in the first example to a no-op? The logic is all now in a single line compared to the 4 up above. I can argue that although it&#8217;s actually more lines of code, I can effectively move all but the loop into configuration. Now people can add more variables to the global namespace, with an arbitrary operation performed on any number of arguments, all through configuration! What a wonderful and extensive system I&#8217;ve created!</p>
<p>The perceptive reader will have discovered that I was being a tad bit sarcastic. (My co-workers will all tell you that I&#8217;m subtle). So which is easier to understand? Which would you rather maintain? Readers with no python experience will probably understand the first code snippet. But you probably need to know python to even attempt to understand what&#8217;s going on in the second.</p>
<p>So if you&#8217;re going to follow dogmas, policies, or rules, then follow this one:</p>
<blockquote><p><strong>Always</strong> use your brain.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://robmarianski.com/laws-of-the-land/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
