I think the issue is like one poster said meta-programming. Like the list below, moving up you move to a higher level of abstraction and higher level of programming. So some of your gripes about hiding details, old syntax ...etc is necessary. The higher you go the less you care about the implementation in the layers below.
English/Ideas/Abstract concepts/thought
Frameworks/Django/...etc
Python/Javascript
C++
C
Assembly
I frankly can't wait until we get to the ' just express an idea, and poof program done' stage
.
What debuggers/compilers/run-time checking do is give feedback on your ideas, about feasibility, errors ...etc, which is what they should continue doing. I'd rather have computers working harder, than people, as resource wise people are more expensive
some other valid comparisons were, newbie to programming's introduction to python experience is different, compared to an experienced programmer learning it.
Anyway I just learn python from diveintopython a couple of weeks ago, and since then i've used it to solve a couple of puzzles, and I had fun... The old style program was like this:
##def hours12():
## #using loops
## li = []
## for h in range(1,13):
## for m in range(60):
## li.append('%02d%02d' %(h, m))
## return li
##
##def hours12_b(): # this version is faster
## #using list comprehension
## return ['%02d%02d' %(h, m) for h in range(1,13) for m in range(60)]
##
##def duplicates(li):
## li2 = []
## for t in li:
## dup = 0
## old_d = t[0]
## for d in t[1:]:
## if d == old_d:
## dup += 1
## elif 0 < dup < 2:
## dup = 0 #reset duplicate count if non consecutive duplicates found
## old_d = d
##
## if dup >= 2:
## # print t, dup
## li2.append(t)
## #print len(li2)
## return li2
##
##import re
##repattern = re.compile(r'(\d)\1{2}')
##
##def duplicates_b(li):
## li2 = []
## # print 'testing regular expressions for matching duplicates'
## for el in li:
## result = repattern.search(el)
## if result:
## li2.append(el)
## # print result.group()
## #print len(li2)
## return li2
##
##def duplicates_c(li): #this version is fastest
## li2 = filter(repattern.search, li)
## #print len(li2)
## #return [x.group() for x in li2]
## return li2
##
##import timeit
##li = hours12_b()
##
##ta = timeit.Timer('digits_in_clock.duplicates(digits_in_clock.li)','import digits_in_clock')
##tb = timeit.Timer('digits_in_clock.duplicates_b(digits_in_clock.li)','import digits_in_clock')
##tc = timeit.Timer('digits_in_clock.duplicates_c(digits_in_clock.li)','import digits_in_clock')
##print 'a dup method', ta.repeat(1,1000)
##print 'b dup method', tb.repeat(1,1000)
##print 'c dup method', tc.repeat(1,1000)
####li2 = duplicates(li)
####print li2
####li2 = duplicates_b(li)
####print li2
and the python way in the end was like this
import re
repattern = re.compile(r'(\d)\1{2}')#find a number followed by 2 consecutive duplicates
# the \1 is for first number that we match
li = ['%02d%02d' %(h, m)
for h in range(1,13)
for m in range(60)]
li2 = filter(repattern.search, li)
print li2
print len(li2)
Frankly I like the list comprehension idea, and how intuitive and simple python makes it.