general coding issues - coding style...

Diez B. Roggisch deets at nospam.web.de
Sat Feb 18 09:18:11 EST 2006


calmar schrieb:
> Hi all,
> 
> since I'm just a 'handicraft'/beginner or so,
> 
> could anybody provide me with some (rough) hints, about how to enhance the code
> here:

  - why are these {{{ thingies there?

  - use string interpolation like "Foo %s %i" % ("bar", 1) instead of 
concatenating strings.

  - it seems that you could benefit from a class instead of a bunch of 
functions & few globals. No need to go too crazy about OO, but it has 
its merits

  - try using something like glade - creating GUIs by hand sucks 
big-timer :)

  - read up about unicode and encodings, what they mean and why and when 
to use what. Really. Most problems in that field stem from people being 
sort of ignorant on that topic and just wiggling themselves through all 
the time - in the end, messing up stuff. It really _isn't_ that complicated.

  - when creating string-keyed dicts, the idiom

    dict(foo="bar",
         baz="pillepalle")

has its merits.

Besides that - looks ok to me.

Diez



More information about the Python-list mailing list