Archive for February, 2006

Feb 23 2006

Django Hates Magic?

Published by Chris McAvoy under Python

Django is destroying the magic.

This isn’t new news, but it’s only recently started to weigh on me heavily. Sure, as a committed Pythoniac (Pythonista? Blah. I’m a Pythoniac) I understand that “magic” is yucky, and needs to be removed.

That said, the magic-removal branch makes me think that Django is explaining the card trick, or killing Harry Potter, or burning down Disneyworld. DON’T BURN DOWN DISNEYWORLD DJANGO!

Keep on with your bad selves Django-nauts, the magic-removal (oops, do you hear that kid crying? He just heard Django is killing Harry Potter) branch is good stuff, and needs to be done. I eagerly await its release, however, I’d like to humbly suggest a name change.

How about “Django goes Electric” or “Make my funk the D-funk” or “Can you smell what the Django is cooking?” Anything is better than the removal of magic. Django is supposed to be about magic! Remove that magic, and you’ve just got a green website. Keep the Magic! Remove the crap!

No responses yet

Feb 22 2006

Getters are Evil?

Published by Chris McAvoy under Python, Agile, Ruby

Yikes.

Consistently behind the curve, I just only recently started reading Martin Fowler’s Bliki.

This morning’s article on GetterEradicators confused me. He’s defending the use of getter methods from those that think that getters violate OO encapsulation.

Huh? They do?

I operate at a pretty basic OO level, I admit to not being the world’s greatest object designer, but getters violate OO? That’s news to me. I’m glad MF is defending the use of getters, as I’m pretty fond of them.

He does point to a bad pattern that I’m relatively guilty of, objects that contain only data. I do this a lot. Then other objects manipulate them. I got into the habit of building SQLObject classes to encapsulate my data, and then building other objects with has-a relationships to those SQLObjects.

That habit came from my inability to figure out how to use SQLObject as a true Object, rather than a wrapper around a database. I’m still a little fuzzy on how you can treat a SQLObject object as a full blown object, complete with methods that manipulate self.whatever.

ActiveRecord objects let me throw in as many methods as I please, with access to self. It’s cut down on my data only objects pretty significantly, which is a good thing (according to MF).

I’m gearing up to do some more SQLObject based work, after a several month hiatus. I think I need to spend some time figuring out how (if it’s possible) to build SQLObject’s that include data manipulators as well as just data. Otherwise, I’ll fall back on my has-a pattern, which I’m not “against”, but feels less clean than having a single object that knows my data, how to manipulate it, and persists it in a database nicely.

No responses yet

Feb 20 2006

So Many Bees

Published by Chris McAvoy under Ruby, BeeSim

I set up a Trac page for the handful of projects I’ve released out to the world. The one I’ve been messing with most recently is a Rails implementation of my favorite “make a bunch of bees fly around and gather nectar” project that I’ve part-way implemented in Perl and Python.

The overall projects page is at http://projects.lonelylion.com

One of the somewhat clever things I’m trying to do with this latest Rails’d version of Bees, is to use the Firefox / Safari canvas object.

I can’t believe how much basic geometry I’m forgotten. How do I find the distance between two points? How do I find the angle between two points? Given an angle and a distance, what’s the second point?

Yikes. I’ve been scouring the internet looking for a free resource to catch me up, but I can’t find any. If anyone has any advice, I’m all ears. Otherwise, I’m going to hit the used bookstore to see if they have any 8th grade geometry books.

No responses yet

Feb 16 2006

Feeds Were Stale

Published by Chris McAvoy under Blog

The feeds for this site were stale…sorry about that feed readers. I had some old cache that wasn’t cleared when I moved the site to a new host. I didn’t realize it until this morning. Welcome back.

No responses yet

Feb 13 2006

Twisted Network Programming Essentials

Published by Chris McAvoy under Python

I posted this review to the ChiPy wiki yesterday. I’m pretty happy with this book. It’s well worth a purchase if you’re at all interested in learning Twisted.

Twisted Network Programming Essentials by Abe Fettig

I’m always tremendously impressed with anyone that really understands and uses Twisted. It seems somehow magical, and hard to understand to me. I’ve tried multiple times to learn the framework, and haven’t had much luck. I’ve been hoping for an O’Reilly Twisted book for a long time now, so it’s pretty exciting to finally have one in my hand.

I was initially surprised at how slim the book is, it’s only 236 pages. I expected a giant door stop of a book. Instead of trying to cover the entire scope and breadth of Twisted, Fettig goes with a much more “recipe” like approach to learning Twisted. Each chapter covers a different part of the Twisted framework, with specific examples of how you can use it to address a particular server issue.

All in all, I’m happy with this book. I was able to write a basic http proxy server, which I plan on expanding for a project at work, as well as a mail server that I want to use for some mailing list functions. Fettig does a great job of cutting through a lot of the difficult areas of Twisted, and present us with good examples to give us a jump start on the steep Twisted learning curve. I do wish that this book was closer to 500 pages, and included comprehensive API documentation. Twisted is a big framework, and really deserves a definitive “tome” style book. I’m still really happy with this book, and am glad to see Twisted getting some attention in print.

No responses yet

Feb 10 2006

February ChiPy Meeting

Published by Chris McAvoy under Python

ChiPy met up last night at Thoughtworks in the West Loop. Ian gave a preview of his upcoming PyCon presentation, tentatively titled “Web Programming without the Programming.” It was an interesting talk about all the support stuff associated with a successful web app. He covered testing, source control, deployment, and shared mistakes he’s made in the past.

Adrian showed us the process he went through to reverse engineer the Microsoft Outlook web frontend. He wrote a scraper for the app, and fronts it with a POP library, so he can use his thick Linux mail client to get at his work email. It was fun to see the steps he went through. Adrian is a really talented speaker. He’s pretty good with computers too. The source for his scraper is at http://www.holovaty.com/code/weboutlook/0.1/

No responses yet