Diving into the Deep End with Python

Where I Stand with Java

Most of my professional experience in software development has centered around Java.  That should be no surprise as I learnt Java in university, and all the trappings that go with it: Javadoc, the Java Standard API, Eclipse and JUnit.  My professional work exposed me to JSP, Servlets, SpringMVC, Struts, JDBC, TestNG, Ant and the Android SDK.  Sure I’ve used other languages such as PHP, Perl, Scheme (mmm… functional programming…), C and Prolog.  The mainstay of my experience is still Java.

All that said, even as I include more and more exotic features of Java as language (i.e. enumeration, annotations, reflection, etc.) and as a platform, I find myself more and more constrained by the language itself.  Sure I feel comfortable with it, and I’ve written code personally that spans tens of thousands of lines.  However I find a lot of the code is boilerplate code.  Heck thanks to JAXB, I can quickly describe a series of classes using a XML schema.  That is right, a XML schema, one of those awfully obscure XML trappings that only enterprise application developers really should ever care about (or those working with complex document-style data).  Also a large Java codebase is nearly unapproachable with anything less than a powerful IDE.  Thank goodness for Eclipse!  (I write this wearing an Eclipse branded fleece jacket.)

Java is a wonderful and powerful language with great tooling.  However it just seems so wrong to have so much complexity.  I fear that this has more to do with the design decisions in the language itself than anything else.

Enter the Competitor: Python

I also learnt Python in university but I ended up using it largely for building system administration scripts rather than a general programming tool.  Instead of fighting with unwieldly BASH or Batch scripts for admin work, I use Python.  And I have created some powerful scripts using Python for tools for hunting down empty directories and rogue files for automated renaming.  After fighting with Java to do my bidding, I felt the need to look for some better language when building my new hobby project.  Also my recent attempts at learning Qt and C++ at the same time, have made me want to first learn the platform and then the language.  This is where Python seemed to hit a sweet spot.

While talking with one of my old university friends, Dan D’Alimonte, the topic of learning Qt came up.  Instead of using C++ for his Qt apps, Dan used PyQt.  After looking at his code, I decided to experiment with PySide and lo and behold I made a Qt app myself!  On the web side of things I heard a lot of good things about the Django web framework.  Hence I started experimenting with and investigating Python, PySide and Django.  In addition to the simple can-I-do-this-with-that experiments, and playing around with the tutorials, I researched the tooling and performance of Python based applications.

I am impressed so far with what I have found out about Python.  Coding in Python is a breeze and enjoyable.  I can comfortably use any text editor to program in Python.  I found that PyDev makes Python development while using Eclipse easy.  Getting new packages for Python is simple, and I do not have to rely on a package maintainer.  The standard libraries in Python are on par with Java’s.  You can always extend Python with a C or Java binding.  Building a desktop app using PySide turned out incredibly easy, compared to the standard C++ way of doing things.  Django is proving to be a very capable, and apparently *gasp* fast web framework especially when run on the optimized PyPy version of Python.  There is even mention of Python being able to build web frontends, at least in the documentation.  And importantly for me, Python has various XML, database layer, testing, and other enterprise and mobile capable libraries that I can potentially use in my day-to-day work.

Now naturally the quirks of a language become more readily visible once you actually start working on a real-life project.  That is my next step.  Then I can figure out if Python could really replace Java as my go-to language.  I will keep you posted once I get further in the project I am working on.  In the meantime, I’ve collected a bunch of links related to my investigation with Python.  Enjoy!

Python Related Links

Hello Again Identi.ca!

It seems that all the cool kids are using Twitter nowadays.  Then again what passes as cool now sounds more like either being different for different sakes.  Or that you use or do things that are “cool” or trendy or interesting to the mass public at the moment.  Rarely the cool, trendy or different thing is actually interesting or innovative or world-changing as much as it something that is well marketed.

