Blog of Rob Galanakis (@robgalanakis)

Relearning python, part 7: Which way is up?

Weeks after beginning python, I have hit a forest on a plateau- the speed of learning and discovery has slowed, and I’m getting confused and discovered.  I’m beginning to think I won’t finish my current project- I am sure deploying it on a server is going to be another exercise in frustration and hope I can even make it to that point before my life gets busy.  Here’s what I’m struggling with.

1. Changing my mind.  I was very much in the habit, in the static-typing world, to declare simple immutable data types.  This seems unnecessary and uncommon in python- instead, use dictionaries.  This makes sense- the onus of immutability is on the caller in python (in general), and the dynamic nature means having those simple data types doesn’t buy anything over a dictionary (especially if you use a bunch-like object, you will probably want to write your own though).  The problem is that a) this makes refactoring more difficult- this sort of linking is where static typing shines, so changing- and then removing- these data types is never ‘foolproof’, just quick and sometimes with minor breakages that unit testing hopefully finds.

2. Unittesting.  I am writing tests and actually enjoy it.  And I am getting better.  Mostly my problem is with running tests.  I am struggling along the spectrum of everything manually (set up to run the .py file with the tests run if __main__) and completely done through the IDE w/ nose (pycharm -> Python nosetests).  I actually found out a lot of my tests weren’t being run, somehow.  I’ve now switched it to be the manual setup, so I can have better control and learn more about what’s going on.  That’s a problem with convention-driven systems, I guess, is that the implications can get too confusing for noobs like me.

3. Web programming.  I didn’t approach this project correctly.  I bit off way more than I can chew.  New technologies are fine with new concepts, usually, but I’m using new technologies that use ‘old’ technologies, so the beginner-oriented tutorial material I need is not there.  So it’s been incredibly frustrating.  I now have my ZeroMQ-based service running, with a JSONRPC CGI service to field requests from my pyjamas-created web UI.  I feel I’ve acquired a dangerously unfocused lack of information about way too many things (socket programming, CGI, RPC, javascript, etc.), and the system is held together with bubblegum.  Maybe not, but I feel that way.

I am struggling more from not having people to ask questions to than I am because of anything to do with python or the web.  Part of the problem is I’m so unfamiliar with certain things that I don’t even know what questions to ask.

I look forward to starting at CCP and having people to field more general python questions, and I also feel myself getting over the hump and getting a hang of the web stuff enough to actually make something.

One thought on “Relearning python, part 7: Which way is up?

  1. […] did it.  As I was finishing yesterday’s blog post, I finally got my project working, and exposed on the internet.  Now I that things are finally […]

Leave a Reply