Thursday 13 August 2009

the Java guy’s Laptop Battery definition of “syntax”

First, when I say syntax, I don’t mean the real definition of syntax, but the Java guy’s Laptop Battery Sony PCGA-BP4V battery definition of “syntax” which means “Curly braces so I know where things begin and end.” To people who come from a bounded language like Java reading Python is like having your eyes fly off a cliff at every turn of a dark road. Really, it’s just something you have to get used to if you want to use Python. Every language you’ll switch to will give you the same problems, but working your way through it slowly will make you a better coder.


Second, the “IBM Laptop Battery” Laptop Battery problem is really different from the syntax for people because what they mean is that they have problems typing in Python code. Usually I only hear this complaint from Emacs users because somehow Emacs fucked up the Python editing mode so that it uses inconsistent tabs and spaces. In Python code mixing tabs and spaces is the death! Yet, here’s Emacs just going at it chewing Python like mad. I usually recommend people use any other editor than IBM ThinkPad R32 Battery Emacs, but if they do, beg for help tuning it specifically for Python first. Getting to where all code you edit in Python is always indented with spaces is important.


Third, the problem people have with Python’s “functions” is actually that they don’t understand the reason behind things like "".join(stuff) or even worse str(mything) which then Sony PCGA-BP2V battery just calls __str__. The problem is in most other IBM ThinkPad R40 Battery languages Objects have methods you access with “.” and rarely do they use multimethods. Python however mixes these multimethods with regular methods, and sometimes inconsistently. This design choice has advantages in that common things like converting to a string don’t pollute the public name space, but the disadvantage is that it is honestly kinda ugly.


If you can deal with these three things Sony PCGA-BP2T battery , then Python is actually very nice and IBM 92P1075 Battery easy. The most important advantage to using Python that I’ve found is that what you want to do and what you end up writing are actually very closely aligned. Given the above “problems” with the language (to outsiders) the end result is actually very readable. Things like docstring comments (if you start a block, don’t use pass to defer it, write the comment) and self for everything (never having to explain scoping is great) just make it easier to see what’s going on

Then I saw James Tauber talking about IBM 08K8197 Battery Pinax but more importantly, talking about how 2008 was the year of modularity Sony PCGA-BP2S battery (he used different words). Apparently, Django has been pushing the idea of having discrete “applications” that act within a “site” as cooperating but separate components.


The idea is that, unlike other “components”, these ones act like decoupled little web sites you can put in and configure for a site, and through the magic of HTTP work seamlessly. From this you can have fully packaged applications that implement functionality you need, like Sony PCGA-BP2R battery authentication, or caching, or tribes without having to gut your whole application and muck around in code.


If that particular component isn’t working well for you, then you can just modify it, or write your own. Since it’s looselyIBM 08K8198 Battery coupled, and you hopefully kept it that way, then the change isn’t too painful.


This change in the architecture of a site from “the site is the application” to the “site has many small applications” is powerful to me. I know other frameworks tried similar things, but since they tried to implement their plugin/module systems through code rather than web plumbing it tends to be more Sony PCGA-BP2NY battery brittle.


 


No comments:

Post a Comment