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?

Happy Easter! He is Risen!

I’m on vacation at the moment.  But I want to wish everyone a Happy and Blessed Easter!  For those of the Christian faith, this weekend is an incredible and potent reminder of God’s sacrifice for our sins, and the Resurrection: the reason why we believe what we believe.  Alleluia!  He is risen!  And for those who aren’t of the Christian faith, I hope you have a relaxing weekend with your family and friends.

When Penguins Can Fly… (An Exercise in Portfolio Building)

No, this is not an exercise in a delayed reaction for April Fool’s Day.  I am not that slow!  Rather I spent most of the weekend in a concerted effort to setup a portfolio and renewing my personal website.  I realize now the reason why I procrastinated to do so for years.  Setting everything up in a systematic manner is difficult and painful.  Digging through folders to find great examples of your work even more difficult.  However the effort was worth the pain.

The blog now has a unique title: “When Penguins Can Fly…”.  I think the title is appropriate considering how much of a Linux fan and of penguins I am.  At little bit of magic in Gimp and I replaced the background for the theme.  Anyone interested in using the theme for themselves, can find it here: Hacker Dreams WordPress theme version 0.1

After that and a bit of fun with the favicon, I started work on setting up the various pages and galleries in my portfolio.  It took a while to try out the various galleries, and I settled on the NEXGen Gallery plugin.  After some futzing around, I managed to setup quite a few nice galleries for the Draw section of my portfolio.  In the future I will need to either find even better art or create more artwork.  However this will have to do for now.  In addition I found an animation I did for a visual computing class that I uploaded to Youtube.

The most difficult aspect is the coding part of the portfolio.  I originally wanted to build a bunch of original apps with new source code.  Unfortunately that will take time that I do not have at the moment.  I will add those when I have a chance.  However for the moment downloads, brush ups of old work, screenshots and screencasts will have to do.

In a rare case, I am opening up the comments to take suggestions.  Please let me know what you think.

Time to Retire My Snowboard for the Season

As part of a struggle to retrieve a lawn chair and folding table, to get some work done will enjoying the outdoors, I stumbled over my snowboard.  This winter–yes I know that officially spring begins in a few days–I managed to hit the slopes for two solid days of snowboarding.  Not enough to gain mastery over my mischievous, knee jarring board but enough to  enjoy a few thrilling rides down the slope.  Like all good things, there is a time to put away some things to start some new aspect of life.  So I put away the snowboard, and after some careful Tetris-work I managed to pull out the folding table.  Plus I found an old pair of sandals, which I am proudly wearing right now… in an attempt to declare this day as shorts and sandals weather.  In a way, I am glad that I can retire my snowboard for this season.

I am also happy that I can retire my resume for now.  Having found a nice new job, means I don’t have to deal with the joys of applying for new positions and dealing with interviews.  I can now concentrate on developing my skills again.  Possibly learning a new language or framework or two.  Most importantly, I can finally catch up on the huge mound of work and projects that I felt undone as I searched for a new job.  I am glad I can  concentrate on this, and not job hunting.  (Note for my friends: this catch-up effort is also the reason I’ve been rather silent recently.  Even by sleeping less, I still feel a tad overwhelmed by the work I have to do soon.)

Finally I am glad that I can retire some of my old bad habits.  This Lent I took the opportunity to retire my gaming habits and my will-do-later-cause-my-me-time-is-more-important.  Not all my bad habits and less than graceful behaviours have gone, however I am glad that this Lent gave me the opportunity to start a new chapter in my spiritual side.  I am glad that I feel closer to God, my Creator, and also my fellow humans.  I wish I could explain the joy I get when I truly try to be thankful for what I have.  And I wish I could explain how letting God into your life, will only increase the joy, wonderment and experiences in ones life.  It makes me sad that I’ve seen a few of my friends turn away from those graces, and I hope that we will return back in time.

Time for me to stop writing more on this post.  There is so much to do, that I feel guilty for not getting back to work.  I hope everyone enjoys a warm sun-filled spring, a productive start to the second quarter, and a blessed Lent!  See you all soon!

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.

The Next Big Thing

I am really excited that I am currently working on my next big project.  I won’t spill any details until everything is setup and ready.  This new project I hope not only will give me the opportunity to work on the technologies I love to work with.  But will also benefit the Linux and open source community as well.  More details will follow soon.

As part of this project, I will be doing some major changes to this site.  One of the major things will be the expansion of my portfolio.  It has been something I wanted to do for a long time.   Now I finally have the opportunity to do so. 🙂

Experiments with Wine Gaming

While I was working last month (and last year), I had the need and opportunity to setup Linux properly on my laptop.  Windows simply did not cut it for remote development.  After a bit of fighting with some graphics issues (yes, I got bitten by the switching between the Intel and Nvidia GPUs) I managed to setup my Linux system fairly well.  Yes, I am missing out on some of the nice, new hardware features on my laptop like the fingerprint reader.  Nor can I get a nice boot experience due to the combination of a strange widescreen resolution, using the proprietary Nvidia drivers and the plymouth splash screen.  Running full-blast with the Nvidia graphics card does not help my battery much.  But I can live with that.

The experience with using modern Linux and KDE can not be understated.  Not having to fight with your system when setting up development environments helps too.  The icing on the cake, was my most recent experimentation with Wine.  Back in the day when I started using Linux, getting any Windows program running nicely under Wine was a minor miracle.  An update could change that in a hurry.  Getting a 3D game running smoothly under Wine… just did not happen.

Now imagine my surprise when I tried to use Wine on my most current install.  After using winetricks a few times, and a tiny bit of experimenting I managed to run nearly all my Windows games under Linux without too much difficulty.  Nearly all my Steam powered games worked, including Deus Ex, Half Life, and Myst.  Even Microsoft games like Freelancer and Halo ran with very little work.  So did Risk and the original Homeworld with very little effort.  And yes Uru Online which is my favourite of the Myst series runs really well as well.  What makes this great–beside not having to reboot to play a game–is that old games will run with little extra effort without keeping some ancient version of Windows lying around.  Also important to note is that none of the games lagged under Wine, just some minor sound stuttering and weird cursor grabbing.  So one can enjoy most of one’s Windows games under Linux without needed to reboot necessarily.

From Inside a Particle Accelerator…

Sometime last year, it feels like the pace of my life accelerated to a phenomenal rate.  I would venture that just before I started working in California was when it happened.  Since then much like a particle accelerated in a linear accelerator, it feels like I am moving forward at a frantic pace.  Maybe it is just me, but it feels like that.  The start of this year does not seem to slow down much either.

Not that I am not thankful for everything that has happened.  Living in the SF Bay area.  Experiencing San Francisco and Los Angeles.  Working on some pretty nifty Android technology, all the while learning more and more.  Seeing one of my best friends get married to the love of his life.  Visiting Poland, Germany, Italy and Austria.  Learning how to windsail.  Getting more involved in writing and editing.  Becoming a lot more self-reliant and independent.  Becoming closer to the people I care about.  These and so much more I am truly grateful for.

There have been painful times and experience along the way as well.  The loneliness of not knowing anyone close in California.  Having to change jobs three times in a single year.  The stress and anxiety that came with those and so many other moments.  But that is all just part of the growing process I guess.  Still the whole life hurtling forward of its own accord, feels unsettling.  Maybe I am just getting old.  Maybe all the bad decisions of procrastinating have come back to bite me.  But it would be nice for life to slow down.

So what is next for me?

Well I am looking for my next gig.  I’d like to get further along on my writing and coding projects.  Hopefully catch up on everything and get some of that “slow down” and “stabilize” going on…