<?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>federicopereiro.com</title>
	<atom:link href="http://www.federicopereiro.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.federicopereiro.com</link>
	<description>Technical consulting for startup founders</description>
	<lastBuildDate>Tue, 04 Sep 2012 10:12:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>Spaces in code</title>
		<link>http://www.federicopereiro.com/spaces/</link>
		<comments>http://www.federicopereiro.com/spaces/#comments</comments>
		<pubDate>Mon, 13 Aug 2012 22:54:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.federicopereiro.com/?p=91</guid>
		<description><![CDATA[Since I started to write code, I&#8217;ve been trying to find the right way to place spaces in my code. No matter what language I was programming in, I would not find a way of making it feel right. Standard ways of doing it didn&#8217;t cut it either. A few months ago I stumbled upon [...]]]></description>
			<content:encoded><![CDATA[<p>Since I started to write code, I&#8217;ve been trying to find the right way to place spaces in my code. No matter what language I was programming in, I would not find a way of making it feel right. Standard ways of doing it didn&#8217;t cut it either.</p>
<p>A few months ago I stumbled upon a way to do it. The idea is to copy how we use parenthesis and spaces in natural language.</p>
<p>So, instead of writing <strong>function(arg,arg2)</strong>, I write <strong>function (arg, arg2)</strong>. Instead of <strong>function()</strong> or <strong>function ( )</strong>, I write <strong>function ()</strong>.</p>
<p>That is, I leave a space before each opening parenthesis, a space after each comma, and a space after each closing parenthesis. The same also goes for colons.</p>
<p>Also, when using square brackets, the same logic applies than with round or curly brackets. For example, instead of writing <strong>object[iterator]</strong> or <strong>object [ iterator ]</strong>, I write <strong>object [iterator]</strong>.</p>
<p>It doesn&#8217;t feel either cramped or longwinded, it&#8217;s just like reading text.</p>
<p>Just wanted to share it with you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.federicopereiro.com/spaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t swap!</title>
		<link>http://www.federicopereiro.com/swap/</link>
		<comments>http://www.federicopereiro.com/swap/#comments</comments>
		<pubDate>Sun, 15 Jul 2012 02:58:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.federicopereiro.com/?p=75</guid>
		<description><![CDATA[There&#8217;s a technical analogy I&#8217;d like to share. (if you&#8217;re a non-technical reader, whatever that means, there&#8217;s a brief explanation of some terms at the end, but you&#8217;ll get the gist anyway) When your computer runs out of RAM, it starts using the hard disk as if it were RAM. The part of the disk [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a technical analogy I&#8217;d like to share.</p>
<p>(if you&#8217;re a non-technical reader, whatever that means, there&#8217;s a brief explanation of some terms at the end, but you&#8217;ll get the gist anyway)</p>
<p>When your computer runs out of RAM, it starts using the hard disk as if it were RAM. The part of the disk that serves as this makeshift RAM is called the swap space.</p>
<p>Since hard disks are roughly <a href="http://www.federicopereiro.com/redis">an order of magnitude slower</a> than RAM, whenever your computer starts swapping, it gets very slow, and you get very agitated. Usually, you start overloading your computer even more, because now you&#8217;re maximizing and minimizing windows and clicking everything just to see if your system is responsive or not.</p>
<p>Much in the same way, when you&#8217;re not focused on the task that&#8217;s right in front of you (either because you&#8217;re multitasking or you&#8217;re distracted by the internet), then you have too much on your plate, you run out of RAM, and so your brain starts swapping. This means that your brain becomes roughly an order of magnitude slower, and a part of you gets very agitated and starts worrying about deadlines and frantically putting your conscience in a blender.</p>
<p>In both cases, the solution is to close the tasks that you don&#8217;t need. So, when you find yourself doing many things at the same time or saying to yourself every 30 seconds &#8220;what was I going to do now?&#8221;, just say loudly to yourself: <strong>don&#8217;t swap!</strong></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>For the non-technical readers</strong></p>
<p><em>Order of magnitude</em> is a way of saying &#8220;about ten times&#8221;. It is fancy, but I really like to use that term. Also, two orders of magnitude means &#8220;about a hundred times&#8221; (and not just twenty times), since it&#8217;s being implied that the magnitudes are multiplied, not added.</p>
<p><em>RAM = memory</em>. Memory is volatile, so when you turn off your computer, everything in RAM gets deleted. You don&#8217;t store anything in memory &#8211; think of it as a highway where the computer places transient data.</p>
<p><em>Disk = space</em>. Disk is not volatile (most of the time). This is where your data is stored &#8211; think of it as a garage.</p>
<p>RAM is more expensive than disk, and that&#8217;s why your computer has roughly two orders of magnitude (heh) less memory/RAM than space/disk.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.federicopereiro.com/swap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Read the masters</title>
		<link>http://www.federicopereiro.com/masters/</link>
		<comments>http://www.federicopereiro.com/masters/#comments</comments>
		<pubDate>Sat, 14 Jul 2012 12:29:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.federicopereiro.com/?p=69</guid>
		<description><![CDATA[Some time ago, I came across the Wikipedia article of Niels Henrik Abel, and something there burnt its way into my mind. Abel changed the face of mathematics, despite dying at 27. And here comes the thing &#8211; I give the mic to Wikipedia now: When asked how he developed his mathematical abilities so rapidly, [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago, I came across the Wikipedia article of <a href="http://en.wikipedia.org/wiki/Niels_Henrik_Abel">Niels Henrik Abel</a>, and something there burnt its way into my mind.</p>
<p>Abel changed the face of mathematics, despite dying at 27. And here comes the thing &#8211; I give the mic to Wikipedia now:</p>
<blockquote><p>When asked how he developed his mathematical abilities so rapidly, he replied &#8220;by studying the masters, not their pupils.&#8221;</p></blockquote>
<p><em>By studying the masters, not their pupils.</em></p>
<p>The proposition is a bit like trying to climb a wall instead of a stair. Already I found straining to follow the gist of the textbooks of the subject I was interested &#8211; how could I deal with the masters?</p>
<p>Yet, maybe you don&#8217;t have to be Abel to do what Abel does.</p>
<p>Another thing that resonated deeply with me was how Newton studied a book by a French mathematician (I don&#8217;t remember which one): he started reading the book &#8211; when he found it too hard, he started over. That&#8217;s what he did until he understood the whole thing. So, he didn&#8217;t go and read something more basic, or tried to found someone who could explain it. He just stayed with the source until he groked it.</p>
<p>Again, Newton was a genius. But may be this kind of thing is what we need to truly learn, to truly get a shot at doing something of beauty and usefulness.</p>
<p>I&#8217;ve been reading the masters more and more. Usually it&#8217;s like reading a foreign language. You don&#8217;t understand almost anything and you feel like a baby.</p>
<p>But if you don&#8217;t mind too much feeling like a baby, and if you can create some space in your life where you aren&#8217;t forced to be an adult, then give the masters a try.</p>
<p>Below I put some links to works by masters of Computer Science &#8211; all the works below are available to download for free.</p>
<p><a href="http://cm.bell-labs.com/cm/ms/what/shannonday/shannon1948.pdf">Shannon, 1948 &#8211; A Mathematical Theory of Communication</a></p>
<p><a href="http://netlab.cs.ucla.edu/wiki/files/shannon1949.pdf">Shannon, 1949 &#8211; Communication Theory of Secrecy Systems</a></p>
<p><a href="http://www.cs.virginia.edu/~robins/Turing_Paper_1936.pdf">Turing, 1936 &#8211; On Computable Numbers, with an Application to the Entscheidungsproblem</a></p>
<p><a href="http://www-formal.stanford.edu/jmc/recursive.html">McCarthy, 1960 &#8211; Recursive Functions of Symbolic Expressions and their Computation by Machine (Part I)</a></p>
<p><a href="http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf">MIT, 1962 &#8211; Lisp 1.5 Programmer&#8217;s Manual</a></p>
<p><a href="http://cm.bell-labs.com/cm/cs/who/dmr/chist.html">Ritchie, 1993 &#8211; The Development of the C Language</a></p>
<p><a href="http://cm.bell-labs.com/who/ken/trust.html">Thompson, 1984 &#8211; Reflections on Trusting Trust</a></p>
<p><a href="http://tools.ietf.org/html/rfc675">Cerf et Dalal et Sunshine, 1974 &#8211; Specification of the Internet Transmission Control Program</a></p>
<p><a href="http://www.scs.stanford.edu/nyu/05sp/sched/readings/srp.pdf">Wu, 1997 &#8211; The Secure Remote Password Protocol</a></p>
<p><a href="http://www.itu.dk/courses/BPRD/E2009/fundamental-1967.pdf">Strachey, 1967 &#8211; Fundamental Concepts in Programming Languages</a></p>
<p><a href="http://www.literateprogramming.com/knuthweb.pdf">Knuth, 1983 &#8211; Literate Programming</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.federicopereiro.com/masters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why you should almost always choose Redis as your database</title>
		<link>http://www.federicopereiro.com/redis/</link>
		<comments>http://www.federicopereiro.com/redis/#comments</comments>
		<pubDate>Wed, 11 Jul 2012 09:50:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.federicopereiro.com/?p=61</guid>
		<description><![CDATA[Whenever the topic of databases/persistence arises, I almost always recommend using Redis instead of MySQL or even any other NoSQL solution. There are two reasons for choosing Redis almost always: 1) Redis data structures are far more intuitive and versatile means of storing data than relational databases. To me, relational databases are a very limiting [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever the topic of databases/persistence arises, I almost always recommend using Redis instead of MySQL or even any other NoSQL solution.</p>
<p>There are two reasons for choosing Redis almost always:</p>
<p><strong>1) Redis data structures are far more intuitive and versatile means of storing data than relational databases.</strong></p>
<p>To me, relational databases are a very limiting and antinatural way of structuring data. I&#8217;ve always felt that mapping the concepts of your program (whatever your style of programming, but especially if it is object-oriented or functional) to relational databases is both painful and frustrating. This is for two reasons:</p>
<p>- Relational databases have no concept of hierarchy &#8211; that is, no nesting. What you have is a set of arrays, instead of having a tree. There&#8217;s nothing bigger than a table, and nothing smaller than a field.</p>
<p>- The links between nodes are of a weak and limited type: foreign keys. So you have to bend over backwards to implement some sort of network model for your data.</p>
<p>(BTW, this is why ORM is a rabbit hole of the kind that nothing of real beauty can come from. No matter how good the solution is, it&#8217;s always a variant of fitting a square peg in a round hole).</p>
<p>Redis, although it isn&#8217;t a true tree or a graph, is far closer to either of them, because it has a rich set of data structures which are very similar to those of today&#8217;s high level programming languages. From what I&#8217;ve looked around, no other NoSQL tool offers a comparable set of data structures.</p>
<p>This means you&#8217;ll do far less violence to the concepts of your program when you persist its data with Redis. This makes for faster development and will considerably improve the quality of your code. More importantly, your code will be more beautiful.</p>
<p><strong>2) Redis runs in RAM</strong></p>
<p>Although it persists to disk, Redis data is read from and written to RAM. Since RAM is about an order of magnitude faster than a disk, this translates to queries and write operations that are roughly an order of magnitude faster. Sure, many caveats and exceptions apply, but that&#8217;s the essence of Redis&#8217; blazing performance.</p>
<p><strong>So, to sum up:</strong></p>
<p>Redis will make your application 1) easier and more enjoyable to program, because it maps better to the concepts of your program; and 2) faster.</p>
<p>Yet&#8230;</p>
<p><strong>You should not use Redis if your dataset is large (more than 2gb).</strong></p>
<p>This is because it is non-trivial (though possible) to create a cluster of Redis instances, each of them holding up to 2gb (or 4, or 8). Also, if your application stores larges volumes of data, then probably Redis will never be your option because of economics (can you afford terabytes of RAM?). In that case, you should give a deep, meaningful look to Amazon S3.</p>
<p>(Did you notice I&#8217;m implying you should never use MySQL?)</p>
<p><strong>These counterarguments to using Redis are invalid:</strong></p>
<p><em>MySQL is the default and Redis is not production-ready</em>: there&#8217;s much to argue against using the default technological choice for anything &#8211; and unless your clients insist of vanilla-grade software, you should seek something better than the median tool. And Redis is very, very production ready. Just look around and see who&#8217;s using it.</p>
<p><em>- Redis is not truly persistent because it runs in RAM</em>: both of Redis&#8217; persistence operations (journal and snapshotting) are good enough. For me, the ideal would be to have a <em>reverse journal</em>, where you store the negative changes (what you should apply to go <em>back</em> instead of starting from 0 and going forwards) &#8211; if you combine this with snapshotting, you&#8217;d have something that&#8217;s virtually lossless <em>and </em>fast. But going back to the main point, Redis persistence to disk is secure and reasonably fast.</p>
<p><strong>Further arguments, counterarguments and objections</strong></p>
<p>I&#8217;ll be glad to hear them: write me at <strong>fpereiro@gmail.com</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.federicopereiro.com/redis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A web startup is a technological endeavor</title>
		<link>http://www.federicopereiro.com/tech/</link>
		<comments>http://www.federicopereiro.com/tech/#comments</comments>
		<pubDate>Mon, 09 Jul 2012 14:27:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.federicopereiro.com/?p=50</guid>
		<description><![CDATA[WARNING: what I&#8217;m about to say is heavily biased by the fact that I come from a business background and I love technology. I&#8217;m saying nothing new here, but I&#8217;ve found myself making this point over and over when talking with startup founders who have non-technical backgrounds. So I&#8217;ll just go ahead and try to [...]]]></description>
			<content:encoded><![CDATA[<h6 style="text-align: center;"><span style="color: #000000;">WARNING: what I&#8217;m about to say is heavily biased by the fact that I come from a business background and I love technology.</span></h6>
<p>I&#8217;m saying nothing new here, but I&#8217;ve found myself making this point over and over when talking with startup founders who have non-technical backgrounds. So I&#8217;ll just go ahead and try to spell it out, in the bluntest way possible:</p>
<p><em>For 99% of web startups, their main challenge is to deliver excellent technology. Delivering excellent technology is not enough to be succesful, but it&#8217;s the single greatest predictor of a startup&#8217;s success.<strong> Everything else is less important.</strong></em></p>
<p>If you&#8217;re a startup founder and you have no technical knowledge, you may be frustrated by the number and weight of the technological decisions you have to take. You may think that this is just during the initial phase of your company and then you&#8217;ll just focus on marketing, sales and the IPO. But in fact, technological decisions will be the bread and butter of your reign as CEO. You&#8217;ll have to make decisions about sales, hiring and finance as well, but they will be less important than your technological decisions. (Note: decisions about hiring desginers &amp; programmers are technical decisions).</p>
<p>So, if you&#8217;re a web startup founder with no technical background, you can do two things:</p>
<p>- Jump into the water and start learning about technology.</p>
<p>- Find a technical cofounder.</p>
<p>Technological consultants may be useful to help you take technical decisions (<a href="http://federicopereiro.com/hire-me">heh</a>), but you need to learn and care about technology &#8211; or team up with someone who does. So let&#8217;s sum this up in an equally blunt corollary:</p>
<p><em> If you&#8217;re doing a web startup, there must be at least someone with equity who knows and cares about technology. You can either become that person or find someone else who will be that person. If you haven&#8217;t done this already, it is the single most important action you can take right now.</em></p>
<p>This knowledge and love for technology translate to a great product in two ways:</p>
<p>- You work with the proper tools, so your product is far cheaper to make, faster to launch, easier to maintain and grow, and more resilent to the future (because, for example, it is not based on a technological dead-end).</p>
<p>- You hire the right designers &amp; programmers. This point is probably more important than the previous one, because if you hire great people, they will help you choose the right tools and approaches.</p>
<p>There are a few exceptions:</p>
<p>- If you&#8217;re copying an existing product and launching it in a different niche or regional market (being first is probably more important).</p>
<p>- A business strategy that relies on privileged access to a restricted channel of distribution.</p>
<p>- Selling software to big companies or government institutions.</p>
<p>Here&#8217;s my final (and equally blunt) conclusion:</p>
<p><em>Unless you already feel an inclination towards technology, go find a technical cofounder. <strong>Now.</strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.federicopereiro.com/tech/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three ideas from Derek Sivers</title>
		<link>http://www.federicopereiro.com/derek/</link>
		<comments>http://www.federicopereiro.com/derek/#comments</comments>
		<pubDate>Mon, 09 Jul 2012 09:29:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.federicopereiro.com/?p=15</guid>
		<description><![CDATA[Derek Sivers is an amazing musician, entrepreneur and programmer. I came across his blog a couple of years ago and avidly went through his articles. Here&#8217;s a brief outline of three ideas of Derek that I find refreshing and useful, particularly if you&#8217;re starting a web startup. Ideas are a multiple of execution It doesn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sivers.org/multiply">Derek Sivers</a> is an amazing musician, entrepreneur and programmer. I came across his blog a couple of years ago and avidly went through his articles.</p>
<p>Here&#8217;s a brief outline of three ideas of Derek that I find refreshing and useful, particularly if you&#8217;re starting a web startup.</p>
<p><strong><a href="http://sivers.org/multiply">Ideas are a multiple of execution</a></strong></p>
<p>It doesn&#8217;t matter how much you believe in the world-changing prospects of your startup idea: if you don&#8217;t act upon it, it isn&#8217;t worth anything. Of course, ideas are essential and without new ideas, nothing new will arise. But also as important, <em>nothing will arise from an idea that&#8217;s not executed</em><em>.</em></p>
<p>The <em>great idea</em> is wildly overrated, and everyone who has put startup ideas into practice will tell you exactly this. But Derek says it better than anyone.</p>
<p>I&#8217;ve fallen prey to this trap many times. What I found works for me is to get very excited about an idea, and at the same time work on launching an initial version of its execution. Which leads me to&#8230;</p>
<p><a href="http://sivers.org/infinity"><strong>That&#8217;s version ∞. First launch version 0.1.</strong></a></p>
<p>Take your current feature list for your new startup. Slash it by 90%. Choose only one or two points, reduce them to their minimal expression. And launch your application!</p>
<p>If you wait to develop your entire list of specs before launching, you risk two things: a) running out of money before launching something useful; b) focusing on the wrong features or executing them badly because of lack of user feedback.</p>
<p>I must confess that I&#8217;m preaching here what I don&#8217;t practice. I have an open source project which is half done (and which I routinely use for programming) which I haven&#8217;t launched yet. So do as I say, not as I do, and launch the damn thing already.</p>
<p><a href="http://vimeo.com/25492897"><strong>Business is not necessarily about money</strong></a></p>
<p>Making a business can be about much more than just making money. You can start a business to create something useful, to bring about change, to free yourself from the office, to make people happy&#8230; Of course, a business must make money, but that is not necessarily the variable you should maximize.</p>
<p>As long as your business is profitable, you may well choose to develop other things in your business apart from profitability. So money becomes the means of your startup, rather than the end.</p>
<p>Although this idea is not for everyone, I find it highly inspiring.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.federicopereiro.com/derek/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
