Aug 28
There are a couple of things I would like to try if I’m going to start a new project.
- Use a good code formatter. I’m a two spaces indentation guy. I think four spaces indentation is a total waste of screen real estate. No, no tab. Everybody should know that by now.
- Start using test fixtures from the beginning. It’s surprising how my last two projects end up the same path – first helpers and then refactor them to fixtures.
- Choose a template based GUI framework such as Wicket or GWT instead of Struts. Damn I hate XML files. I didn’t think it’s a good idea when it first came out. But everyone loved it. Now apparently everybody is staying away from it. People! Listen to what Simon says!
- Avoid bloated DTO if I ever have to use it.
- Write unit tests instead of functional tests. Make more use of stubs and mock objects.
- Keep the members and methods sorted. It makes it easier to browse the source code and for version control systems to merge.
Aug 24
Assigning a collection to another collection is okay in most cases. But today I encountered a case where the assignment doesn’t quite work. See the following block of code.
class Foo {
private Collection aCollection =
new TreeSet(new SomeKindOfComparator());
public void setACollection(List aCollection) {
this.aCollection = aCollection;
}
}
The intent is to keep the collection sorted and avoid duplication. But as soon as the assignment in the setter happens, the instance variable aCollection’s reference is changed to be the List. There won’t be any error or exception at either compiling time or runtime. You will be wondering why that collection is not sorted and contains duplicate entries.
Aug 23
The Shaw installation guy came over last Friday to connect the cable for my new house. I can not believe that I’m saying this. But it was one of the best services I ever had.
First he found out that there was a gas leak at my gas meter when he was working outside of the house. As he got into the basement, he noticed that one of the windows was not locked. Then he discovered a small cut on the skin of one of the wires coming into the house. After he finished connecting the cable, he moved on to the smart connection centre, which is on the opposite side of the room. I started telling him that I’m going to put a router there. He said, “But you don’t have any power here.†Damn! I wish he was there when we did the electrical selection. To solve the problem, he left me an extra long cable to connect the modem and router until I buy an extension cord.
On the other hand, Telus won’t be able to connect my phone line until the 27th. When I called to cancel my ExpressVu service, they said they need a 30-day notice. Give me a break! I only need two weeks to quite my job.
Aug 10
I didn’t get too much done today because I spent a couple of hours trying to set up our development environment on my MacBook. Most of the stuff worked except the database. It turned out that Oracle hasn’t released a database server for Intel Mac yet. Most of the open source databases won’t work either because their syntaxes are not Oracle compatible. The only thing that comes close is EnterpriseDB. But for some reason our table creation script doesn’t work very well with it. I hate the idea of using VMware or Parallels. So I’m pretty much stuck with using Oracle on a remote box.
This unpleasant experience brought some complaints out of me:
- How hard is it for Oracle to release a version for Intel Mac? It could be just a developer or preview version. Plus, it already works on Linux, doesn’t it?
- What happened to ANSI SQL? Isn’t it supposed to be the standard?
- Our application is quite Oracle dependent. It’s not necessarily a bad thing. Experience tells me that it’s unusual for an application this size to switch database vendor. But it still would be nice if our database layer could be truly portable.
Aug 08
Our brilliant BA, Gord, had a brilliant question the other day. He said, “If Safe Mode is what Microsoft suggests you to boot into when you have trouble with Windows, does it mean that the normal mode we are using everyday is the Unsafe Mode?†To be honest, I never thought about it at all. Linux has the similar idea but it’s called Recovery Mode. Even Microsoft has a Recovery Console for Windows XP. So I don’t believe this is just a marketing gimmick. My bet is that Microsoft truly believes that the Safe Mode is safer for its users.
Aug 03
10 Things Java Should Steal from Ruby should be a nice read. I might have a separate entry about it. This entry, though, is about something I came across in the article – a Smalltalk refactoring browser. Yes, refactoring does not have to require static typing! Does it mean we can do it with Ruby, too? The answer turned out to be yes. Check out Ruby Refactoring Browser. It’s still in a really rough stage. It looks like that it can only be used with Emacs. But it’s promising. I hope more people will pay attention to this project. It will definitely attract more developers to Ruby and bring Ruby closer to enterprise world.
Aug 02
Just have to change the theme because the one I was using is exactly as same as Scott’s.
Aug 01
Thanks to Jeff, I’ve pimped my Safari. Now I have no reason not to like it. Thanks dude.