Entries from April 2008 ↓
April 20th, 2008 — development, python
This weekend I was helping out a friend when he pasted me some of the code from his latest project that happens to be written in C#:
(the only change I’ve made was to rename the identifying feature to XYZ)
namespace XYZ.Core
{
static class Entry
{
static void Main(string[] args)
{
using (Game game = new Game())
{
game.Run();
}
}
}
}
I know that monitors are getting bigger and bigger, but vertical space is still a precious commodity, so let’s try turning the above code into something that looks more like
namespace XYZ.Core
static class Entry:
static void Main(string[] args):
using (Game game = new Game())
game.Run();
This code is shorter and easier on the eyes, and I’m even ignoring the whole issue of having a class that simply has a static void main, as the authors of the cool Boo language point out, the people who came up with “public static void main” were kidding, it’s just that a few million Java/C# programmers didn’t get the joke.
For those of you that didn’t know where this was going, the above is just a few steps away from being valid Python (or for you .NET junkies perhaps Boo). Other people have addressed the myth of significant whitespace and I won’t go into great detail here, but I will say that Python essentially injects INDENT/DEDENT tokens that function in the exact same way as { and }.
What is often used as an argument against Python and other indentation-scoped languages is therefore really an advantage. {} are no more useful than the human appendix or other vestigial structures, the only reason that modern programming languages have them is that they inherited them.
If languages like Java/C# thought it was a good idea to free themselves of explicit memory management why not also free themselves of useless syntax that does nothing but clutter up code?
This divergence seems to only be growing wider, with languages like Python already free of these vestigial quirks, whereas languages like C++, Java, and C# continue to make their syntax more and more obfuscated. (eg. the tortured C++ lambda syntax)
This discussion on what syntax could be thought of as vestigial sparked some debate, some other potential candidates others suggested include the ++/– operators and PHP’s use of ->. I’d love to read comments with examples of other developers favorite vestigial syntax.
edit: A commenter over on reddit points out that the Lisp community had this right years ago. It does say something that one of the oldest languages is so free of the cruft that the traditionally more dominant curly-brace family has adopted. The idea that those who forget lisp are doomed to reinvent it is surely at work here.
Popularity: 9%
April 13th, 2008 — development, personal, python
If you’re one of the 20 or so regular readers, you noticed that the theme here just changed. I went with something a lot simpler than the other theme. Hacking on the previous theme became tiresome, I’ve switched to the much more generic copyblogger that is known for it’s clean code and therefore is easy to bend to my needs. Another mistake I made with the previous theme was not keeping my changes in revision control, so now all my changes are in a bazaar repository. If you have any trouble with the new site post a comment here and I’ll take a look at it.
I also wanted to take a minute to plug Steven Jackson’s blog here, which has been added to the blogroll. I should have had this on here earlier, he’s one of the developers I correspond with the most, and someone I run ideas by constantly. Most of his content is gamedev/gamedesign related. I know Steve from my sordid past as an member of the amateur game development community, he’s a freshman in college but has a pretty impressive skill set, and is one of the most determined developers I know.
As he mentioned on his blog I was working with him on an entry in PyWeek 6 which I’m sure even though it was my idea was somehow his plan to get me back into gamedev. Neither of us ended up having the time we would have liked to complete our idea, but we’re still talking about following through on it. It gave me an excuse to learn Pyglet and Cocos, two excellent python libraries. Most likely something (whether it’s our initial game or not) will come out of my having picked them up.
(This would also be a time to give a shoutout to his indie gamedev shop, Snowfall Media, that he’s set up with one other developer.)
Popularity: 6%
April 9th, 2008 — RIT, development, politics
This past weekend I had the pleasure of attending the (fantastically organized) Rochester barcamp 3 on the RIT Campus.
A barcamp is basically a group of knowledgeable people that get together and give talks on subjects that they care about. It’s quite possibly one of the coolest things I’ve had a chance to be involved in the entire time I’ve been at RIT. (I didn’t hear about the first one, and last year I was out of town)
I was originally going to give my talk on Django, maybe sprinkling in a bit of discussion on political data, etc. if I had time. Around midnight the night before Barcamp began however I decided to toss out my presentation and start from scratch. What I ended up with was in my opinion a lot better. 95% of the people at barcamp are technical, but I realized hardly any would be political.. this in my opinion was a problem.
Of course, one might think it would be risky giving a political talk at a tech-oriented event on a tech-oriented campus. My audience was on the small side, which was to be expected, and also brilliantly illustrated my first point: most of us are apathetic.
I only had 30 minutes, so my discussion on why people are apathetic was limited, but it led me to the discussion of a vicious circle wherein apathy fosters bad government which in turn fosters further apathy.
I closed the talk with examples of what developers can do which I grouped into two broad and somewhat overlapping categories: software to get people involved, and software to get people information.
Going beyond the obvious examples of flash mobs, blogs, wikis, and the like, I discussed several projects like the UK-based PledgeBank and WriteToThem. These are projects that push individuals to get involved by encouraging either collective action (in the case of PledgeBank) or in the case of WriteToThem getting people to do more personal than sign their name to what are typically meaningless e-petitions. (think “303,222 email addresses against Genocide in Darfur”)
I also pointed to examples of sites that aim to give people more information. Django creator Adrian Holovaty’s new site EveryBlock is a great example of just getting as much information as possible out to people and letting them do with it what they like. There is also the Sunlight Labs project EarmarkWatch which is a hybrid of sorts as it not only makes it easier to look at details of federal earmark spending, it also encourages citizen involvement due asking citizens to help research earmarks. The very idea of researching an earmark on your own is empowering, and can also be seen as an approach to get people more involved in at least questioning government.
(Disclaimer: I was lead developer on EarmarkWatch, although my thoughts here do not necessarily reflect those of the Sunlight Foundation)
Wrapping up my talk I asked the developers in the audience to make use of the massive quantities of government data that is out there. Or at the very least keep in mind the social responsibility that they have as being part of a uniquely skilled class with the power to control the machines and software that dominate so much of our everyday life.
The last slide ends with an equation: Django + Political Data APIs + Barcamp = ?
The discussion stemming from this talk actually led to a second talk later in the evening, where we attempted to answer this question. We ended up having a 3 hour discussion on how a few developers from RIT most with no former political experience could move on a project that will “change the world.”
Expect to hear more about that in coming weeks.
v1 of the slides that I gave (I’m working on an update as these were done in about an hour)
Slides in OO.org format
Slide overview in PDF format
Popularity: 6%