As for myself I’m on Twitter because there are a lot of people that are not on my favourite microblogging platform: Identi.ca!  With Twitter being a bit more accessible on my Android smartphone and the smaller crowd on Identi.ca, I sort of stopped using it for a bit.  However that will change.  I prefer Identi.ca because it is libre software and my data is not held hostage in some corporation’s database.  I’ve updated my Identi.ca handle, wired up my microblogging widgets back to Identi.ca (and Twitter).  Now I plan on using it more often, and pushing my blog updates through Identi.ca first and then on to the other three popular social media that I use.  If everything goes as planned y’all should be able to read this post in a few moments after I publish it… right now. :)

Does Complexity Necessarily Translate Into Capability?

Two months ago I started work as a Java developer at Bluerush Media Group.  Shifting gears back into Java EE/JSP/Servlet and mostly backend work from Android development definitely took a while.  On one hand my work now is hidden behind layers and layers of servers, middleware and other “businessy” systems.  I definitely miss being able to have my work appreciated by many people.  Now only my fellow developers can compliment or complain about my work.  But on the other hand, I enjoy working with tested and tried technologies and platforms.  No more worrying about inconsistencies between devices.  No more fretting about what systems I communicate with.  No more frustrating moments of dealing with performance and optimization issues.  Instead there is more than enough computational power lying around that automation and abstraction become powerful tools to approaching and solving problems.  I feel less guilty about using some crazy library to configure itself, gather the necessary data and build part of the system for me.  In short, as with everything in life there are pros and cons to my work.

Just recently I discovered the joy of using JAXB.  It is mindbogglingly convenient to build entire packages of Java model classes from a single XML schema, and having JAXB handle the serialization and deserialization of Java models into XML and back again.   Using JAXB, some XML configuration files, a TestNG suite and some result data in CSV form, I could build out a pretty sweet and rather involved automated testing setup.  This let me run real stress tests on the application I am working on and letting me flesh out the code much faster and with greater confidence.  Or take the use of dependency injection from Spring or Guice, to help a developer initialize a large number of objects with complicated dependencies without getting lost.  The amount of automation and abstraction in Java EE is simply overwhelming.  However it does come with a price: complexity.  So while using the full power of Java EE and various libraries gives my applications a lot of capability, they also make the applications terribly complex.  It only gets more complex, the more “enterprisey” the application becomes.  There is simply no way I could even build the applications that I do, without having lots of complex tools such as a full-on IDE like Eclipse.

This brings me to the point of my post.  At same time as I delved further into Java EE, I am getting more and more interested in Python and Django.  After playing around a tiny bit with PySide building Qt apps in Python, and looking into Django I am surprised by how terse yet functional Python is.  Yes, Python being a scripted language will never outperform a compiled program (or even byte-code compiled Java app) in terms of performance.  But looking at how much computing power is available and how many more steps it takes to write a Java or other compiled source app… I wonder if programming in something like Python can not be more efficient.  What I am especially curious to find out is if one can build and maintain a large complex web app as one can in Java EE, but in Django and Python.  Basically I am curious of the capability of an app is proportional to its complexity.  Or is this just an illusion from living with a language and platform that lets you easily craft monolithic monsters?  Can one get the same results with good architecture, some smart engineering and a flexible language?

Website Hosting Migration

You may have noticed the recent changes on my blog & portfolio website.  I am in the process of migrating my websites, domains and what not to a new hosting service.  A nicer hosting service provider who doesn’t support SOPA/PIPA for one.  Plus is much more responsive and nicer to work with.

Anyways a lot of things are up in the air.  Especially since I am still transitioning in terms of my new work.  Plus I am working on a grey op (not quite black) project, that I plan to reveal shortly.  Please excuse the sporadic changes and some issues might pop up while I get everything sorted out.

Upgraded to WordPress 3!

