Sunday, October 15, 2006
I'm tired and exhausted from spending days with this on my mind, so I'm not writing much. I just wanted to ask, is anyone from the area? I see there is no User Group near Houston, at least not listed at the Wiki. Does anyone know of one or would be interested in starting one?
Any tips for long (1700 mile) moves?
Saturday, October 14, 2006
The following code creates a simple class with one property descriptor (read-only). It solves the requirements that with to instances of this class, a and b, id(a.x)==id(b.x) can be true while a.x is not b.x! How does this happen?
x = property(lambda s: id(s))
a = foo()
b = foo()
assert id(a.x) == id(b.x)
assert a.x is not b.x
How on earth does this code prove what it does? a.x and b.x are created on the fly, passed to the id function, and then destroyed with no references left. Because they are both created in the right order with the id(a.x)==id(b.x) expression, they just happen to get the same memory addresses, which in CPython is used for the id function's result. This leads to misleading results, so don't rely on them in such ways. Identification is what it is, and you shouldn't try to break it down.
Thursday, October 12, 2006
All around me I see people relating Python and Ruby. The communities seem somehow intertwined with their users, usages, and publicity. It seems like you can never find a blog that talks about one without the other, or a new frontier being tested by one of the "new" languages and not being explored by its counterpart. Where do people see this distorted similarity between two languages that are as different as night and day?
To Rubyist out there, don't take offense. I have far more experience with Python, than with Ruby, so I might sound biased. Please, take this as an honestly unbiased opinion. I'm just talking from the middle in this case.
Python stands out from most of the other languages around. Largely it is understood as "the language without brackets", but it is not entirely alone there. Ruby almost appears like a language extremist. Their core types have fifty million methods each, because if you expect it to be there, it should be there. Python is important, because it explores the methods a language can encourage good coding practices onto developers. Ruby is vital, because it explores interesting constructs like continuations and compact code forms utilizing their quirky syntaxes. Both might have their place, but they are far different places. Python is unassuming. It will take nothing for granted, such as not taking for granted that you wanted a method call, not a call to a function in some method. Ruby is assuming. It understands the difference between objects and types, just based on the casing of the name.
Fuzzyman states a similarity between the languages, but can this be taken as anything more than common usage? We can see an assumption of similarity across both communities, but nothing really ties them together anymore than any languages are connected by virtue of all being languages.
I've been known at times to seem like a Python zealot and anti-PHP/Perl/Ruby, but in this case I'm setting that aside and I want to state very clearly: these two languages are not similar. They are very different beasts, with more differences than anything else. The illusion of a relation between Ruby and Python only harms both of them. We have people asking for continuations in Python constantly, when they are a great idea in Ruby, but would not likely work well in this very different environment. Rubyist get attacked by a barrage of Rails killing Python projects, trying to take their steam.
Shouldn't we go our separate ways?
Wednesday, October 11, 2006
Striving for the goal of Beautiful Code, we can find ourselves lost on the way to actually writing something that gets the job done. Throwing away perfectly working code, because an alternative way to achieve the same results is more elegant isn't something that we might see as a bad idea. If the code is more l33t now, it will give us less trouble tomorrow when we need to port it to my toaster. We'll use anything to justify the overworking for code beauty.
Is it always worth it? How beautiful is enough and when are we just wasting our time (and money)?
There are terms thrown around like "elegant" and "pythonic" to measure the quality of code with no attention to the code actually reaching the goal it sets out to perform. The code may work, but that doesn't make the code good code. Without a sense of time, scale, and the big picture, the search for good code can overshadow any good developer's work towards working code.
However, as any issue as a flip side, those developers getting lost are doing so in the name of a good fight: the first against bad code. We might get lost and never complete our code, or complete it late, but we do so with the complete belief that it was worth it. The code took several weeks longer to develop, but just look at how beautiful it is. Without the struggle for good code, our working, bad code would eventually overshadow us just as much and consume our time with maintenance, refactoring, and the mother of all frustrations in coding: trying to read your own work.
I am wrapping up some SOAP-heavy work and the path to completing it has been a testimony to the struggle of balance in code. Recent refactorings of the actual SOAP response processing ended with a good chunk of bad code. I don't like the way I'm doing lots of things, or the fact that it doesn't parse corner cases the service I'm using doesn't even use. The code is not the beautiful code I would like to call my own, but the code is working code and does everything it needs to do. I had to bite my own hand to keep the refactoring to a minimal and focus solely on the aspects of functional goals, ignoring aesthetics.
Be careful on the road to good code. Somewhere along the way, you can easily get lost and never reach the point of having actual, working product. Sure, the code will be incomplete, but it will be a fragment of beauty. Learn the value of a completed mediocre code set over the eternal development of more beautiful code, which does exactly the same thing.
Monday, October 09, 2006
Today I denounce my fellow gamers, and I call out to those of you with any backbone to stand with me in decrying those among us who, basically, just make us look bad.
The subject of debate is a recent survey making statements about the percentage of females among the online gaming community. The surprising results state that 64% of online gamers are female, and the response to this news is just as surprising: outright denial. Male gamers seem completely impossible to accept that they are not the majority of gamers, while they have been simultaniously complaining about the lack of female gamers for years.
Apparently, someone forgot to include a requirement that they be "real" gamers.
Over at the popular gamer blog and online comic, My Extra Life, the story was given with a note of disbelief and the commentors followed suit. Reading through the comments, you can see such Male Stereotype Improving comments as the following samples:
- The survey sounds fishy, unless they included "free games that are in the browser or games like second life." It still sounds fishy.
"No. I am a minority darn it!
I will not play with 64% of other women!
Maybe its a typo, maybe they meant 64% of gamers are kids.."
- "women under 16 years of age sound like dudes"
- "I agree.. 90% of them are playing bejeweled right now."
- "they’re not the kinds of games correlated with the “gamer” title"
I had my say over there, so I'll quote myself now: "I am disgusted by my fellow gamers’ responses at this announcement. I have heard nothing but denial, attacks on the survey, insults towards are female gamers, and downright insulting behavior coming from my demographic. We have to find all sorts of reasons why the survey is inaccurate, or counted things that “aren’t real games”, because we aren’t man enough to admit to not being on top of something we long thought was our own. Get a life and just admit the truth. It doesn’t matter if you play Halo or Scrabble, and its sexist and degrading to assume thats the only kind of game those women would play. Degrading to other male gamers, who have to be lumped in with the deplorable comments being made around here.
Of course more women would play online games! Lots of women love to game, but its not like they can play among other gamers face-to-face. When’s the last time you treated your buddy’s girlfriend as an equal in a game of Halo? No, she goes on as a handicap. No one takes her seriously. So, what is so to do to satisfy the thirst for games? Play online, where no one even realizes she has breasts. That’s why 64% of online gamers are women: because you don’t know and you hunt them down in Counter-Strike just as ruthlessly as anyone else."
One of my best friends is more of a gamer than I can claim to be. I just can't justify spending as much on games as he does, and my buddy has three times as many kids as me. His wife can't hold her own against the worst of us on the old Halo nights (which I miss so much), but she could kick my butt in a game of online poker or a few rounds of guitar hero.
Besides all the response making me ashamed of my fellow male gamers and wishing I could avoid the association until this blows over, I found the comment about Second Life to be pretty confusing. I understand why you don't consider a Scrabble game on Yahoo to be a "real game", even though I don't agree, but Second Life is one the greatest acheivements in gaming history. What gives, traveller18?
Ironically, when I sought out some stock photos for this post, over at stock.xchng, I turned up both of those photos of girls gaming, but not a single one of a male gamer.
Sunday, October 08, 2006
Several weeks ago, I contacted Michael Foord (aka, Fuzzyman) about the idea of a simpler, slimmed version of his Movable Python distribution for those interested in the language, and often not computer literate enough to put up with all the different components you need for any decent development environment. This is exactly what we need to convince those people still hanging on to BASIC.
I don't know if its from my suggestion, although I got a personal e-mail from Fuzzy on the announcement, but its here and its free and its exactly what I need for the many interested people I am trying to bring Python to.
I was a little late in the Blogscene, which is a relative statement given that most of the world doesn't know what a blog is, despite the fact that most bloggers think otherwise. I started with my trusty KDE's Akregator, which is admirably usable, and then looked for a web-solution to use better from multiple boxes and a laptop, right around the time the first Google Reader was released. I jumped on board, and I loved it. Right off the bat you have your entire reading queue, waiting for you to read through one post at a time. Read, hit the j button, read, j, read, j, j (I skip things, a lot), j, j, j, read, j, read. If I had a backlog, I could just pick labels or subscriptions to read first and be on my way until I had time to read less important things. The key is it was simple. Most of the time, I only ever used a single button: the j. It was fast, showing just what I was reading and a few things coming up on the list. Thanks to (possibly accidental) details of the implementation, I could scrollwheel over the reading list and pre-load hundreds of articles, so that I could read them offline in my web-based reader! Again, best of all, it was simple. It did all this and it was clean, and simple. God, it was simple.
Google, use your many brains. I don't know how you could have messed this up so badly. It brings up an interesting question: is it OK to compete with yourself? They say that the new Reader meets the middle-ground between what everyone wants, but does that mean it doesnt actually fit what any one person wants? Re-release the original as Google Quick Reader or something.
I'm sorry. This post was badly written. Call it a rant. I just miss my reader.
Friday, October 06, 2006
This is the first in my weekly post of interesting links around the web. These are articles, websites, services, photos, and anything that else that I want to bring up on my blog, but can't use an entire post for. Being on any aggregation sites makes you think harder on each post and puts some weight on you against those little posts, at least in my mind.
Hopefully, you'll enjoy whatever I post here. Maybe you'll find a useful site, or learn something you wouldn't otherwise.
Really Smart Stuff
Ross Jekel, over on the Python 3000 mailing list, supported the existance of the GIL (Global Interpreter Lock) in a very clear paragraph). This came from a thread (yet again) about the possible removal of the GIL for Python 3.0, which will almost definately not happen. Instead, the most weight seems to be toward improving the effectiveness and productivity of multi-process or multi-interpreter-in-one-process communication to offset call between interpreter boundries. Awesome stuff if it happens!
After some initial surprise when I learned about it, I'm now okay with a GIL or even single threaded python (with async I/O if necessary). In my opinion threaded programs with one big shared data space (like CPython's) are fundamentally untestable and unverifiable, and the GIL was the best solution to reduce risk in that area. I am happy the GIL exists because it forces me to come up designs for programs and systems that are easier to write, more predictable both in terms of correctness and performance, and easier to maintain and scale. I think there would be significant backlash in the Python development community the first time an intermittent race condition or a deadlock occurs in the CPython interpretor after years of relying on it as a predictable, reliable platform.
Really Cool Stuff
In my effort to professionalize my blog, snazzy it up a little, and a general interest in having cool things to look at, I found stock.xchang, a free stock photo exchange website. There are great photos available there, and when I get my camera working again, I will definately be contributing to the collection.
Sometimes you just gotta say "Wow." I had a little trouble with the prototype applet running sluggish and buggy, but watching the demo video is just amazing. The software will extract 2D shapes into 3D models and allow you to extrude, cut, reshape, and just do some amazing things with an interface so simple that a kid could, and has, use it. Makes me want a touchscreen all the more, so I can have extra fun playing with this.
Really Quick Stuff
I want to think my help is appreciated. I happen to know it is. There is an increasing number of regulars, learning their way through, who explicitly seek me for help, send me entire projects to look over, and generally befriend me in response to the advice I give them. I try not to think highly of myself, but I do believe I am valuable to that channel and that many others would agree.
A few, however, seem to hate my guts. A growing minority of users are continually harassing me over my methods of giving advice. They have a problem with how I talk to people that ask simple questions, even with those people not being them and happily taking my advice over the complaints of these few difficult IRC'ers. What they seem to have a problem with is my tendency to answer questions with questions, investigate why someone thinks they want to do what they ask how to do, and suggesting other ways to reach their goals that may be better than what they came seeking.
This is not a technique of myself alone. Python has a strong community of developers with strong opinions. It is not unusual for people to ask about threads and be told that Twisted, separated processes, or Stackless is better. If someone asks how to set a variable with a name in some string, they aren't told about globals() and locals(), but to use a dictionary instead, and usually will be given a small talk about how all variables exist in dictionary, including the globals and locals, so there is no overhead in this and its a perfectly good thing to do.
People aren't given a gun to shoot themselves with. They are given advice not in answering their question directly, but delving into the source of the question and solving the problems that lead to their asking a question, although sometimes misconceived.
Is it wrong to assume you know someone shouldn't do what they ask how to do, and tell them something else instead? Does anyone have the right to insult and verbally abuse those who practice such techniques of helping others?
Does anyone have thoughts on this? Lending a hand is important, so we should be doing it right.
- November (3)
- October (1)
- September (2)
- August (2)
- June (3)
- May (2)
- February (1)
- January (5)
- November (4)
- October (1)
- September (2)
- July (1)
- June (5)
- May (2)
- March (1)
- February (1)
- January (2)
- December (7)
- November (1)
- October (2)
- July (4)
- May (1)
- April (5)
- March (4)
- February (2)
- January (6)
- December (6)
- November (8)
- October (5)
- September (10)
- August (4)
- July (3)
- June (18)
- May (31)
- April (9)
- March (1)
- February (11)
- January (7)
- December (5)
- November (7)
- Spilt Mind
- Uprooting and Replanting
- Identity Comparison vs Comparing Identities
- RuPy, Snakes and Rubies, Night and Day
- Balence, Tranquility, and SOAP
- You Go, Gamer!
- Movable IDLE: Keep it Free, Fuzzyman!
- Google Reader Upgrade Dissappoints
- Stuff of Interest - Week of Sept 17 - 23, 2006
- Being Helpful by Not Answering Questions
- September (11)
- June (3)
- May (7)
- April (11)
- March (7)
- February (8)
- January (7)