3,269 karma · joined July 21, 2009
"I had a bunch of friends who I loved dearly, but in many ways were exhibiting all the traditional programmer stereotype themes of being just overly focused on things I didn't think mattered and at that time programming perhaps also was a little bit different. Growing up, programming was assembler and C. I had a lot of friends in what was called the ‘demo scene’, which is mostly an European thing where you had all these guys on the Commodore 64 and on the Amiga writing these really awesome visual displays of various kinds, and all that stuff was usually in assembler. I had absolutely zero interest in learning or doing anything with assembler, it just didn't make any sense to me at all.
I only really got interested in programming when I stumbled across languages that made sense to me on the level that makes sense to me, which is at the very least high level languages like Java, PHP, or whatever have you, anything that's above the “I have to dick around with pointers” or I actually have to move memory spaces around; that stuff has absolutely zero interest to me at all.
I didn't start programming until I was in my late twenties, and even then I didn't start programming because I wanted to be a programmer. I started programming because I wanted a few programs. And that was apparently the easiest way to get there because the other way of getting programs is that you actually have to talk to programmers, which is surprisingly painful at times. I found that the easiest way was just to pick it up and learn it myself."
Source: http://www.transcribed-interview.com/dhh-rails-david-heineme...
fprintf (stderr,
_("%"PRIuMAX"+%"PRIuMAX" records in\n"
"%"PRIuMAX"+%"PRIuMAX" records out\n"),
r_full, r_partial, w_full, w_partial);After all, programming languages are just tools. What really matters is the applications you create with them, and that people will find your application useful and use it with pleasure.
Also, when you reach max level, doesn't mean you finished the game. There is tons of instances to do, special loot to earn, and other stuff; even in 2006.
from timeit import Timer
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
nr = 1200000
data = "The Quick Brown Fox Jumps Over The Lazy Dog: Woven silk pyjamas exchanged for blue quartz.\n"
# contruct a list first, then join
def dolist():
s = []
a = s.append
i = 0
while i < nr:
a(data)
i += 1
s = "".join(s)
print("%s chars (joined list)" % len(s))
# string concatenation fest
def dostr():
s = ""
i = 0
while i < nr:
s += data
i += 1
print("%s chars (string concatenation)" % len(s))
# use a string as a file
def dostringio():
buf = StringIO()
w = buf.write
i = 0
while i < nr:
w(data)
i += 1
s = buf.getvalue()
print("%s chars (cStringIO)" % len(s))
if 1:
tlist = Timer("dolist()", "from __main__ import dolist")
print("the joined list took %.2f seconds" % tlist.timeit(2))
tstr = Timer("dostr()", "from __main__ import dostr")
print("the concatenation fest took %.2f seconds" % tstr.timeit(2))
tlist = Timer("dostringio()", "from __main__ import dostringio")
print("the cStringIO approach took %.2f seconds" % tlist.timeit(2))
else:
@profile
def callall():
# For use with a profiler (eg, kernprof.py/lineprof)
for i in xrange(2):
dolist()
dostr()
dostringio()
callall()
Result:
(user@air) /Users/user/Prj/python $ python3 stringplakbenchmark.py
109200000 chars (joined list)
109200000 chars (joined list)
the joined list took 1.12 seconds
109200000 chars (string concatenation)
109200000 chars (string concatenation)
the concatenation fest took 1.76 seconds
109200000 chars (cStringIO)
109200000 chars (cStringIO)
the cStringIO approach took 1.45 seconds
(user@air) /Users/user/Prj/python $ python2.7 stringplakbenchmark.py
109200000 chars (joined list)
109200000 chars (joined list)
the joined list took 0.99 seconds
109200000 chars (string concatenation)
109200000 chars (string concatenation)
the concatenation fest took 1.33 seconds
109200000 chars (cStringIO)
109200000 chars (cStringIO)
the cStringIO approach took 5.21 seconds
(user@air) /Users/user/Prj/python $ python2.6 stringplakbenchmark.py
109200000 chars (joined list)
109200000 chars (joined list)
the joined list took 0.95 seconds
109200000 chars (string concatenation)
109200000 chars (string concatenation)
the concatenation fest took 1.39 seconds
109200000 chars (cStringIO)
109200000 chars (cStringIO)
the cStringIO approach took 5.54 seconds a = [2, 7, 8, 9]
highest = nexthighest = None
for item in a:
if not highest:
highest = item
elif item > highest:
nexthighest = highest
highest = item
elif not nexthighest:
nexthighest = item
elif item > nexthighest:
nexthighest = item
print highest + nexthighestContrast that with the building blocks the 'software engineer' has to work with. Microsoft might upgrade some DLLs your product depends on, overnight. Will your product still work? Your application probably relies on components written by others. Are they infallible? Can you even inspect the components for defects?
I sometimes have the idea that software is built upon quicksand, and the building blocks can and probably will change before the project is completed.