I once read that “…simplicity is king” . This cannot be more true when applied to programming. There are a LOT of different categories of programming languages out there and I find myself attracted to programming languages that offer a higher level of abstraction. Not because I am lazy, but because it is simpler to work with.
Let me explain…
high-level of abstraction = high-level programming language = more legible code = easier. example: Visual Basic
low-level of abstraction = low-level programming language = not so legible code = looks like machine code = more difficult = super efficient and generally faster. example: assembly language
There is a place and time for the different types of languages, although, the introduction of some high-level languages (Visual Basic) has drawn the scorn of many purists. They argue that because the coding syntax is more semantic and easier to understand, un-qualified people are now flocking into the field of programming. Some go to the extent of blaming part of the dot com crash of the 90′s to poor VBScript developers. The claim is that easier = lazier.
I definitely do not think that programming is for everyone. But imagine an excellent programmer that is equipped with the benefits that come with high-level (easier) languages. A programmer that is not hindered by difficult syntax and complex programming structures.
This is why I think that formal training in the art of computer science is so essential. I am grateful that in college, my resolve to be a programmer was put to the test with courses that required the use of low-level languages like assembly language and data-structured (functional) language like Common Lisp, and (not so low-level like) C++ and Java. This was before we were ever introduced to Visual Basic and PHP. Going through the grueling process of understanding data sections and data structures and pointers and inheritance and constructors and destructors… has made me a better programmer. And I’ve come to appreciate the higher-level languages like PHP and C# that help me get work done fast and efficiently in the real world.
NOW to Python and appengine…
I have to say that Python is a beautiful (high-level) language. And Google’s appengine platform is crazy responsive (surprised?). I tried developing on salesforce.com’s offering of a platform as a service (PAAS) and I was not impressed. Using the eclipse IDE to build on salesforce.com’s cloud was not responsive and seemed bloated – IMHO.
So I decided to use my latest pet project to try out Python and Google’s PAAS offering. In anticipation of a sucky PAAS experience, I started out using the Django framework on my local server.
My initial perception is that Python just seems to get out of the way, and allows you to get to work. There are many benefits to Python, one of my favorites right now is:
Maintainable Python: Python’s elegant simplicity yields code that is not only readable, but also easy to redesign and modify. Because Python’s syntax uses indentation to define program structure, code is easy to move around, making it a snap to split up modules or restructure classes. Less time is spent understanding and rewriting code, which leads to faster bug fixes, faster development and integration of new features, and a better-designed code base.
from: http://www.wingware.com/python/benefits
for example, this is how you would query the zillow api to get the zestimate of a property and the high and low valuation;
...
rpc = urlfetch.create_rpc()
urlfetch.make_fetch_call(rpc, zillowurl)
try:
result = rpc.get_result()
if result.status_code == 200:
dom = minidom.parseString(result.content)
#message
msg = dom.getElementsByTagName("message")[0]
result_node = dom.getElementsByTagName("result")[0]
message = msg.getElementsByTagName("text")[0].firstChild.data
if msg.getElementsByTagName("code")[0].firstChild.data == '0':
zesti = result_node.getElementsByTagName("zestimate")[0]
zestimate = zesti.getElementsByTagName("amount")[0].firstChild.data
zvaluation = zesti.getElementsByTagName("valuationRange")[0]
lowvaluation = zvaluation.getElementsByTagName("low")[0].firstChild.data
highvaluation = zvaluation.getElementsByTagName("high")[0].firstChild.data
zproperty = ({'zestimate':zestimate,
'lowvaluation':lowvaluation,
'highvaluation':highvaluation})
#self.response.out.write(zamount[0].firstChild.data)
except urlfetch.DownloadError:
message = 'There was an error retrieving the Zestimate, please try again later.'
template_values = {
'zproperty': zproperty,
'message':message,
}
path = os.path.join(os.path.dirname(__file__), 'index.html')
self.response.out.write(template.render(path, template_values))
...
SO:
Python ROCKS
Django ROCKS
Appengine ROCKS
I just need to find projects where I can apply this stuff!!!
ps: some people are experiencing similar ecstasy with Ruby (on Rails), more power to you, lets change the world with code…