Monthly Archives: February 2008

Reading habits

Recently I’ve noticed that the consequence of learning to skim text to obtain information at a glance and hop to quick conclusions is actively working against me.

I’ve been trying to approach math and a number of comp sci subjects and always ended up subconsciously thinking “I can’t understand this by looking at the shape of the explanation, so obviously I’m lacking some basic understanding. I’ll learn that first and tackle this later.” Would you be surprised if I said that “later” rarely happens?

The problem is, I hardly know how to read succinct text any longer, having gotten used to wading through reams and reams of text to find the relevant bits. Damn you, Google.

Recognition is the first step towards rectifying though. So. I’m going to try to tackle this by learning to read slowly again.

Client apps, anyone?

Businesses all want web apps.

Web apps have a couple of obvious benefits: no client-side deployment, always available barring network outages. A lot of people perceive web apps as automatically having better usability too.

However, the pain of being restricted by the environment and having to deal with the quirks of different user agents (if you’re like me and only ever learn things the hard way) makes me wonder. Is there a market for client-side development in business software any more?

Arguably, constraints make people more creative. The things some people do in JS (a vi clone and a mini unix environment for example) are proof that the problem is mostly my lack of patience and discipline. Still, the state of the art in web app GUIs is crude compared to something like Gtk or Windows.Forms.

X-UA-Compatible

Am I missing something obvious here?

If a site layout breaks because of IE defaulting to its newest rendering engine, would it be so damn hard to add the meta tag to the affected pages?

At least it would send the message that doing things wrong is considered the exception, not the norm.

I know, I know. Pipe dreams.

Inconsiderate URLs

I really hate it when people go write interesting, thought-provoking or otherwise relevant stuff and then post it on a site with an URL like “the-gay-bar.com.” Do you have any idea how hard it is to link to you when you do that?!

The reason I’m saying this is because I just posted a link to said site on my Software Engineering Methods course forum. I’m fairly sure not many will dare click on it, despite my insistence that it really is not a shock site. 😛

(the link in question being to the article UML is not what most managers and software “architects” think.)

The State of Things

Today’s Java class was interesting. One of the assignments was to parse lines of something that was expected to be Java code, and strip out all comments that begin and end on a single line. That is to say, block comments that don’t end on the same line should be left as-is. String and character literals shouldn’t count as starting a comment block, and so forth.

I read the description, and had two near-simultaneous thoughts:

– Despite the instructions that hint at writing a method to find a comment and another to delete it, this clearly calls for a state machine, and
– the two programming courses available so far don’t equip you to deal with a problem like this. At all.

I wrote my comment remover test-first. I’ve written state machines before, but it’s been a while, and I was fairly sure I’d make a mess of it if I did it any other way.

There was another person there who had written a state machine, but not tested it, and I can fairly safely assume it didn’t handle its corner cases as well as mine (given it was entirely untested). Aside from him, we saw one implementation that clearly didn’t and couldn’t work — kudos for trying though — and also demonstrated a severe lack of understanding of the fundamentals. Which is in line with what I’ve seen so far — the course steers clear of actually trying to teach anything.

Strike one.

Another exercise was to describe what to do when you have a constructor, MyClass(MyClass other) that should copy instance values from “other”, and “other” is null. Exceptions were clearly expected (no pun intended), but the guy from before — the one who thought inheritance was there to allow access to member variables — was convinced that just letting a NPE happen when dereferencing would spare us from doing anything ourselves, and provide a “clear and helpful error message.”

Strike two.

Afterwards, a fellow student asked for clarification on variable scoping. He thought that if he introduced a variable in a block and then called a method, the variable would be visible in the body of the called method too.

Strike three.

I’m going to sing the doom song now.

The Real Thing

For some reason, this scares the crap out of me:

When I say debugging, I don’t mean some wimpy debugger where you have to type and explore by using command line and it just let you break on certain line. VS or Ruby in Steel is real thing, you get everything, you can click on objects and see all the properties, if there is deeper level, you click on the plus and explore it deeper.

(The quote is from a blog post titled Ruby in Steel first experiences.)

Clicking on objects in a visual environment is the real thing now?

Joshua Bloch on closures in Java

I’m going to have to digest this for a while, but I very much suggest anyone serious about Java programming take a look at Joshua Bloch’s JavaPolis ’07 talk on adding closures to Java.

An especially interesting tidbit was how complex Java generics really are. I haven’t actually used them much except as a consumer of collection classes, so I had no idea they’re so complex it takes an over 400 page FAQ to explain all the corner cases. Sheesh.

Edit: if you want to read the FAQ, I suggest the FAQ website instead of the PDF which has hideously ugly (to the point of almost unreadable) fonts.