Jonathan's Blog

Because journals are for prime ministers and Frenchmen

Principles of Efficiency

Example

There's no time like the present to build automation. I've personally never regretted automating a solution, but I've often regretted doing something manually rather than building a process.

Start working smart now, not later. You'll thank yourself.

Don't do something twice. Cache the result and re-use it; you'll use more memory, but if it saves you an expensive operation (disk, database, network), it'll pay for itself.

When working with developers, remember that they need two things: input, and the desired output. Generally, you should leave the processing in between up to them, that's where their expertise is.

Focus on what's important. Allow the little things to float by with minimal process, that's OK as long as there's enough tracking that you can find out what happened, and when, if you need to some day. But remember that you probably won't.

Minimize mouse movement. The keyboard is almost always faster, as long as you're working with text or data and not images or video.

Be organized. Use the tools you have to organize files (or e-mails, or photographs, or stool samples) into folders, or better yet tags. Never save a file as "Document1"; you might think you'll never need to find it again, but if you're wrong you'll suffer for it.

Principles of Respect for Customers

  1. Do not clutter.

    Don't put crap on users' desktops without asking, and don't even ask at all unless there's a significant likelihood that someone will actually want YOUR app cluttering up their picture of a cat in a boot.

  2. Do not spam.

    Don't have "send me spam" checked by default.

  3. Be secure, but not difficult.

    Don't store customers' passwords in clear text, don't have unreasonable rules on password content, and don't make them get a court order to reset their passwords.

  4. Don't have arbitrary limits.

    Don't assume you know what your customers want to do or how much space they'll need. Don't restrict them to nine header types, 256 columns, or three saved games; let them go as far as they like, or until you run out of memory. If you must set a limit, for example a field length in a database or an integer type in an application, take the greatest number you think they could possibly want and multiply it by two to ten.

Principles of Style

Mixed case is easier to read than all lower case, and all upper case is damn difficult for the eye. Underscores can help break up words, but on the whole PascalCase and camelCase are almost as easy to read, and significantly shorter.

Symmetry is easier on the eye than assymetry, which is why same line opening braces are ugly.

White space is very important, but don't over-do it. Gulfs of white space can make it difficult to see where braces match, for example. Indent enough that you can easily see what's been indented, but not so much that you waste excessive amounts of horizontal space. Remember that a line that runs off the right margin is harder to read and understand, it makes end-of-line comments nearly useless, and does not print well.

Use international standards for dates when coding; use the OS settings when displaying.

Principles of UI Design

Read. Read widely and often, so you can integrate all the good ideas and discard the chaff. Visit a lot of web sites, and pay attention to what works and what doesn't. Two of my favorite sites are Google and Wikipedia: they give me a world of information, in an uncluttered way, and with their search features I can find what I need in a quick and intuitive way, rather than frustrating layers of folders.

Here are a few sites I've found to be helpful:

You'll build your own idea of what works. These are my thoughts.

Principles of Rewriting Code

Document. Expand upon the existing documentation, starting with notes where a comment needs to be confirmed.

Test. Build a testing rig that the existing code passes. You can add more tests later to see if your extensions work, but if the old code crashes when fed character code 127, then build the first test so it only uses character codes zero through 126. Remember that your first priority is to clean up the code without actually changing anything; if you jump the gun and start fixing things before you've refactored and built an understanding of the code, you may break something.

Refactor, using the tests to be sure that you're not breaking anything. Start with small adjustments; when you understand the code better and can confidently say "This does that" you can consider larger changes.

An alternative is to build a clean code layer on top of the old ugly code, if it exposes a decent interface.

Principles of Organization

Organize on the basis of date, but don't confuse names with dates. If a project is named XYZ and initiated on 2001/02/03, that's two pieces of information. Don't conflate them by naming the project "2001-02-03 XYZ".

Principles of Communication and Management

That whole "vision thing"? Yeah, it's a real phenomenon. Sometimes an organization has all the right people in place, and they all know what the problems are, but someone has to stand up and say "let's do this". Whether you're trying to decide where to go for dinner or steering a multi-billion-dollar company, you need a leader to be effective.

An employee will be secure if he knows what he's doing and has some idea as to why; if he has confidence that his boss knows what he's doing; and if he believes that he's making a material contribution to the group. Without these factors, he may worry about whether he's important to the company.

Everyone gets satisfaction in different ways. Some like to lead, others to follow. Some just want to be heard, others are not happy unless their ideas are implemented.

Successful organizations need intelligent people. Intelligent people need variety.

Three things lead to exhaustion: an excessive workload, a lack of hope for improvement, and repetitive work. To get the most work out of your staff, you need to maintain a realistic load and not burn people out; you need to spend at least some time planning for better days, and incorporate your team in doing so; and they need to be able to switch tasks from time to time, ideally when they choose to. For example, switching between blue sky creative thinking, intense problem solving, and zen "in the zone" routine provides a refreshing change of pace.

In communication, consider what the recipient needs to know. Our instinct is to share what's relevant to us, but this is often not relevent to the listener. What does he or she need to know? Give that and don't waste breath on the rest. Note that this is for business settings; in personal correspondence, filling the air is kinda the point.

Each specialty in an organization speaks a different language. Marketing, sales, and engineering are as different as C#, sign language, and ancient Egyptian. A skilled manager learns to translate, and minimizes the risk of missed translation by serving as a conduit between business units. You are the bus, accepting input from each source, performing translation and buffering, and passing on output to each destination.

Parrotting is a simple but effective way to ensure that communication is successful.

Cushion your deadlines. Front-load projects; do NOT assume that things will lighten up later, rather assume that you'll be hit with additional work. If it doesn't happen, you can deliver ahead of time.

Take on the most complex and uncertain parts of a project as soon as possible. If they turn out to be more difficult or time-consuming than you anticipated, better to find out sooner than later. You may be able to negotiate more time or resources.

Feedback is critical. Most customers would rather have a product delivered six weeks late, but get a personal update every other day, than one week late without notice or explanation. Just leeting them know that you're working on the problem will make them feel better.

Other people in your company are customers, too: internal customers. Treat them with as much respect as external customers, and even more openness and honesty.

If you ignore an underling, they'll do some combination of four things:

There are exceptions to EVERY rule.

If it seems absurd, question it. If it is absurd, perhaps it can be improved. If there are good reasons for it to be the way it is, you'll benefit from knowing why.