?

Log in

No account? Create an account
Re: Python - The Mad Schemes of Dr. Tectonic [entries|archive|friends|userinfo]
Beemer

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Re: Python [Aug. 20th, 2008|11:17 am]
Beemer
My this kool-aid is tasty and refreshing!
LinkReply

Comments:
[User Picture]From: annlarimer
2008-08-20 05:32 pm (UTC)
The best thing? You only need a couple of sips.
(Reply) (Thread)
[User Picture]From: ocschwar
2008-08-20 05:46 pm (UTC)
Long live interpreted indentation!
(Reply) (Thread)
[User Picture]From: furrbear
2008-08-20 07:48 pm (UTC)
Yeah, makes Perl feel so COBOL-ish
(Reply) (Thread)
[User Picture]From: dr_tectonic
2008-08-20 08:17 pm (UTC)
I still like Perl. I suspect I'll end up using Perl for script-y things and Python for object-y things. (And wish that Tcl/Tk was available for UI-ish things.)

It's more like, how does anyone cope with the horrors of lower-level languages like C, where you actually have to do memory management by hand?
(Reply) (Parent) (Thread)
[User Picture]From: furrbear
2008-08-20 08:41 pm (UTC)
The times I've seen UI work done in Tk, it always had a "Roll-your-own" flavor, but it's been a number of years since I looked at the language.
(Reply) (Parent) (Thread)
[User Picture]From: dr_tectonic
2008-08-20 08:49 pm (UTC)
Sadly, Tk isn't pretty on the screen because it's badly in need of about a decade's worth of updating. But the code is gorgeous.
(Reply) (Parent) (Thread)
[User Picture]From: furrbear
2008-08-20 09:16 pm (UTC)
Then that aspect hasn't changed. Yes, that it is.
(Reply) (Parent) (Thread)
[User Picture]From: nematsakis
2008-08-20 09:42 pm (UTC)
You must have seen this xkcd comic, right?

I ♥ python. Like any language, it has its warts*, but it's fun to program in and I'm glad I switched my research language from Java to Python (not that it helped me get finished any sooner). For advanced fun, look at list comprehensions, generator comprehensions, and generators. My programming tends to be very mathematical and involve data transforms so I use these all the time. Decorators also seems like a really powerful construct, but I haven't had occasion to use them much.

* Python 3(000), coming this October, removes a lot of these.
(Reply) (Thread)
[User Picture]From: dr_tectonic
2008-08-20 10:04 pm (UTC)
Haven't gotten to generators yet, but list comprehensions are quite nice.

I think I like perl's closures better than python's lambda function, but casual introspection from the fact that functions are objects too seems pretty keen.

But Python >> Java, for sure.

I'm getting over the whitespace thing. It helps that Dive Into Python is up-front about it and says, "After some initial protests and several snide analogies to Fortran, you will make peace with this."
(Reply) (Parent) (Thread)
[User Picture]From: backrubbear
2008-08-24 01:50 am (UTC)
I'll heartily second these observations. List comprehensions are a very natural way to program, especially if you did a lot of perl. Maps and lambdas may be made for people happier with LISP but they're still very helpful for me.

Decorators, on the other hand, make me weep. It's not that they're not useful. We have a lot of decorators used for factory patterns in code at work that has no real need of factories and it quintuples the effort to debug the bloody code.

Least favorite python gotcha: Variable behavior for global variables in non-global scope.
(Reply) (Parent) (Thread)
[User Picture]From: jofish22
2008-08-21 02:27 pm (UTC)
Don't your teeth feel white and shiny? And all the colors are brighter in the world? Lovely, innit.
(Reply) (Thread)