Monday, April 29, 2013

Pythonista

Having continued in my journey to try to migrate my mindset from that of a Java programmer to one that is Python-centric, I thought that it might be a Good Idea to get a hold of a Python environment for my iPad.

My expectations were very low.  For some reason I just had assumed that Python would get the same treatment as Java - which is to say that any real use would be curtailed, but maybe I could write some code here or there that I could upload to a computer to do something with.

I was shocked and amazed to find that not only does Python run, almost completely, but that it can be used to create GUI-driven iPad applications!

Enter Pythonista - the best $7 that I have spent in a long time.  Within the first day I was tracking multi-touch finger contacts, drawing graphics, using the camera API, performing image manipulation, and playing sound effects.

Mind you, while I am an accomplished Java and perl programmer - I am still a relative n00b to Python - so the idea that I had jumped ahead to performing GUI-based tasks was Very Encouraging.

I think I will stick with this for a while.  Next stop - How do I use Pythonista to drive a mobile connection to a web2py-based application?

Friday, April 5, 2013

Killer...

My deep-dive of Python and web2py has led me inexorably to a very nice learning resource: Killer-Web-Development.com

It is a nice walk-through of the web framework along with a plausible fiction that fills in the blanks as to why you might want to use it.

I am particularly fond of the idea of the "Pitch Application" as this is a concrete real-world example of exactly how these kind of development projects get off of the ground to begin with.

I am presently working my way through this and I find that it complements web2py in that it is thoughtful and done well.

Thursday, April 4, 2013

Insanely Great - Yet Another Web Framework - LOLWUT?

If you are a software developer then the two most unwelcome words that you can hear after the C-word (no, not that one - 'Cyberspace'...what are you, Scottish?)  would be the words "Web Framework".

This is for the simple reason that there are too damned many of them.  About a decade ago the word "Framework" started to buzz and suddenly they were falling out of the sky like dead flies in a DDT cloud.  You couldn't pick up a magazine (remember when we had those?) without coming across at least a half-dozen of them.  Being as it was Universally-Agreed-that-Every-Piece-of-Software-Has-to-Be-a-Web-App there was a perceived need to make the chore of doing so far more simple.  Ironically, the complexity that many of them added eventually ended up doing exactly the opposite.

A lot of them were Frankenstein-like composites of components hastily slapped together without any regard for maintainability.  While the components themselves might have been Best Of Breed - the way that they were slapped together and pushed as a single package was so common and problem-laden that it constitutes an anti-pattern.

Sometimes you just have to start over from scratch.

Being new to web development with Python, it seemed prudent to find a framework.  Having reviewed everything that I could get my hands on, the winner was clearly Web2Py.

The reason for this is simple.  No, really, that is the reason.  It is simple.  It is simple to use, simple to understand, simple to implement and simple to customize.  Anything that can do that can vastly enhance productivity and IMHO that is brilliant.

Some frameworks adhere to a list of standards - usually somewhat begrudgingly - and treat them like a list of features on the side of a software box.  Web2Py has truly internalized them as design philosophies.  It has the benefits of having been designed as a feature-complete project prior to implementation.  As such is it very compact and at the same time extremely forgiving.

If you download the binary distribution you don't need a web server nor a database server nor even a text editor and yet you can be up & running and developing your own web application in under 10 minutes.  Once you are past the point where these rudimentary tools are useful it is a simple matter to introduce web server and database server tiers in a more robust fashion.  However, Web2Py takes the Web 2.0 paradigm to heart and even provides the ability to create and edit applications right in the web based administration application itself.

This means that learning how to use it is a history of building on successes, rather than clumsy mistakes constantly preventing you from getting something up and running.  This is a more encouraging way to learn how to program and that alone makes it better than the competing frameworks IMHO.

Wednesday, April 3, 2013

Where's the Ni!?

Just to pick nits here - one thing that I have noticed about Python is that the documentation specifically states that the language is named after Monty Python and not after snakes.  It goes on to say that Monty Python references are to be encouraged in the documentation and examples.  It is worth noting however that this almost never happens.

Sadly, being a fan of Monty Python, I am disappointed.

I am not sure why this is so, but I am considering making a module that would be replete with Family Guy references - just as an experiment - to see what kind of email responses it would get me...


Tuesday, April 2, 2013

Poking Python with a Stick

I have been crash-coursing Python recently and I wanted to share some thoughts about it as they occurred.  As I haven't bothered to post for a long time - since I tend to get bogged down in the news & politics and other such gloomy bullcrap - I'm going to try focusing on this aspect for a while & see if things don't brighten up just a touch...

I had a few false starts getting going with Python.  There are a few things that leave someone scratching their head.  For one thing - Don't use Python 3.x yet.  (unless you are reading this far in the future)

The reasoning for this is that the Core Python Developers themselves expected adoption of 3 to take 5 years.  However there were performance problems with the 3.0 release.  As a result it is best to reset the clock to the 3.1 release, which was in June of 2009.  Hence, the appropriate time to start considering Python 3.x for production use would be after June of 2014.

But again, why wait so long?  I mean this isn't a complete rewrite like Perl6 - why should it take so long?  The answers have to do with all of the code written for Python 2.x.  There were some fundamental changes that were made that largely deal with making unicode more consistent as well as calling internal functions.  These involved syntactic changes.  As a result - a lot of code has to be rewritten, retested, debugged & rereleased.

Next, there is the question of learning the basic syntax and the flavor of the language idioms.  For this I have been working my way through Google's PyQuick 2 day class, the videos for which are available on YouTube.  Things on YouTube seem to be somewhat fluid, so here is a link to the first of these videos, but you are probably better off just searching for "PyQuick".