March 2009

Chad Austin's 10 Pitfalls of Dirty Code

tung's picture

I recently bumped into a programming-related blog entry by Chad Austin, father of Sphere and a member of the IMVU team. Entitled 10 Pitfalls of Dirty Code, it first lists the ways code can turn sour:

  • unclear or too many responsibilities,
  • overly complicated or obscure control flow,
  • concepts that don't map to the domain,
  • too many dependencies,
  • global state,
  • or duplicated logic.

Then he goes on to list how bad code can bite you back:

Read more »

Tetris HD

tung's picture

Tetris HD, posted on IndieGames.com.

This must be seen to be believed.

Took me 17 minutes to get my first line, which itself took 1 minute to play its disappearing animation. Took me 52 minutes to lose the game by holding Enter, and 8 minutes to try to die on purpose.

Illuminating the stack backtrace, just a little

tung's picture

The following is lifted from a post I made over at the Spherical forums, about reading a backtrace to do something other than panic and tear out hair.

There was a problem with trying out the zlib routines on Linux, but I fixed them, and here's how.

I added sfxr.cpp and ssfxr.cpp to the engine's SConscript, and zlibengn.cpp to common's SConscript. That got it to build under Linux with scons.

Attempting to run engine with DeflateFile() got me a long message, including this stack trace.

======= Backtrace: =========
/lib/libc.so.6[0xa7bd6ee4]
/lib/libc.so.6(cfree+0x9c)[0xa7bd87bc]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0xa7d9e971]
./engine[0x80cea6d]
./engine[0x80d07bd]
/usr/lib/libjs.so(js_Invoke+0xa92)[0xa7f6c33f]
/usr/lib/libjs.so(js_Interpret+0x7184)[0xa7f7390c]
/usr/lib/libjs.so(js_Execute+0x2f6)[0xa7f796d9]
/usr/lib/libjs.so(JS_EvaluateUCScriptForPrincipals+0x90)[0xa7f40a37]
/usr/lib/libjs.so(JS_EvaluateUCScript+0x43)[0xa7f40abc]
/usr/lib/libjs.so(JS_EvaluateScript+0x68)[0xa7f43785]
./engine[0x80bae4c]
./engine[0x8053b9f]
./engine[0x80e04aa]
./engine[0x80e09c6]
./engine[0x80e0d1a]
./engine[0x812b905]
/lib/libc.so.6(__libc_start_main+0xe5)[0xa7b816c5]
./engine[0x804d4f1]
Read more »

The community moderation problem

tung's picture

There was a Stack Overflow blog post today about Hacker News's lack of downvoting, and how that was bad. There's a great discussion of it over on Hacker News. As a matter of fact there is downvoting, but it's not very evident from a cursory glance.

Both Stack Overflow and Hacker News feature user voting. Users can vote on links, questions, and comments posted by other users. The votes add up for the user, which in turn lets them do more with the site. With the vote systems, the community can decide what's on and what's not. It's community moderation.

Read more »

A rush of blood to the Sphere project

tung's picture

This is me, on the Sphere forums, January 31 2009:

[Sphere is] basically a software engineer's nightmare.

I wish I could share your bright-eyed optimism, but with the amount of effort required to understand, modernise and lead the project in new directions, it'd be much easier to start from scratch and make a new project with similar goals, which would have the added benefit of using up-to-date technologies and simpler project management.

This is me, on the same forums, February 25 2009:

I'll try the compilation fixes that kamatsu was doing myself. When I get it working, I'll put it in CVS right away.

What changed?

Read more »