[ Content | Sidebar ]

Archives for Programming

refactoring twists and turns

(Warning: really boring post follows. This is what’s been on my mind today, but Jordan will probably wish that I would go back to talking about Java.) There’s this big monster class that I’ve been dealing with at work almost ever since I got there. About a month or two into my job, I had […]

a few last Java comments

A few random thoughts about Java (to get out of the way so I can stop boring Jordan): I’m not thrilled with the whole checked/unchecked exception thing. Checked exceptions, to be honest, seem like kind of a pain to me: they make your code more verbose, but I don’t yet have reason to believe that […]

generics in Java

One of the things I was excited to learn about in the new version of Java was how they added generics to the language. I didn’t expect it to be as powerful as C++ templates: that amount of generality, with its associated complications (e.g. having to separately compile separate instantations of the same template, or […]

const, and iterators

One thing from C++ that I miss in Java is the notion of ‘const’. As I commented earlier, I’m always worried when I return an object that I’m exposing too much of my internals. If I had const to help, it might not be so bad, because I could return const objects, but I don’t […]

almost everything is an Object

One not very graceful aspect of Java: everything is an Object, except for things that aren’t. (A few basic types: integers of various sizes, floats, booleans, characters, maybe one or two other things that I’m forgetting.) Why is that? The reasons must have something to do with making operations on those basic types more efficient, […]

java: what is an object? what is a variable?

This is the first of a series of Java posts, occasioned by the fact that I’m doing some Java programming for the first time in a few years. When I first started using C++, I thought that its insistence on supporting objects that aren’t held via pointers was, frankly, a little weird. The languages that […]

the programming bug strikes

On my way home from work today, I bought a (two-part) Java book. Nice to see that there’s a decent book out already covering Java 5 – typesafe collections are a good think. And I also got an XML book, which was actually written by a friend of mine; I’m sure it’s no Lambda Expressway, […]

organizing information

Whenever you rip a CD with iTunes, it looks up information about the contents of the CD in Gracenote’s CDDB: as hard as it is to believe in this world of digital information, a CD contains no information about its contents other than the number and length of its tracks and, of course, the music […]

kent beck

I just finished reading Kent Beck’s Smalltalk Best Practice Patterns. Not because I’m about to start programming in Smalltalk – it would be an interesting language to experiment with, but I’m way too busy for that right now – but because I really wish I could program like Kent Beck. This book had a couple […]

virtual functions and access control

I was just reading Exceptional C++ Style, by Herb Sutter, and one of the recommendations (Item 18) threw me for a bit of a loop. That item talks about access control for virtual functions. (We’ll ignore destructors, since that’s a special case.) My habit is to provide public virtual functions if I want all of […]

refactoring milky video games

My house has been struck by plague. On Tuesday, Liesl stayed home; on Wednesday, Liesl and Miranda stayed home; on Thursday, Liesl, Miranda and I all stayed home; on Friday, there wasn’t anybody else to pass the cold to (the dogs don’t get colds from us, fortunately, and they stay home all the time anyways), […]

layers and observers

Here’s a question that’s come up at work over the last week or two. A couple of us are trying to rehabilitate some unmaintainable code that’s currently in our product: trying to bring it “From Mud to Structure”, as POSA1 puts it. The obvious pattern to start with is is Layers: we’d like to separate […]