<?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>YouMightBe.com&#039;s humor lists &#187; programmer</title>
	<atom:link href="http://youmightbe.com/blog/tag/programmer/feed/" rel="self" type="application/rss+xml" />
	<link>http://youmightbe.com/blog</link>
	<description>A collection of humor lists from user submissions and usenet postings.</description>
	<lastBuildDate>Wed, 14 Mar 2012 13:24:36 +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>The evolution of a python programmer</title>
		<link>http://youmightbe.com/blog/2007/09/24/the-evolution-of-a-python-programmer/</link>
		<comments>http://youmightbe.com/blog/2007/09/24/the-evolution-of-a-python-programmer/#comments</comments>
		<pubDate>Mon, 24 Sep 2007 17:53:30 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Geeky]]></category>
		<category><![CDATA[programmer]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://youmightbe.com/blog/2007/09/24/the-evolution-of-a-python-programmer/</guid>
		<description><![CDATA[#Newbie programmer def factorial(x): if x == 0: return 1 else: return x * factorial(x - 1) print factorial(6) #First year programmer, studied Pascal def factorial(x): result = 1 i = 2 while i &#60;= x: result = result * i i = i + 1 return result print factorial(6) #First year programmer, studied C [...]]]></description>
			<content:encoded><![CDATA[<p><code> #Newbie programmer<br />
def factorial(x):<br />
if x == 0:<br />
return 1<br />
else:<br />
return x * factorial(x - 1)<br />
print factorial(6)</code></p>
<p>#First year programmer, studied Pascal<br />
def factorial(x):<br />
result = 1<br />
i = 2<br />
while i &lt;= x:<br />
result = result * i<br />
i = i + 1<br />
return result<br />
print factorial(6)</p>
<p>#First year programmer, studied C<br />
def fact(x): #{<br />
result = i = 1;<br />
while (i &lt;= x): #{<br />
result *= i;<br />
i += 1;<br />
#}<br />
return result;<br />
#}<br />
print(fact(6))</p>
<p>#First year programmer, SICP<br />
@tailcall<br />
def fact(x, acc=1):<br />
if (x &gt; 1): return (fact((x &#8211; 1), (acc * x)))<br />
else:       return acc<br />
print(fact(6))</p>
<p>#First year programmer, Python<br />
def Factorial(x):<br />
res = 1<br />
for i in xrange(2, x + 1):<br />
res *= i<br />
return res<br />
print Factorial(6)</p>
<p>#Lazy Python programmer<br />
def fact(x):<br />
return x &gt; 1 and x * fact(x &#8211; 1) or 1<br />
print fact(6)</p>
<p>#Lazier Python programmer<br />
f = lambda x: x and x * f(x &#8211; 1) or 1<br />
print f(6)</p>
<p>#Python expert programmer<br />
fact = lambda x: reduce(int.__mul__, xrange(2, x + 1), 1)<br />
print fact(6)</p>
<p>#Python hacker<br />
import sys<br />
@tailcall<br />
def fact(x, acc=1):<br />
if x: return fact(x.__sub__(1), acc.__mul__(x))<br />
return acc<br />
sys.stdout.write(str(fact(6)) + &#8216;\n&#8217;)</p>
<p>#EXPERT PROGRAMMER<br />
from c_math import fact<br />
print fact(6)</p>
<p>#BRITISH EXPERT PROGRAMMER<br />
from c_maths import fact<br />
print fact(6)</p>
<p>#Web designer<br />
def factorial(x):<br />
#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
#&#8212; Code snippet from The Math Vault          &#8212;<br />
#&#8212; Calculate factorial (C) Arthur Smith 1999 &#8212;<br />
#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
result = str(1)<br />
i = 1 #Thanks Adam<br />
while i &lt;= x:<br />
#result = result * i  #It&#8217;s faster to use *=<br />
#result = str(result * result + i)<br />
#result = int(result *= i) #??????<br />
result = str(int(result) * i)<br />
#result = int(str(result) * i)<br />
i = i + 1<br />
return result<br />
print factorial(6)</p>
<p>#Unix programmer<br />
import os<br />
def fact(x):<br />
os.system(&#8216;factorial &#8216; + str(x))<br />
fact(6)</p>
<p>#Windows programmer<br />
NULL = None<br />
def CalculateAndPrintFactorialEx(dwNumber,<br />
hOutputDevice,<br />
lpLparam,<br />
lpWparam,<br />
lpsscSecurity,<br />
*dwReserved):<br />
if lpsscSecurity != NULL:<br />
return NULL #Not implemented<br />
dwResult = dwCounter = 1<br />
while dwCounter &lt;= dwNumber:<br />
dwResult *= dwCounter<br />
dwCounter += 1<br />
hOutputDevice.write(str(dwResult))<br />
hOutputDevice.write(&#8216;\n&#8217;)<br />
return 1<br />
import sys<br />
CalculateAndPrintFactorialEx(6, sys.stdout, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)</p>
<p>#Enterprise programmer<br />
def new(cls, *args, **kwargs):<br />
return cls(*args, **kwargs)</p>
<p>class Number(object):<br />
pass</p>
<p>class IntegralNumber(int, Number):<br />
def toInt(self):<br />
return new (int, self)</p>
<p>class InternalBase(object):<br />
def __init__(self, base):<br />
self.base = base.toInt()</p>
<p>def getBase(self):<br />
return new (IntegralNumber, self.base)</p>
<p>class MathematicsSystem(object):<br />
def __init__(self, ibase):<br />
Abstract</p>
<p>@classmethod<br />
def getInstance(cls, ibase):<br />
try:<br />
cls.__instance<br />
except AttributeError:<br />
cls.__instance = new (cls, ibase)<br />
return cls.__instance</p>
<p>class StandardMathematicsSystem(MathematicsSystem):<br />
def __init__(self, ibase):<br />
if ibase.getBase() != new (IntegralNumber, 2):<br />
raise NotImplementedError<br />
self.base = ibase.getBase()</p>
<p>def calculateFactorial(self, target):<br />
result = new (IntegralNumber, 1)<br />
i = new (IntegralNumber, 2)<br />
while i &lt;= target:<br />
result = result * i<br />
i = i + new (IntegralNumber, 1)<br />
return result</p>
<p>print StandardMathematicsSystem.getInstance(new (InternalBase, new (IntegralNumber, 2))).calculateFactorial(new (IntegralNumber, 6))</p>
<div id="crp_related"><h2>Related Posts:</h2><ul><li><a href="http://youmightbe.com/blog/2011/01/03/you-might-be-making-your-coworkers-uncomfortable-if/" rel="bookmark" class="crp_title">You might be making your coworkers uncomfortable if&#8230;</a></li><li><a href="http://youmightbe.com/blog/2009/02/28/you-might-be-a-bad-customer-if/" rel="bookmark" class="crp_title">You might be a bad customer if&#8230;</a></li><li><a href="http://youmightbe.com/blog/2006/06/21/your-band-might-be-a-sell-out-if/" rel="bookmark" class="crp_title">Your band might be a sell-out if&#8230;</a></li><li><a href="http://youmightbe.com/blog/2006/07/12/if-operating-systems-were-airlines/" rel="bookmark" class="crp_title">If Operating Systems were Airlines</a></li><li><a href="http://youmightbe.com/blog/2009/04/21/puns-from-the-inbox/" rel="bookmark" class="crp_title">Puns from the Inbox</a></li></ul></div> <a href="http://www.blogtrafficexchange.com/related-posts"><strong>Related Posts</strong></a> <ul>  <li> <a onClick="window.location='http://bte.tc/gmU9'; return false;" href="http://youmightbe.com/blog/2011/01/03/you-might-be-making-your-coworkers-uncomfortable-if/">You might be making your coworkers uncomfortable if...</a> <small>(See also Grumpy Coworker) you ask your black coworkers why their people are always trying to keep the white man down. you openly discuss your menstrual cycle. If someone points out the fact that you're a man, bring them up on sexual harassment charges. you push your desk away from......</small> </li> <li> <a onClick="window.location='http://bte.tc/Gqk'; return false;" href="http://youmightbe.com/blog/2006/06/25/operating-systems-for-your-brain/">Operating Systems for Your Brain</a> <small>If your brain required an operating system like your computer does, what would it be like? Windows for brains: YouÂ  think about one of any number of things at anyone time but only for a short amount of time because then your mind goes blank as you encounter a "generalÂ ......</small> </li> <li> <a onClick="window.location='http://bte.tc/Fhj'; return false;" href="http://youmightbe.com/blog/2009/02/28/you-might-be-a-bad-customer-if/">You might be a bad customer if...</a> <small>you instruct the bartender on how to make a drink because, very loudly, you explain "That's how they make them at MY country club." Then you wait to receive your .19 cents in change and don't tip. you go into a convenience store and buy a pack of gum......</small> </li> <li> <a onClick="window.location='http://bte.tc/Gq9'; return false;" href="http://youmightbe.com/blog/2009/04/21/puns-from-the-inbox/">Puns from the Inbox</a> <small>1. The roundest knight at King Arthur's round table was Sir Cumference. He acquired his size from too much Pi. 2. I thought I saw an eye doctor on an Alaskan island, but it turned out to be an optical Aleutian . 3. She was only a whisky maker -......</small> </li> <li> <a onClick="window.location='http://bte.tc/dPD'; return false;" href="http://youmightbe.com/blog/2009/02/20/you-might-be-a-nurse-if/">You might be a nurse if...</a> <small>your friends call you for medical advice. ( lloyd , avatarj@mindspring.com ) discussing dismemberment over a gourmet meal seems perfectly normal to you (Mary) you have the bladder capacity of five people you have your weekends off planned for a year in advance you believe that "ask-a-nurse" is an......</small> </li> <li> <a onClick="window.location='http://bte.tc/qcSY'; return false;" href="http://youmightbe.com/blog/2011/07/06/you-might-be-making-your-coworkers-uncomfortable-if-2/">You might be making your coworkers uncomfortable if...</a> <small>you reply to all on e-mail announcements about the death of a co-worker's family member with something like, "It's about time." you publicly insist that your employer recognize your chronic body odor as a disability. you enthusiastically pleasure yourself whenever someone hands you a memo. you give yourself a......</small> </li> </ul> <a href="http://www.blogtrafficexchange.com/related-websites"><strong>Blog Traffic Exchange</strong></a> <ul>  <li> <a onClick="window.location='http://bte.tc/ehM'; return false;" href="http://www.acousticmusicalinstruments.com/beginner-cello-tips/">Beginner Cello Tips</a> <small>If you are just learning how to play the cello,...</small> </li> <li> <a onClick="window.location='http://bte.tc/b2hz'; return false;" href="http://www.greenhybridelectriccars.com/hybrid-electric-car-auto-insurance/">Hybrid Electric Car Auto Insurance</a> <small>This post is a guest blog written by Travis Overby....</small> </li> <li> <a onClick="window.location='http://bte.tc/Vjp'; return false;" href="http://geeklad.com/google-fusion-tables-could-be-a-game-changer">Google Fusion Tables Could be a Game Changer</a> <small>Google has been very busy lately with many new products...</small> </li> </ul>]]></content:encoded>
			<wfw:commentRss>http://youmightbe.com/blog/2007/09/24/the-evolution-of-a-python-programmer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