Well after a long wait, I finally upgraded to WordPress 3. Amazing is all I can say. However rather than doing a simple upgrade, I decided it was time for a fresh install. Just in case, and to get rid of any old configurations or scripts that might cause problems. I still plan on adjusting the theme and fixing the categories which magically exploded from some reason.

News – Google Chrome for Linux, Thunderbird 3.0 & Malware for Ubuntu

Dorian is currently concentrating on writing and getting things ready for Christmas.  So in the meantime, here are some new stories to tide you over:

Hmm… The Future Feels Clean

So do you like it?  The theme on the website that is.  I decided to go with a variant of light greys, royal blue-purple and amber highlights.  It does have a spartan, minimalistic feel but I like it.  I considered rebuilding the theme as an ExtJS or jQuery UI powered on.  But honestly, this works and IMHO looks pretty good.  For a theme that doesn’t use any images.  I plan on tinkering with this theme as time goes on, but I think I like this theme as a base.  As promised, I will go through this theme, clean things up and release it out in the open once I’m done.

Whats next on my list?  Well a good chunk of work, and some partying this weekend to celebrate the coming of the end of the year.  :)

A Clean Future

The future is white?

Bob, the future has been white since the 60′s.

- Autotainment, Big Ideas

The future has been white for a long time, thanks to the likes of Stanley Kubrick and the folks at Apple.  Thats why the theme I’m crafting for this website, is called “Clean Future”.  I took the “Open Sourcerer” theme by Alan Lord, and modifying it until it suits my tastes.  I’m still debating whether it will look like a glass UI or hand-drawn doodles.  Maybe I’ll go all out and create a full AJAX powered UI.  We’ll see.  I’m sure it will remain white and light grey.  And I’ll take it as far as I feel it makes sense to do so.  So if anyone has any suggestions feel free to leave them in the comments below.  I’ll make the modified theme available once I finish working on it.

Tech News – Canonical Bringing Music to Ubuntu, LH Strikes Again & Affero GPL Can’t Fix the Cloud

Canonical Launching a Music Store?

Rumours on the world wild web point to the possibility of Canonical building an iTunes-like music store.  Works for U thinks such a move would add another viable revenue stream for Canonical, even if it seems to stretch the resources of the firm.  If this music store comes to Ubuntu, I’m sure many users will enjoy using it.  And it will help Canonical start a community of artists, musicians and software firms to using Canonical and Ubuntu as a platform for selling content and applications.

The Linux Hater Tries Karmic Koala

No one knows who hides behind the LH mask.  Is he an enlightened but disgruntle Linux programmer?  Or is the king of all trolls?  Who cares!  Read up his (or her) review of the “fail” that is Ubuntu’s Karmic Koala.  You’ll get a kick out of it.

Kubuntu Needs Documentation Help

nixternal (Richard Johnson) calls for help to improve the sad state of the Kubuntu documentation.  If you are a tech writer and enjoy using Kubuntu, please help out.  UPDATE: You should know how to use DocBook to help.

Affero GPL Can’t Fix the Cloud

One of the great opportunities and threats for commercial open source is the emerging cloud computing landscape.  However Matthew Asslett (451 Group) points out the Affero GPL doesn’t negate the threat of no monetary contributions from cloud providers to commercial open source vendors.  Yes it doesn’t.  But the licenses were designed to get  source code contributions from developers.  Business models need to focus on selling value (some scarce resource based on real scarcity not an artificial one) to clients, and some clients will not see the value.  There will always be those that get away.  The Affero GPL does help “guide” most cloud providers contribute back.  If anything the GPL will give more freedom and opportunities for many more smaller players than a few large ones.  And that solves many more economic and social problems than anything else.

News – Chromium OS is Here

Chromium OS is Here

Google just announced their Chromium OS project.  This will act as the open source precursor to Chrome OS.  And the folks at Canonical are helping Google build it.  Exciting times ahead, especially for netbooks users and cloud computing advocates.  Thanks to the 451 Group‘s Matthew Aslett team for posting about this.