Console shell advancements since 2000

I always get surprised by how far the Windows console shell has progressed since Windows 2000. It’s no zsh, but it’s certainly tolerable. I wish the syntax to the tricks were a little more consistent, but I guess they were operating under backwards compatibility constraints.

Today, I learned that the Windows shell has the equivalent of the UNIX pwd. For Windows 2000 and up, %CD% always evaluates to the current directory. My thanks to Google and the blog entry about getting the current directory on Windows.

Naming factory methods: create() or newInstance()?

A coworker recently brought up an entertaining question, although we both agreed that it was unimportant overall: what do you name your factory methods?

Some observations:

  • The java.xml.* package uses newXXX() for the factories, e.g. DocumentBuilderFactory.newInstance(), DocumentBuilder.newDocument().
  • The java.xml.* package uses createXXX() for the builders, e.g. Document.createXXX().
  • java.lang.Class.newInstance().
  • java.lang.Array.newInstance().
  • Design Patterns, the GoF book, uses createXXX().
  • .NET uses System.Activator.createInstance().
  • COM uses CoCreateInstance().
  • The Wikipedia article on Abstract Factory uses create.

We traded some ideas, but we soon found that the criteria we used were often too vague or hard to use. In the end, we agreed that create was probably the best for everything, because:

  1. It’s a simple rule, with no exceptions, i.e. avoid thinking effort on something so minor.
  2. createXXX() is more versatile than newXXX(). There are cases where newXXX() sounds a little awkward (perhaps because “new” is an adjective)

createXXX also follows the common principle that method names are verbs, class names are nouns.

A fun exercise, but I hope no one actually spends that much time on issues like these – rather, I wish people didn’t, since I know some people do.

UniBall Signo Bit 0.18mm Pens

I really don’t know why I like writing utensils so much, especially since I type far more than I write. Yet I have about 50 different pens (and a few pencils) each with its own set of characteristics: gel, ink, non-smudge, waterproof, good heft, low friction, and colour are just a few examples of why I’ve bought them over the years. From past experience then, it’s no surprise I want one of these:

UniBall Signo Bit 0.18mm Pens


World’s thinnest ballpoint pen…thinnest possible lines you could ever write. It’s quite fine. It has some sort of special ink for reducing friction so it won’t clog. It’s not super-flowy like a normal gel pen but it allows you to make sharp and precise short lines, which is what I suspect it was designed to do (i.e. for writing Japanese characters (see circle in picture with writing between lines of text), or alternatively adding fine details into drawings).

  • Go to Random Post

  • Recent Posts

  • Recent Comments

    Ressie Nuncio on Getting Dell 1700 laser printe…
    GJ on Slow XPath evaluation for larg…
    Osvaldo on Slow XPath evaluation for larg…
    GJ on Slow XPath evaluation for larg…
    GJ on Slow XPath evaluation for larg…