Oct 2007

Lines of Code

Haskell magician Don Stewart echoes my own opinion on lines of code in his Haskell Workshop demo on xmonad:

A couple of nice refactorings happened when we found data structures that fit better, and you dramatically drop down in the number of lines of code. So we use lines of code as a bit of a heuristic for working out when code sucks. If something gets really big, it probably needs to be rewritten.

I’m staring at a 60,000 line code base right now that I’m positive could be under 30,000 lines of code if it had a good rewri… erm, refactoring. Sometimes when you can’t figure out what’s going on in a function that’s a thousand lines long, the best solution is to rewrite the thing in a hundred lines instead. (And that time, I really did mean rewrite, not refactor.)

Update: Steve Yegge writes a good essay about code size, and believes that “the worst thing that can happen to a code base is size”. (If only he applied that principle to his blog posts as well…)

Comments

Raganwald on Geek Attitude

Reg Braithwaite has said very eloquently something I’ve been meaning to express for a long time:

When someone says something outrageous, like “f*ck compilers and their false sense of security”, it is not important whether I happen to think that programming languages with strong, expressive type systems are valuable (hint: I do). What is important is to look at this statement and ask yourself: Is there just one thing in there, one kernel of wisdom that I can extract and use to be a better programmer?

I wrote about geek culture and criticism earlier, but Braithwaite knocks it up a notch and hammers the point home in a single paragraph. To use an analogy, being a good geek is like being a good partner in a relationship… step one: listen. Step two: empathise. (Step three: profit!)

Comments

All's Well That Eats Well

In the past two weeks, I’ve been wining and dining it up indeed…

  • 30th of September: Dinner at Capitan Torres in the CBD, one of the finer Spanish restaurants in Sydney. Their paella and grilled octopus tapas are godly, and their chorizo is ohhhh mmmmm yumm.
  • 1st of October: High Tea at the Gunner’s Barracks in Mosman, with stunning views of Sydney harbour, lovely tea, and a perfect 30° day.
  • 5th of October: Lunch at Forty One at Chifley Plaza; $35 for melt-in-your-mouth salmon, and stunning views from 40 levels above Sydney (even from the bathroom!)
  • 6th of October: Breakfast at Echo on the Marina in Roseville (near Echo Point park). An excellent place on the North side to go to for brekky; for the Eastern suburbs yuppies, I also love Trio at Bondi Beach.

All this after recovering from a ski trip where I had the best cabernet savignon and raspberry strudel in my entire life (thanks Matt)! Of course, I’d also interspersed fine restaurant samplings with visits to the best gelato place in the entire freaking world. So life ain’t too bad right now.

For the Sydneysiders, remember that October is Good Food Month! Make sure you check out the Let’s Do Lunch deals, where the best restaurants in town do $35 lunches. (Well, except for Tetsuya’s…) There’s also night noodle markets markets at Hyde Park… sigh, what a shame I’ll be off to Singapore this month and will miss out on the festivities. Oh well, I suppose heavenly dumplings, $2 chicken rice and chilli crab will have to do instead; boo hoo, O woe is me, etc etc.

Comments