andrewducker: (Default)
andrewducker ([personal profile] andrewducker) wrote2010-08-07 07:27 pm

Coding Fun

I've spent the afternoon playing a bit more with Google App Engine/Python.

So far it's ok - the language is simple enough, and I can make it do the bits and pieces I want so far. The main thing I miss is static typing and intellisense - everything takes so long when I have to keep looking up help files rather than having intellisense present me with a list of useful options, and the lack of type mismatch checking means finding type mismatch bugs at compile time, which seems pretty silly.

I'm also baffled as to why there's both a datetime type and a struct_time type. You'd think that something as basic as date/time representation would be baked in...

[identity profile] momentsmusicaux.livejournal.com 2010-08-07 06:59 pm (UTC)(link)
Python's ace. List comprehensions in particular.

[identity profile] johnbobshaun.livejournal.com 2010-08-07 07:57 pm (UTC)(link)
Python's nifty. I use it for a bunch of automated tasks on our webservers. XML generation and making image thumbnails, for example. Amazing the amount you can get done in about fifteen lines of code.

[identity profile] markpasc.livejournal.com 2010-08-07 08:08 pm (UTC)(link)
If you'll permit me: datetime is the new one (as of 2003) and is crossplatform, comprises real classes with methods, and has all the features you want for dealing with real dates and times (except for time zones, which are supported as a concept but no actual time zone objects are provided—ugh). The time module, where struct_time is, is Python's interface to the OS's time library, so it's all functions and in some places can vary between platforms.

IME you rarely if ever have to use the time module and should always use datetimes, especially in a high-level environment like App Engine.

[identity profile] markpasc.livejournal.com 2010-08-09 04:58 pm (UTC)(link)
Ah, I see! Feed Parser requires only Python 2.1, so it's probably written without datetime so it doesn't require 2.3 (that 2003 release) or later.

You're welcome!

Coding Fun

[identity profile] call-waiting.livejournal.com 2010-08-08 07:49 am (UTC)(link)
I have to say that in comparison to most other languages I've ever come across, Python is just a lot more *fun*.