CHAPTER 1

image

Project Organization

Well begun is half done.

—Aristotle

Aristotle was exaggerating, but I’m sure his point, way ahead of its time, was that without the right beginning your software development efforts may come to naught. If you organize the project well at the start, keeping it on track will lead to success. In this chapter I explain the essential determinants of success, how to make sure they’re in place, and how to keep your project focused on them. Then I touch a bit on two practical matters: how to stay out of legal trouble and how to get paid.

People Determine Success

This book has the word “application” in its subtitle for a reason. It’s about writing programs to be used by people, which is what applications are. The implication is that the success of your application development is entirely determined by whether people are satisfied with it.

That’s right. Even if your database is in third normal form, your PHP is object oriented, your HTML uses CSS (Cascading Style Sheets) to separate form from function, you use the latest Agile processes, and you’ve chased down all the bugs, it won’t matter if the people for whom you built the system aren’t satisfied with it. It goes the other way around, too: if they are satisfied, they’ll call your work successful even if you know it comes up short technically.

So, given that people determine success, it’s obvious that there are two things you absolutely need to know: who these important people are and how to satisfy them.

Who Are the People?

The people are your application’s stakeholders: whoever hired you, direct users, recipients of reports, the CFO who’s expecting cost savings, the CEO who’s expecting better efficiency, IT (information technology) people running systems you connect with, and anyone else who has a stake in the success of the project. It’s a mistake to take too narrow a view of users, probably encouraged by today’s emphasis on “usability” or “user friendliness.” Those are important, but many of the constituents you need to satisfy will never use the application directly, and may not even ever see it running.

For example, when I started working on a student information system for the Richardson (Texas) School District, I first met with the IT director, who sketched the project for me. The next day I met with his immediate staff of three people who had been struggling with an outside vendor since the start of the school year, when they first started using a new system. Months later, at a meeting that included the assistant superintendent of elementary schools, it turned out that what they wanted from me was a simpler system just for elementary report cards, which, of course, I said I could build for them. We called it Rgrade (R for Richardson). As I got into the design for this new application, I met with more IT staffers, some teachers, two people who ran the servers in another building across town, another assistant superintendent in charge of assessment (a very big deal in Texas), and a few other people whose names and titles I never quite got.

Who in that list had to be satisfied to make my project a success, in priority order? You need to prioritize, because, of course, you can’t satisfy everybody, at least not completely. Who had to be satisfied first, second, third, and so on?

Well, the first rule is that you most need to satisfy whoever hired you and pays you. (In Latin class years ago I learned that Roman soldiers were always paid directly by their general, never by the politician-controlled government, so the general could be sure they would be loyal to him.)

But, what would satisfy the IT director? He didn’t give a hoot about any of the features of the system, how easy it was to use, how much it cost to run (within reason), or anything else technical about it. I don’t know if he even cared whether the kids got graded. What I gathered from that meeting with the elementary school assistant superintendent was that the teachers were upset with the existing vendor’s system, and she wanted peace. The IT director wanted peace with her, since he’s the one who had put in the current system they disliked so much.

So, the next constituency to satisfy would be the teachers who would be using the system. My list ended there; there was no third or fourth priority. The server people didn’t matter, as long as I didn’t bug them too much. The IT staff members were irrelevant—they would be happy if they never heard of elementary report cards again, ever. As long as the report cards got generated, the assessment guy was happy.

The point of the story isn’t to present a formula for how to prioritize satisfaction or explain how school districts in Texas work (probably impossible anyway). The point is that, for any project, you have to come up with a complete list of all the people and understand what each of them wants, how their wants connect (IT director is happy if assistant superintendent is happy, which she is if teachers are happy), and how to maximize satisfaction.

Another example: I was vice president of engineering for a company that made a system for optimizing supermarket checker schedules, called SuperSked, which was sold to large grocery chains, such as Safeway and Kroger. This was a mostly off-the-shelf product, not a custom job like Rgrade. All of our customer interaction was with the operations department at the headquarters of the chain. The system was used by someone on the store manager’s staff, but we never met any direct users. Grocery profit margins are notoriously slim, so the labor savings provided by SuperSked were significant. That’s all operations cared about. Of course, the system had to be usable, but ease of use made no difference. If it saved money, the stores were going to use it, even if it meant entering data with the tip of their noses. Who did we have to satisfy? The operations departments.

Each case will be different, so you have to dig deep. Don’t guess.

How to Satisfy?

Knowing who to satisfy isn’t enough, though. You need to know how to satisfy them. Computer people call that “how” the requirements. It’s simple: if the requirements are right, and you meet them, the people you need to satisfy will be satisfied, and the system will be a success. If the requirements are wrong, you’ll satisfy the wrong people or no people, and either way you’ve failed.

I’ll talk much more about requirements in Chapter 2, so I’ll just discuss them at a high level here. For Rgrade, they were easy to articulate: the teachers wanted to have a single, easy-to-understand form that they could put the grades into, choose teacher’s comments from a list (the district didn’t allow free-form comments), and have report cards pop out in English and Spanish. The report card format was already defined, as were the Spanish translations of the comments. The output requirements were obvious: same report cards as they had last year and every year before that. As long as it did the job, what mattered most to the teachers is how quickly they could get the grades in. They usually did this work late in their workday, or even at home, and every minute spent on it was a minute taken from something else they’d prefer doing. Maybe lesson planning or helping students, or maybe watching football and drinking beer. But never Rgrade.

How about the input form, though? What should it look like? Well, I made it look just like the report card. It looked so much like that report card that the teachers needed almost no training at all. They thought they were typing onto the card, just as they might have when they used paper reports. All user interfaces implement models, and in this case the perfect model was easy to discover.

I did do two other things that I knew would be necessary to keep the teachers happy, even though they never mentioned them. First, I arranged for the system to be hosted by the people who ran the district’s servers, so it would be available 24 hours a day. Second, I asked for a lot of processing power, to make sure the system wouldn’t get overloaded. There were three high-end servers, one for the database and two for the application, with a nifty load-balancer at the front that sent web requests to whichever application server was least heavily loaded. That turned out to be overkill, but nobody in the IT department cared. Their definition of happiness is an empty backlog of trouble reports.

It sounds like a slam-dunk success situation, right? It does? Satisfying a few hundred put-upon Texas teachers who deal with the little monsters all day? More of a three-pointer than a slam-dunk! It only seemed simple because I covered the two essential steps: identify the people who had to be satisfied, and then figure out how to satisfy them.

Indeed, there were people who voiced their ideas for the system I was building, but I knew many of those ideas, especially from the IT department, wouldn’t appeal to the teachers. I was an outside consultant, so I listened to these people. But then I ignored them. I only worked to satisfy the IT director who hired me and the teachers. Nobody else mattered. If you try to please the wrong people, which is easily done if they’re the people you see every day, you lose.

(If you’re using an Agile methodology, with a customer on your team who tells you what user stories get implemented, you’ll fail if that person doesn’t accurately represent the customer who has to be satisfied. Too often the actual team member is someone from IT or a product manager, because the real person you want is unavailable.)

For SuperSked, what would it take to please the IT departments at the grocery companies? Yes, SuperSked, but only indirectly. Our real product was documented cost savings, and we had a PhD, one of the company founders, who worked full time on modeling the workforce and the savings from optimizing its costs. We could prove savings year after year, so the customers were happy.

So, just as you have to identify your real customers, you have to identify your real product. Then your job is to build and deliver that product, and that’s what the rest of this book is about.

Projects Have Three Dimensions

Software projects have three dimensions.

  1. Requirements: What the system will do.
  2. People: The development team that will build it
  3. Schedule: How long it will take to build.

Fix two of these dimensions, and the third has to adjust accordingly. If the requirements and schedule are set, you’re going to need enough programmers to get it all done. If the requirements and people are set, it can only be built so fast. If the schedule and people are set, only so much functionality can be developed.

I tried to come up with a colorful analogy to illustrate the unbending nature of these three dimensions. The best I could find was the Three Furies in Greek mythology. (The monsters Scylla and Charybdis number only two.) It’s not a perfect analogy, but one sentence on threes.com, the web site I Googled to, is right on: “No prayer, no sacrifice, and no tears could move them, or protect the hapless object of their persecution . . .” If somebody tells you they have a way around the furies of requirements, people, and schedule, they’re wrong. There is no way around them.

I’ve also seen these three dimensions referred to as the Iron Triangle, a take on the Bermuda Triangle. The point, I guess, is that your project can sink into the Iron Triangle.

Clearly, adjusting a dimension has its limits. Teams can grow only to a manageable size; past that point communication and coordination difficulties start reducing productivity. The system has to have some minimum functionality to be useful; if checker schedules can’t be posted or report cards can’t be printed, it’s no good. The schedule can only be so long; after a point the system becomes irrelevant or costs get out of hand. Or, in the case of our little SuperSked company, we’d run out of venture capital (VC).

Within those limits, the three dimensions have to add up to a formula for success. Trying to build a system that’s overconstrained—too much to do, not enough people to do it, or not enough time to do it—just won’t work. You can’t get water out of a rock.

Requirements

Requirements should be adjusted only by adding or dropping functionality, never by adjusting quality. Only the highest possible quality is acceptable, always. Far, far better to have an important function missing than to have it work unreliably. (Years ago somebody at Bell Labs commented that a new disk drive he’d installed was very fast but was prone to data errors. His colleague responded: “Heck, if it doesn’t have to deliver the right data, I can make one even faster!”)

Adding more people to the team won’t increase productivity unless they’re top performers; if they’re not, it will reduce productivity. It’s much, much better to keep the team small and pay each of them what they’re worth. You’ll still save money. So the people dimension isn’t nearly as flexible as the other two.

Since the requirements and people are out there for anyone to see, it’s the schedule that’s usually faked. I’ll have more to say about that shortly.

Requirements are the tough part: it’s hard to know what they are at the start of the project, they’re usually too ambitious, they’re often not clearly articulated, and they change during development. That’s why they get a chapter all to themselves. I discuss the development team and the schedule in the next two sections of this chapter.

The Development Team

Sometime in the mid-1970s, Evan Ivie, my favorite manager at Bell Labs, went to a meeting where they were discussing how to measure the quality of programs. Various schemes were put forward, such as counting the number of bugs, analyzing the code for “go-to” statements, and examining the design documents. Finally, Evan announced that he knew of an instantaneous, foolproof way to determine the quality of a program. Everyone held his breath in anticipation of Ivie’s revelation. “See who wrote it,” said Evan.

Just as the three most important criteria to consider when choosing a house are location, location, and location, the three most important criteria to consider when predicting the success of a software project are people, people, and people.

(People again. They’re the ones you have to satisfy for success, too.)

Productivity of programmers—how much quality code they can write how quickly—probably varies more across people than in any other field. A pro tennis player can serve about 130 MPH, only about 50% faster than I can. A professional carpenter can build a set of shelves in a day, and I can build one just as good in a week. But, a top programmer can outproduce a mediocre one by a factor of a 50, easy, whipping out practically perfect code for something in two hours which the clown in the next cubicle would still be working on in two weeks, and even then it would be buggy.

But it’s not just productivity. Top programmers can produce a simple, elegant solution quickly, but the solution from a weak programmer no matter how long it’s in gestation, will never be as good. You can tell by looking at the code whether it flowed from the hand of an artist or acquired its shape from days of hammering. In the movie Amadeus, Salieri, speaking of Mozart, says: “He had simply written down music already finished in his head. Page after page of it as if he were just taking dictation.” That’s how great programmers work. They appear to be at their keyboards programming, but they’re only typing. The programming has already been formed in their minds. (This is why I’m skeptical of pair programming, a component of most Agile processes.)

Top programmers of the sort I’m talking about are pretty rare, and you’re not going to find many of them who want to work on your project. Of the people from whom you get to choose, the ratio of productivity might only be 10:1. Even so, what this means in practice is that a team of two good programmers can outperform a team of ten average ones. (Actually, that will be true even if the ten include the two good ones, because the eight laggards will spoil it for the whole team.) Unfortunately, the way people are usually assigned to projects and how they’re paid assumes a ratio of maybe 1.5:1. It’s off by an order of magnitude.

Whatever is fourth most important, after people, people, and people—good equipment, enlightened management, Agile techniques, pleasant working conditions—matters so much less, that when organizing a project you should spend nearly all your time on the people. Get that right, and you’re likely to succeed; even if you don’t know how to run the project, they will. With the wrong people, you’re doomed.

Hiring the Best

When I first became a manager, I was incompetent at hiring. I didn’t really know how to do it, so I just wanted to get it over with as quickly as possible. That resulted in settling for people who were merely OK, but not the best. I cringe when I think of some of the programmers I hired for my company, XVT Software, in the late 1980s and early 1990s. But a few years later I read a book with the same title as this section, Hiring the Best, by Martin Yate, and I got a whole lot better at it.

Before you even get to the hiring part, you need to make sure the best people want to work on your team. If your company is in trouble, your technology and product are old, your salaries aren’t competitive, your location is lousy, or the project sounds dreary, you’re not going to get good people to work for you. (Maybe you shouldn’t even be there yourself.)

(If you’re not the hiring manager but a prospective hire, this matters to you, too. Look at the quality of the people already on staff.)

The company’s troubles and its location are hard to fix, at least right away, so you may have to live with them. What you can change is the technology, the salaries, and how you run the project.

If, for some reason, your organization isn’t using the latest technology—an obsolete programming language or operating system, or bad hardware—it’s time to upgrade. You can’t recruit the best people to work in old ways. If the system runs on Windows XP, move it to Windows 8. Code new web pages with HTML5, CSS3, JavaScript, Ajax, and jQuery. You might find that some senior managers balk at new technology, or are listening too much to customers who want to use Explorer 6 and old computers that can’t run the newest operating systems, so you may have to fight. The best people flat out won’t work on technology that they consider to be behind the times. If you end up with mediocre people whose own technical skills are out of date, you’re sunk.

When I was interviewing for a job in 2008 and noticed on the company’s web page that its product required Windows 95, a Pentium 3, and at least 500MB of RAM, I hoped it was just a failure to update the web page. Either way, it was a real turnoff.

Salaries, too, might need to be adjusted. If the cap for a programmer is $100K, you can’t hire the best. Far better to have five programmers worth $150K and being paid that much than ten making $100K. You’ll have a better team, and it’s cheaper, too. Some companies have a rigid pay structure that doesn’t allow a programmer to make more than, say, a senior accountant or marketer. Do what you can to get this changed. Maybe you’ll fail, but you have to try. If you can’t pay for the best, maybe you shouldn’t be there, either. You’re the best, too, right?

John Moores, founder of BMC Software, came up with a compensation plan he called “product author.” The main developer of the product got a royalty on sales. John told me about the “two comma club,” membership in which required an annual compensation number with two commas in it. He lent a Ferrari to one of his two-comma programmers to drive until his own came in. As you might guess, BMC Software was hugely successful and, for a while, had the highest revenue per employee of any company of its size in the country. Maybe your company won’t adopt a compensation plan like BMC’s. On the other hand, maybe you’ve already gone that far yourself: you’re a consultant, or, like me, sell your own software on your web site and in Apple’s App Store. (I’m only at one comma so far.)

Once you know the work is attractive and the salary range is right, you can begin the hiring process. An in-depth discussion of how to do that is beyond the scope of this book, and it’s covered very well in Martin Yate’s book anyway. One thing I would add to his techniques is to look at the candidate’s portfolio, which in this case means a nontrivial program that he can bring in to show you. You might be told that all of the candidate’s prior work is proprietary and can’t be disclosed. Maybe so, but I’d be leery of any programmer worthy of being called “the best” who’s never done any programming at home on his or her own, even if it’s just a web page with some JavaScript.

One way to look at the candidate’s portfolio is at a group meeting, but you can also do it one-on-one. You want to hear the candidate explain the program, or at least a few sections of it, with particular attention to why things were done the way they were, and what alternatives might have been considered. If you know programmers, you’ll be able to tell pretty readily whether the candidate is really on top of his or her game, or is a plodder, able to get a program put together but not with innate artistry. That’s what you’re looking for.

I also ask questions like this one: to initialize the application, you need to read in a list of color names and RGB values from a parameter file, about a hundred in all, and sort them for later display. Should you use a bubble sort, insertion sort, or quick sort?

Two types of answers are wrong: an indication that the candidate doesn’t know anything about sort algorithms, or a firm statement that quick sort is the fastest. The best answer is this: I’d use whatever function was in the programming language’s library, or, if there’s nothing, bubble sort, since it’s the one I’m most likely to get right on my first try. Efficiency during initialization with such a small list is irrelevant. To paraphrase the old Charlie the Tuna ads, you don’t want the programmer who can sort the quickest, you want the one who’s quickest to sort.

Or, this question: We have a report generation feature that does a database query and writes a multipage PDF with the results, but customers are complaining that it takes too long to run. How would you fix it?

Here you want to hear an answer that includes these pieces: some determination of how long is too long, reproducing the problem so that there’s something to experiment on, instrumenting the system so the bottleneck can be identified, running experiments to see if any speedup is possible even theoretically, and then estimating the cost to fix the problem so a decision about whether to proceed can be made. Potential fixes, such as improving the query, adding indexes, or providing a queuing facility so the user doesn’t have to wait around for the results, are also good to hear. Mostly you want to learn how the candidate thinks.

What you don’t want to hear is a flat statement that the database needs indexes, that MySQL is the wrong choice, or anything else that indicates that the candidate has jumped to a conclusion. Nor do you want to hear, of course, that the candidate has no idea how to proceed.

My point is this: spend less time on educational accomplishments, previous job titles, and past projects and more on how the candidate approaches the work. This requires really in-depth interviews, not casual chats over lunch.

The Schedule

Scheduling is the most feared and disrespected of all management tasks. It’s misunderstood, too. The purpose of a schedule isn’t to predict future events or to provide a means to whip malingerers. A schedule’s purposes are

  • To force a careful look at all the requirements, and
  • To force the team to come up with at least one plausible scenario that leads to success, and
  • To keep development operating at a steady pace, and
  • To place a bound on how elaborately a component should be developed.

I can explain what I mean by the last point with an example: suppose your assignment is to implement a data export facility in three days. You’d probably figure on providing a basic filtering capability to select the data, a simple way of previewing the output, and maybe a choice of comma-separated-value (CSV) or tab-delimited output formats. Now suppose you have two months to do the export module. You’d expect to develop a much more elaborate query facility, a much wider choice of outputs, probably including XML (Extensible Markup Language), SQL (Structured Query Language), and maybe even RTF (Rich Text Format), and a way to store the export specification as a preset for later recall.

They’re both export facilities, and neither is inherently right or wrong. The customer probably wants the fancier one, but, if you know that it’s just a three-day job, you’d tell the customer that it’s going to just be a minimal facility, and he or she will be happy with that, too. Since this is a peripheral function, not really connected with any other part of the system other than the database, you can always replace it with something more ambitious in a future version.

On the other hand, if the schedule calls for conversion to be done in three days, someone needs to speak up. That’s way out of line for most real-world systems. A plausible scenario for success doesn’t exist if you only have three days.

What’s the point of having a schedule if it’s not going to be followed? Because the exercise of scheduling will force the team to go through each of the requirements to make sure they understand the scope. All sorts of fuzziness gets resolved when there’s an attempt to schedule.

In practice, strict conformance to the schedule, and changing it when realities indicate that it’s wrong, keep development on pace, just like a runner preparing for a race times his or her training runs. Without a schedule, programmers will get distracted or get frustrated when they can’t integrate their work because other parts of the system aren’t being developed. The schedule is the symphony conductor’s baton that helps everyone play the same tune at the same time.

Scheduling the Unknowable

There are two main difficulties with scheduling.

  • You don’t know the requirements, and they’re subject to change anyway.
  • Even if you did know a requirement, it’s hard to predict how long it will take to develop.

And two lesser difficulties.

  • Programmer productivity varies widely (10:1, in my experience).
  • Much of programmers’ time is spent on nonproject tasks, such as customer and sales support, HR (human resources) meetings, and training, vacations, illness, and exploring new technology.

But you can’t let these problems stop you from scheduling—it’s too important. You still have to do it.

True, you don’t know the requirements and they’re going to change during development. But there’s a difference between not knowing the details, which might not affect the schedule much, and not knowing anything at all about what’s to be done.

Here’s an example: Let’s say you know you’ll need about 10–15 reports that all take the form of a database query, formatting the results into a table on a web page, and downloading the data as a CSV file. You can figure a week to build the overall template, and a day for each report, for a total of four weeks. That’s probably high, but safe. If you know the programmer doing the work is a crackerjack, cut it to a quarter-day per report, for a total of two weeks. So, one way or another, it’s two to four weeks. Not a week, and not two months. All without knowing anything about what exactly needs to be in those reports, which you’ll work out later with the customer when the work is about to begin.

Another example: You’re doing a project for a library, and one important feature recommends books based on other books that the borrower has read and liked. (Something like what Netflix does for films.) What should you schedule? A week? Two months? Three years? You have no idea. That scheduling uncertainty, though, has exposed this as a major technical risk, and probably a major development job. So, you immediately get one or two of your cleverest people to research what’s available, build a prototype, and demonstrate it to the customer. That might take a month all by itself, but anything this risky has to be done right away. If you need to add three months to the schedule to get this developed, far better to tell that to the customer at the start of the project than a week before the big Libraries International Trade Show, leaving your customer with a fancy booth and nothing to show in it.

So, you always schedule based on the requirements you do have, but you qualify that schedule as being based on loosely defined requirements. As requirements get more specific, you refine the schedule.

The second problem, not knowing how long development takes, is easier to deal with. Pick one or two programmers with the most experience related to the project at hand and have them estimate how long it would take for them to do each item in the requirements. For the nonprogramming tasks, pick someone who has those skills. Estimates can be in half-days, assuming a half-day is four hours. Make sure every task is included: documentation, training development, testing, localization, and everything else that’s needed for a complete product.

Tasks should be tagged as being one of three types, depending on how accurately they can be estimated.

  • Type 1 tasks are similar to something that’s been done before, so their implementation time can be fairly accurately predicted.
  • Type 2 tasks are new, but it’s well understood how to do them.
  • Type 3 tasks are those for which the requirements are vague or the implementation approach is unknown, and estimates for them are wild guesses.

Next, apply a productivity factor to the estimates, because it’s likely that the top people you picked for the estimating are above average for your team. A factor of 2X to 4X might make sense.

Then figure out how many actual working hours there are in a day. If there are technical support and other nonproject duties, it might only be four. If it’s a new project, figure six. Seven or more is probably too optimistic. Assume only 40-hour weeks.

All the Type 2 tasks get an additional factor of 1.5X because the estimates were rough, and all the Type 3 tasks get a factor of 3X. You don’t really know that the factor is 3X, of course, but that’s OK for a start.

Total it all up and you’ve got the number of days it will take. Figure that there are about 46 working weeks a year (52 minus vacations, holidays, and illness), and you’ve got the delivery date, assuming the work is assigned so that everyone is busy all the time and nobody is waiting for anyone else. (A database centric design helps a lot here, as I’ll explain later in this chapter.)

Don’t like my arithmetic? Fine, use your own. The point is that you should use a method of some sort to come up with real numbers. The benefits of this exercise are enormous. Lots of questions will get raised, many of which will have to remain unanswered until later. Far better knowing what you don’t know than stumbling along with your head in the sand.

Any Type 3 (wild guess) tasks in the schedule make it very inaccurate, so the best thing is to split the project into two: a prototype phase, in which Type 3 tasks are reduced to Type 2 (but not actually implemented other than as a prototype), and then an implementation phase. Announce that the implementation schedule will be created only after the prototype phase. That way you’re not in a position of quoting a delivery date based on wild guesses and then having to revise it later.

The purpose of the prototype phase isn’t only to aid the scheduling. Getting the high-risk design problems out of the way at the start of the project also makes sense for development. You don’t know what resources will be required to explore this unknown territory, and you don’t know what impact their design will have on the rest of the system. Such large disturbances should come as early as possible.

(In the movie The Godfather, after Tom Hagen hears the producer Jack Woltz refuse to cast Johnny Fontaine, he gets up to leave, saying, “Mr. Corleone is a man who insists on hearing bad news at once.” As a manager, I insisted on that, too. Don’t worry, I never had a racehorse decapitated.)

When you get to the implementation phase, you have only tasks of Types 1 and 2. Type 2 tasks were less accurately scheduled, so move them to the front. Then as the project proceeds and the schedule is revised it will get more and more accurate, because the work in front of you is much more well-known than the work already completed was at the time it was scheduled. In addition, as you get further into the project you have more history about how productive the team is, so the time estimates are more realistic.

To summarize: You start with an inaccurate schedule, but one based on a detailed structure that reflects all the tasks needed to complete the project. After a prototype phase, you announce the schedule. You revise it as the project progresses, and it gets more and more accurate with each revision.

If you do it this way, the team will look pretty good, especially if they’ve been open about the kinds of uncertainty that were behind the initial few schedules. Even if the final date has to slip—and, with all my fudge factors, it may not—it’s OK to slip it by a week or two when you’re still six months out. It’s when a delivery date is blown with no notice that the team looks incompetent. This happens when the team tries—and fails—to make up for slippage by working longer hours, reducing testing, and cutting corners on coding. Schedule the right way and that will never be necessary.

If you find yourself working in an organization that expects schedules to be unshakable commitments and blames developers if they’re not, make sure you keep track of all the changes to requirements that will occur throughout the project. Then you can connect each schedule change to the requirement change that caused it. If those are the politics where you work, you have to play the game.

A Scheduling Example

The Conference on World Affairs (CWA) gathers about 100 speakers from around the world to participate in panel discussions on every topic imaginable in politics, arts, business, science, human affairs, and much more. It’s been held each spring for the last 65 years on the campus of the University of Colorado, in Boulder. Until I built a PHP/MySQL system for CWA this year, the organization kept track of everything related to the conference with Excel spreadsheets, text files, and a FileMaker database that ran only on the assistant coordinator’s computer.

Figure 1-1 shows a greatly simplified schedule, built with Microsoft Excel, for part of the CWA system. The Type 1 items (101 through 106) are forms, one per database entity.

9781430260073_Fig01-01.jpg

Figure 1-1. An example schedule

The reports (107 through 110) are Type 2, because they all required generating a PDF from PHP, which, for the purposes of this example, I’ll pretend was something I hadn’t done before. The Type 3 items are for two components that I wasn’t sure about at all: a way to automatically assign visiting panelists to houses, and a way to determine whether each panelist has his or her speaking times well distributed. (I really didn’t do either of those, but let’s pretend I did.)

The columns are based on the scheduling methodology from the previous section. The Half Days column reflects how fast I think I can complete each task, assuming I know what I’m doing. The Avg. Prod. column applies a 2X factor to it, assuming I’m twice as fast as the average programmer. The Risk Adj. column applies the 1.5X factor for Type 2 items, and 3X for Type 3 (because I don’t know what I’m doing).

Notice how much the Type 3 times have expanded, all the way to 36 half-days to complete the housing assignment item. Perhaps that’s too little time. Or maybe it’s three times too long. It’s a Type 3, so we really don’t know.

What this model tells us is that we can’t really come up with a schedule until the Type 3 items are prototyped to the point where they become Type 2, or even Type 1. So, in planning the work, those two items would be the ones to be attacked first. Until there’s a working prototype that satisfies the customer, the project is in its prototyping phase, and there’s really no official schedule. When there’s a detailed design for those items, or, better, a working prototype that can actually be tried out, the implementation phase can begin, along with the first working schedule.

Why Projects Fail

Why do projects fail, as so many do?

There are two main kinds of failure: when the project is killed before it’s finished, and when it finishes but fails to do what it needs to do. In that second category are products for off-the-shelf sale that fail to excite the market, but this is more likely to be a marketing failure than a development failure, and, while I’d love to talk about it, it’s well outside the scope of this book. We’re technical people, so I’ll just deal with technical issues.

A project is killed before its time because it has exhausted its money, management with the authority to pull the plug has lost confidence in it, or whatever the project was supposed to do is no longer needed. In that last category was a project at Bell Labs in the 1970s to build a robotic automated main distribution frame (AMDF) that could manage the wiring in the telephone central office. The project was actually going along quite well, but at the same time a different group in Bell Labs had developed electronic switches. Wires became obsolete, so there was no longer a need for a robot to connect them and the AMDF project was killed.

But let’s face it, in most cases the death of a project still in development is a mercy killing. Progress is so abysmal, and the demos are so unsettling, that its intended customers no longer believe that it’s going to be completed in any reasonable time frame for any reasonable amount of money.

The second kind of failure, a finished project that doesn’t satisfy the customer, is maybe more common but less easy to recognize, since, as long as it works, customer complaints can be addressed by a series of maintenance releases. The result may not be beautiful, but in time the system can be made to work. Probably 90% of in-house systems are like this. Their development was traumatic, there were problems during their first year or so, but now everyone has gotten used to them and they’re just part of the institutional landscape.

If it’s a commercial product for off-the-shelf sale, however, it won’t sell if it’s crappy. The technical staff has to do much better than that if the company is to survive.

Well, these are interesting categories maybe, but what are the actual causes? Steve McConnell, author of the excellent books Code Complete and Rapid Development: Taming Wild Software Schedules, has a more complete list of 36 classic mistakes at stevemcconnell.com/rdenum.htm.

I’ll include my own, shorter, list here, in what is probably the order of their frequency.

Poor Requirements

It’s OK, even preferable, to evolve the requirements as development proceeds, but they have to converge on something that leads to success. If the quest for requirements loops endlessly without ever crossing the finish line, or fails to target what the market wants to buy, the requirements process is faulty, and no amount of whining about the customer who doesn’t know what he or she really wants is going to save the day. The project has failed.

There’s lots more about requirements in the next chapter.

Weak Team

Nobody ever wants to say that the people on the development team just aren’t good enough. The closest they’ll come is to say the people were inadequately trained, which might be true. But, let’s face it, the people sometimes are simply not talented or experienced enough, or both. As I said earlier, with the best people you’re probably going to succeed no matter what, because the best people do what it takes to succeed. With the wrong people, it’s hard to see how you can ever achieve success.

Failure to Prototype High-Risk Features

You can’t just plunge ahead pretending that those high-risk, Type 3 features are normal ones. There’s a real danger that the project will get bogged down too close to the delivery date while the team is desperately trying to get the system working the way it was promised. As I said, the high-risk tasks have to be attacked first, not postponed so that the team can show early, but misleading, progress by picking the low-hanging fruit. (I’m reminded of a year-and-a-half delay in opening the new, completely finished, airport in Denver back in 1993 while the software running the automatic baggage handling system was being debugged. That part should have been worked on much earlier.)

Bad Design

Design is the process of taking the requirements and coming up with a blueprint for implementing them, somewhat like the role of architecture in constructing a building. If the design is bad, the project will fail even if the requirements are right and the implementation of that design is perfect.

In my view, many systems aren’t designed at all. The programmers take what requirements they have, perhaps only a week’s worth if they’re using an Agile methodology, and start coding. Few, if any, projects even have anyone with the title of application designer. True, there are user-interface designers, but the user interface is only a small part of design, just as door handles, elevator buttons, and HVAC controls are only a small part of architecture.

Poor Development Processes

Even with a good set of requirements, a project can get into big trouble if the development processes are poor. Among the sins are

  • Waiting until late in development to integrate the components.
  • Inadequate unit testing, resulting in failed integration and a lot of wasted time.
  • Poor allocation of modules to people, without clear and minimal interfaces.
  • An awkward and/or frequently changing database schema.
  • Sloppy programming habits, not corrected during code walkthroughs.
  • System tests with gaps in coverage.
  • Not engaging the customer with frequent demos and alpha releases.

Changed Priorities

This was the killer of projects at Bell Labs when I was there in the 1970s. A project would get started, get staffed at a level only AT&T (Bell Labs’ owner) could afford, and then get killed a few years later because technology had improved (I already mentioned the AMDF project), the personnel were needed on a more important project, or the economics changed. Maybe another company would have thought more carefully before starting a project with such a questionable future, but in those days AT&T was a regulated monopoly and didn’t have to watch its expenses.

Today’s equivalent of changed priorities is probably VC drying up.

Sabotage

Sabotage is a deliberate attempt by a manager to kill the project, usually surreptitiously. A common situation is when someone who never supported the project replaces a manager. This and other forms of corporate in-fighting are outside the scope of this book; I list this situation here only to acknowledge that it’s pretty common.

Managing the Project

By definition, management is the use of resources to accomplish an objective. In a software project, the objective is to satisfy the customer, and on a day-to-day basis, its proxy is the requirements. The resources are mostly people, although equipment and outside services may come into the picture as well.

There’s a lot to management, but, there are five essential tasks that will lead to success if done right. The first three mirror the three dimensions I discussed earlier.

  1. Keep the requirements from expanding unnecessarily.
  2. Get the right people onto the team.
  3. Closely monitor the schedule, and change it when necessary.
  4. Make sure all the work is assigned.
  5. Keep the people happily focused on their assignments.

That’s it! Do these five and, if the requirements are right, the project will be successful. Fail at any one of them and the project will fail.

I’ve already explained why the first three tasks are so critical, and I’ll have much more to say about requirements in Chapter 2.

Task 4, surprisingly often overlooked, is to ensure that you develop all of the deliverables. It’s too easy to get wrapped up in the complexities of managing the programming and forget more mundane requirements like documentation, training, installation, and support. Task 5 is to make sure that you actually execute the plans you’ve hatched by doing the first four tasks. Programmers are notorious for getting distracted from their main mission. What’s more, you have to keep them happy, or their productivity will drop all the way to zero, and perhaps even go negative.

I’ve been careful to use the term “management” and not “manager.” All projects must have management, no matter how small; without it, the resources are not being applied to accomplishing the objective. With a team of one or two, there’s no need to designate one of them as the manager. But teams of three or more need to know who’s the boss. It’s too inefficient to decide matters by consensus, and it runs the risk of losing track of the path toward the goal. More than a half-dozen people, and there needs to be a full-time manager.

But, however you arrange it, the five essential tasks need to be done. You might argue that a schedule and work assignments are unnecessary with a collaborative, egoless, team-oriented approach, but I don’t agree. I think that leads to guaranteed failure: a late project, with unpopular jobs, such as conversion, documentation, or training, left incomplete or haphazardly done.

Here’s how I did things for SuperSked, the checker-scheduling software for supermarkets. By the time I was brought in to manage engineering, they had already spent a year burning through $500K or so of VC that was supposed to get them a Windows version of their system, which had originally been built for character-oriented UNIX terminals. After a year, they had a fancy object-oriented user-interface framework completed, and nothing else. I agreed to take another $250K or so of VC money and finish the system in about six months. If I failed, the plug would be pulled, and the company would fold.

So, of the three dimensions—requirements, resources, and schedule—two were already fixed. Actually, so were requirements, since the new system had to completely replace the old system, which meant it had to provide the same demand forecasting, adherence to union rules, cost optimization, and printed schedules that the old system provided, but on Windows.

I decided that it was doable and signed on. There were about eight people in development, including a mathematician who worked on the optimization algorithm and a testing specialist. The new CEO and I fired three people who were technically competent enough but were spending too much time arguing that the existing system was on the right track. After a week or so of study, I threw out 100% of the code that they had spent a year writing but kept the database design, which was excellent. I hired two programmers, one recommended to me by a former colleague and one from a newspaper ad.

That concluded tasks 1 and 2 on the list: the people and the requirements.

I knew the endpoint of the schedule, but not the intermediate points. Since we had six months of life left, I planned the development for four, to give us one month for system testing and one month for unforeseen problems, which, by definition, can’t be planned for.

So, I plotted out the system as best I could and divided the work into 16 weekly segments. Of course, we didn’t stick exactly to that plan—one never does—but I had to convince myself that the problem had a solution. Task 3 done.

Then I divided up the work, unilaterally. In other projects this would be done collaboratively, but there was no time for that. I just told the people what I wanted them to do. That was task 4.

With all this set up, my only management job was task 5, keeping everyone focused. I did that with a weekly meeting in which we went around the room so each person could state very quickly where he was. We also had the existing system to maintain, so customer issues were on the table, too.

The weekly meetings usually resulted in a few items that required my further attention, which I handled by visiting, privately, whoever was involved. A strict rule was that we never discussed anything at these weekly meetings. They were for status only. They never went more than a half-hour.

Many on the team were used to meetings that dragged out, meetings where there’s an attempt to reach a decision on some matter. I explained at the first meeting that I only wanted status, but it didn’t catch on right away. At one point one of the founders of the company, Seth (not his real name), started jabbering about his attempts to find a solution to something he was working on. Following is the conversation that ensued:

Me: “Seth, stop talking.”

Seth: “I’m explaining what I’ve been working on.”

Me: “I know, but this is a status meeting. Just tell us whether it’s finished, in-progress, or not started.”

Seth: “It’s in-progress, but I need to explain that it’s gotten complicated.”

Me: “Seth, you’ve confused this with a meeting at which people talk. It’s not. It’s a meeting where I do almost all of the talking, and you can talk when it’s your turn, but you can only say one of three things.”

Everyone: Laughter at my sarcasm. Seth was laughing, too, fortunately.

Seth: “In-progress.”

Me: “Great report. Next item?”

Many years later I ran into the testing specialist, who told me how much she had enjoyed the project. I told her I had probably acted like a sarcastic jerk. She disagreed, telling me that I was the first manager they’d had who actually managed; they were tired of failure, and, what’s more, they all thought my sarcasm was very funny. (It is; I’m very good at it.)

By the way, we shipped the new system on time, the customers loved it, and the company was sold to a larger company in the same business that’s still doing well with the product over ten years later. More important to the investors was that they got their money back and more, after kissing it good-bye. I moved on, but I think the founder, Seth, is still there, with all his stock intact.

Here was another example of my approach, this time at the next company I went to, also in trouble. A programmer, call him Brian, had started to irritate the database administrator by getting involved with database issues like performance and backup, not even close to his assigned job. I asked him to join me in my office.

Me: “I understand you’ve started to help out with the database.”

Brian: “Yeah. It’s really not done right. I’m happy to help.”

Me: “Do you remember your assignment?”

Brian: “Sure. The web update pages.”

Me: “So, that’s what I want you to do. Just that.”

Brian: “I’m doing it. But I also think I should contribute to other things, where I can.”

Me: “Absolutely. You can do whatever you think is best. Totally up to you. Not my place to interfere.”

Brian: Starting to smile, nervously.

Me: “Only you can’t do it here. Here, you can only do your assignment.”

Brian, catching on: “So . . . I’ll do the web update. Not the database.”

Me: “That will be fine. Thanks. By the way, it’s looking really good.” (No idea if that was true, but I wanted him to go away happy.)

You might be shocked at my dictatorial style, but given our board-imposed constraints, I was going to spend a maximum of two minutes getting this excellent, but distracted, programmer back on his assignment.

Another important monitoring task is making sure the various components, developed by different people, fit together and work with the most recent database schema. If the system requires building, it should be built automatically each night. (PHP programs usually don’t require building, just placement of the files in the appropriate directories on the server.) Whatever self-checking system tests that have been developed should be run also. Everyone on the team should get an e-mail each morning with the results. If anything is amiss, fixing it is the top priority—no further development should be done until the system is integrated and passes its self-checking tests.

Dividing the Work

He is all pine and I am apple orchard.

My apple trees will never get across

And eat the cones under his pines, I tell him.

He only says, “Good fences make good neighbors.”

—Robert Frost, Mending Wall

A project with a lot of communication is a happy project, but very little of that communication ought to be about interfaces between components. Interfaces need to be simple, minimal, and stable. Once set up, if there’s much more to discuss about them, something’s very wrong. But if the interfaces are right, the system will integrate smoothly and accommodate change without losing its structural integrity.

The interfaces between components should also be the interfaces between people on the development team. That allows developers to work at their own pace and in the order that makes the most sense. Bad interfaces—ones that leak too much information—cause developers to have to wait for each other to complete work, and cause work already completed to be redone.

This is not to say that the team shouldn’t have important things to talk about every day. It’s fine to talk about the results of the nightly build and test, new insights about the customer’s evolving needs, and technical problems that can benefit from a group effort. But it’s not OK to talk frequently about interfaces. They need to be so stable that there’s nothing to talk about.

Exploiting Database Centricity

That SuperSked application I mentioned a few paragraphs back was the first database-centric project I’d managed with more than two or three people on it, and development went amazingly smoothly, even though the application itself was fairly complex. There were almost no integration difficulties. Bugs found through testing were quickly identified and fixed.

We did a lot of things right: a terrific team of developers, well-understood requirements (it was a replacement for an existing system), and a tight, but reasonable schedule. But there was one more aspect of the project organization that really made the difference: all of the components talked only to the database. They got their data entirely from the user (via forms) or from the database, and they deposited their results back in the database. Components never talked directly to each other.

Testing was based on database snapshots captured from customers of the existing system and then converted to the new database, using the same conversion programs that would later be part of the deployed system. A component could be exercised in isolation, since everything it needed was in the database. (A few components required some data entry.) Then the results in the database could be easily checked. If anything was amiss, it had to be the component itself, since it couldn’t be an interface problem.

Good news: PHP/MySQL applications, the focus of this book, provide exactly the same advantage. To exploit that advantage, however, you have to design each component—each form, report, and business-logic module—to interface only to the database.

There were a lot of conversations between the component developers and the database designer, especially at the start of the project, as the schema was complicated, with many subtleties. But even those conversations pretty much stopped once the model was well understood.

Here’s an example of how components interfaced only to the database, instead of directly: the first step in scheduling the checkers is to forecast demand, based on the time of year, day of week, presence of holidays, predicted weather, and a few other factors. Second, labor availability had to be established, depending on work schedules, union rules, training (not everyone could handle the express register), and so on. The results of these two preliminary steps were then fed into a very advanced optimization algorithm that computed for a while, maybe 10 or 15 minutes, and then coughed up a schedule, which then got arranged into various reports, including one for posting on the employee bulletin board.

The obvious thing to do is to work out a way, using XML, for example, for the forecasting and the availability modules to connect to the optimizer. We didn’t do that. We had them insert data into the database, and we designed the optimizer to query the database for its inputs. One huge benefit to this was that the programmer working on the optimizer could just keep running it on the same inputs, without dealing with the predecessor modules at all. And, once the programmers working on them verified that the data was in the database correctly, they were done. No need to actually run the optimizer.

To the programmers who had worked on the legacy system, where the data existed internally in huge Fortran-style arrays, the idea of writing all those numbers into the database seemed very strange. But, once the functions to do it were coded, the job was done, and they never dealt with interfacing issues again.

Assigning Components to People

Many PHP/MySQL projects are very small, probably because large, corporate developments tend to use fancier technologies such as Java EE or .NET. I don’t have the numbers, but I’d guess that half of all PHP/MySQL projects are done by one or two people and a quarter are done by four or fewer. So, the work is usually divided up only a few ways.

For any PHP/MySQL project, and for most others, too, the categories of development jobs are

  1. Database design and implementation,
  2. CRUD (create, retrieve, update, delete) web pages,
  3. Business logic (e.g., scheduling supermarket checkers, routing deliveries, computing invoices),
  4. Reports and other outputs,
  5. Conversion,
  6. System testing,
  7. Documentation, and
  8. Training.

If there are two of you, one should do the database, conversion, and reports, because that’s nearly a stand-alone application. Once the database is loaded with converted data, there should be enough to test the reports. The other person can do the CRUD and business logic. System testing, documentation, and training can be split up any way you see fit.

With three people, if the business logic is complex, as it certainly was for SuperSked, that’s a full-time job, and other jobs can be split as they were for two people.

With more than three, it still makes sense to combine the database and conversion, because conversion exposes so much about what the database needs to be able to model. Also, once you design and implement the database, it’s no longer a full-time job. The other components can be split according to their complexity and the skills of the team members.

Remember, no matter how you assign the components, they only interface to the database, never to one another.

The Workplace

Part of organizing a project is organizing a place for the work.

As far as the technology goes, for PHP/MySQL projects, physical location doesn’t much matter. It’s easy to set up a development system on your own computer and to send files to the development server for integration. You don’t require any special hardware; any laptop or desktop running MacOS, Windows, or Linux will do.

It’s a lot easier to run the project if everyone comes into the office every day. Phone calls, Skype, texting, and e-mail are no substitute for face-to-face conversations. Perhaps the biggest difference is that you only inititate electronic communication when you know you have something to talk about. Face-to-face conversation, by contrast, leads to serendipitous exchanges. For example, one programmer might say to another, “I overhead you talking about joining the person and status tables. I’m pretty sure a view has already been set up for that.” Or, passing someone’s desk and glancing at his monitor, “How you’d get the menus to work like that? jQuery UI, or did you roll your own?” These interactions are unlikely to occur with everyone working at home.

Yeah, there are conversations about the Super Bowl, fishing trips, and who’s going to replace the boss, too, and they just waste time. Most telecommuters would say they’re more productive at home, and they’re probably right.

I’ve worked both ways, and the projects where everyone came into to work every day were easier to manage, had higher morale, and stayed on schedule. Keeping programmers focused is one of the five necessary management tasks, as I stated previously, and it’s harder to do if the programmers are off by themselves. Not impossible, just harder.

So, if it’s going to be a close game, where every play is critical, as the SuperSked project was, everyone needs to be on the field.

Another workplace issue, given that there is an office, is whether to have private offices, cubicles, or one large work area. It’s too hard to concentrate if everyone is in the same room, although it can lead to a very creative and stimulating atmosphere. Private offices are almost always too expensive for most companies these days. So, it’s going to be cubicles, with strict rules about talking and other noisy pursuits.

A break room where programmers can spend some time is a good idea. It provides respite from staring at the screen and a fertile ground for those accidental conversations. By all means, install a foosball table; it will impress your recruits, if nothing else.

Issue Tracking

As a project progresses, the team will have to keep track of changes to requirements, bugs found in testing, design questions to be resolved, assorted things-to-do, and the like. I call them all issues and enter them into a database so they won’t be forgotten.

Find a system you like with the following properties:

  • Flexible enough to handle all sorts of issues, not just bugs, and maybe to serve as the customer-support system, too.
  • Allows you to define your own projects, subsystems, people, statuses, severities, priorities, and all of the attributes that you’ll want to twiddle. Most systems I’ve looked at can do this.
  • Has a web interface. It’s OK if there’s also a native app for whatever platform you use, but a web interface allows universal access.
  • Uses a database that you can get to with PHP so you can write your own utilities as you see the need.

For the last year or so I’ve been using FogBugz (fogcreek.com/fogbugz) for supporting my own software products, which does everything on the preceding list. It’s free for one or two users, and $25 per month per user for larger groups. (No database access in the free version.) There are other, completely free, alternatives that you can install on your own server, like Bugzilla (bugzilla.org) or HESK (hesk.com), but then you have to take time out to install and run them. I discovered that installation of HESK was automated by my web hosting company (A2 Hosting), so I’ve since switched to it. It’s a PHP/MySQL application, which means that you can easily access the database with your own PHP programs, as I’ll show in Chapter 2.

What system you use isn’t as important as that you use it for all issues, so there’s only one place to look. E-mails, scraps of paper, text messages, and oral comments should all be entered into the issues tracker.

If you’re working directly with a customer, consider giving your customer access to the issues tracker. A disadvantage of this is that it provides too much detail and might make the customer fret needlessly about what to developers are trivial matters. “Build bombed on that missing header problem” or “bad crash, need to regenerate” are no big deals, but they can sound ominous to a layperson. Maybe it’s better to just provide timely reports, possibly on a web site where they can be updated automatically every night.

Issues that have been identified as real and in need of attention should be reviewed by the whole team at least once a week, to make sure nothing gets ignored and that each team member stays focused on his or her assignment (management task 5 on the list presented earlier in this chapter). Just distributing lists via e-mail isn’t enough. An issue needs to be talked about all by itself, even if it’s only for a second or two. If you could sit in on one of my meetings you’d hear something like the following:

Leader: “1478.”

Bob: “Done.”

Leader: “1492.”

Jane: “Done.”

Leader: “1501.”

Mary: “In progress. Needs discussion.”

Leader: “1504.”

Tom: “Done.”

Then at the end of the roll call anything marked as needing discussion can be talked about. With the whole team in the room, you don’t want to spend more than a minute or two talking about an issue that might involve only a couple of people, so after that short amount of time it should be taken offline. If it’s urgent, the manager can go see the people involved. If it’s not, it will come up again at next week’s meeting.

Why call out issue 1478 if it’s done? Isn’t that already recorded in the issue tracker? It is, but Bob deserves a chance to say it out loud. He can’t make a speech—it’s only little old 1478, after all—but he does get the floor for two seconds.

Legal Matters

Like I said at the start of this chapter, your objective is to satisfy your customer, and if you do that you’ll avoid legal trouble. Still, there are some specific matters that should concern you.

Have a Written Contract

At various times three of my friends have asked me to help them resolve disputes with their consulting clients. One had to do with a complex formula for payments on preparation of training lessons, one was about patent ownership, and one was about rights to the software. All three had this in common: there was no written contract. I don’t mean that there was no document drawn up by lawyers; I mean nothing written down at all.

I’m not sure why that was. Maybe they thought that a written contract required lawyers and they didn’t want the expense. Maybe they rushed into the project. Maybe one party wanted the flexibility to wiggle out of the deal later. Anyway, you shouldn’t fall into that trap. Get it in writing.

What needs to be in the contract? Well, they say that journalists are supposed to write the who, what, where, when, why, and how (except for weddings, where they skip the why). That’s a good list for a written contract, too. Who is going to do the work and for whom, what the work is, where the system will be developed and installed, when it will be delivered, and how it will be done. Skip the why if you want. But, include what sometimes follows a wedding: the divorce. State how the contract can be terminated and what happens when it is. Also include who owns what, which I’ll discuss in the next section. And, of course, how much and how often you’ll be paid.

Really, if any of my friends had that list covered, even as a set of non-lawyerly bullet points, they would have avoided their difficulties.

You might find yourself in a situation where you think suggesting that you and your client have a written contract will be offputting. In that case, don’t use the word “contract.” Just send an e-mail saying something like the following: “I thought I’d recap our working agreement, to avoid overtaxing our memories later.” Then go ahead and list the key points and ask the client to confirm his or her agreement via a return e-mail. The e-mail will probably clarify any disagreements down the line, and if it doesn’t, any mediator/arbitrator will work from it—med/arb is a very flexible process. So might a court, but you’re very unlikely to ever get that far.

Know Who Owns What

You deliver the system to your client, but does he or she own it? Do you? Can you use any of the code for another client later? What if it includes code you’ve written before the project started? Did you lose ownership of that? What about patents? Copyrights? Trademarks?

All of this is called intellectual property (IP). On every project I’ve ever worked, the client owned everything that I developed during time billed to that client. I never cared about owning any of it, because of the nature of the work. But, if you’re being hired to invent something truly novel, such as an algorithm for recommending movies, or routing delivery vehicles, or a social networking site, you’d better get ownership negotiated and written down.

On a few occasions I decided that I wanted to develop some general software to use on the current project and also to keep for future use. To develop that, I turned off the clock and turned it back on again when the generalized part was finished. This was provided for in the contract.

There’s a legal term called “work for hire” that, in the context of copyright, means that whoever hired the work is the author. That’s usually the way you’ll work, whether you’re an employee or contractor, and you can go ahead and put that term in your contract. If you want any other arrangement, you’ll have to be careful, and in that case you probably do need to get a lawyer involved.

Anyway, as I said, in most cases you should put aside any idea that you’re going to get something out of the project other than your pay, a satisfied customer, and the possibility of more work. Trying to stake a claim on IP gets very sticky and it’s most unlikely that anything valuable will come out of your project anyway.

If you think some of the general code you write might be useful, you might get away with a clause saying that any code of a general nature that isn’t application specific can be used by you on other projects, with no payment required. Many clients will agree to that. If they don’t, do it off the clock, as I mentioned.

In the patent dispute that one of my friends got into, the problem was that he wanted his name on the patents, since he was the inventor, which was OK with them, as long as the patents were assigned to them. He didn’t agree with that. As I said, nothing was written down. In the end, they filed the patents without his name, claiming to be the inventors. Legally, I have no idea whether this was correct, being somehow related to work for hire. It was never litigated. He just went away angry. Amazingly, this was the second time this guy had gotten into IP troubles, both times without a written contract. Obviously, he doesn’t listen to my advice. You should, though.

Watch Out for License Entanglements

Some of the software incorporated into the application will be owned by neither you nor your client: third-party packages such as PDF-generating libraries, executable files you invoke and ship with your product, and JavaScript code like jQuery. Most of this will be covered by some sort of open source license, such as the MIT, Apache, BSD, GPL2, Lesser GPL (LGPL), or GPL3 licenses, which are the five I encounter most often. There are commercial licenses, too, each of which is different.

Each license places requirements on the user of the software, ranging from including a copyright notice (MIT) to making the source code of your own application available (GPL3) to paying a royalty on each copy deployed. You’d better know the ins and outs of each component you use.

If at all possible, use only third-party software covered by the MIT, Apache, BSD, or LGPL licenses. Commercial software should be avoided unless it delivers functionality that’s impractical to provide any other way. GPL2 and, especially, GPL3 software is hazardous if you’re going to incorporate it in your own system, as it may obligate you to do something you and your client don’t want to do: release your code to the public. However, if you’re only going to connect to it (MySQL) or run on top of it (Linux), you don’t need to worry. The installation has to be licensed for that, not the software developer. Most of the time I use commercial hosting services that provide MySQL and the operating system (usually Linux), so there are no licensing issues for them. I just worry about the source code I incorporate into my PHP programs.

Involving a Lawyer

There are some cases when you need a lawyer, such as when you want to own the IP you develop, but that’s rare. You usually don’t need one and, even if you use one, he or she can’t help keep you out of legal trouble.

Here’s why: if there’s a dispute over a written contract, it’s almost certainly going to be over what is to be developed, whether it meets the acceptance test, and when it’s to be delivered. And all of those are specified by you, not by your lawyer. Following is a typical paragraph from a contract drawn up by a lawyer:

Developer shall serve as a contractor of Buyer, defined by the IRS as a 1099 Contractor, and shall design, develop, and implement applications software (“Software”) according to the functional specifications and related information, if any, attached hereto as Exhibit A and incorporated herein by this reference (“Specifications”) and as more fully set forth in this Agreement.

Guess who supplies Exhibit A, you or your lawyer? Your lawyer will have no idea what any of it even means. As an expert witness, I’ve seen this in contracts involving AT&T, IBM, Microsoft, and a couple of other, much smaller, companies. The big guys used the most expensive, most prestigious law firms in the world, and there’s no question that they put well-qualified lawyers on those accounts. But none of those lawyers knew what operating system kernels, nonuniform memory architectures, virtual device drivers, or hazardous waste manifests were. Yet those were what the fights were about.

So your lawyer will charge you $300 an hour (or more) but won’t keep you out of trouble. Use a lawyer if you need anything special of a legal nature, such as that involving IP, but you’re on your own for technical matters.

Getting Paid

If you’re a salaried employee, you’re going to get paid, unless your company is on the ropes, and in that case you’re probably already looking for another job. But many, if not most, PHP/MySQL developers are consultants or contractors, so timely payment won’t happen by itself. There are two parts to getting paid: invoicing and collecting.

Invoicing

Every project needs to have a written contract, even if it’s as simple as an e-mail outlining the key agreements. Unless you’re working as a volunteer, as I was on the Conference on World Affairs system, those agreements have to include the following:

  • How much you’ll be paid.
  • How often you’ll invoice the client.
  • When the client will pay the invoice.
  • Who exactly gets the invoice.
  • What special codes you need to reference, such as project number or supplier number.

Don’t be surprised if whoever hires you for the job doesn’t know the last two. If you don’t find out the answers, you might send several invoices to accounts payable before you discover that they needed to go to project disbursement. Even then, you might find that if you leave off your supplier number your invoice might simply be ignored. Getting a call from a friendly person who offers to write in some key piece of information is a luxury you can’t count on. Many organizations welcome an excuse to delay payment. Try not to help them out.

I’ve always worked by the hour, never on a fixed-price contract. By the hour you’re on the client’s team. Working at a fixed price makes you an adversary, with every requirements change or bug report being an occasion for disagreement. Don’t do it.

How much per hour? It depends on who and where the customer is. Fees in Albuquerque or Boise are probably half of what they are in New York or San Francisco. Fortune 500 corporations pay much more than mom-and-pop operations. In fact, charge less than $125 or so per hour and a Fortune 500 corporation won’t even hire you, because you’re obviously unqualified to do their work. I’ve on occasion given a discount if a certain amount of work was guaranteed, since I knew that I wouldn’t have as much downtime while I was looking for my next gig.

Expenses—travel, equipment, software, and so on—should be extra, if possible. The Richardson School District couldn’t justify paying travel for an out-of-state contractor, so for them I rolled travel expenses into my hourly fee. That was fairly easy to calculate because we had agreed on two two-day trips a month.

Find out what documentation you need for expenses, what the limits are, and, in the case of equipment, whether and when it has to be returned and to whom.

Do whatever you need to do to find out exactly where the invoice is to be sent and how (e-mail, PDF, a corporate-vendor web site, etc.). And make sure you have all the reference codes you’ll need so they’ll know who the invoice is from and that it’s authorized. (More about this in the next section.)

Get your invoices in promptly. I had a client go bankrupt once and never got paid for my last invoice because I delayed sending it in for a couple of weeks.

Collecting

You would think that if you submitted a proper invoice the client would send you a check, right? It doesn’t always work that way, as it didn’t in the following cautionary tale.

I was working as an expert witness for a large Chicago law firm whose client, Microsoft, was being sued for breach of contract by another software company with which it had a joint-development contract. I was directed to send my invoices to the law office, which I did, and the first two were paid on time. But, starting with the third, nothing.

The law office told me that they shouldn’t have even paid the first two, because they were supposed to go through Microsoft’s legal-services system, and that’s what I would have to deal with thenceforth. A few days later I got an e-mail with the signup information for something called MS Invoice.

I went to the web site and started filling out the forms but got stuck because I didn’t know the PO number. Several e-mails went back and forth in an attempt to get it, during which I was told to use DataCert, not MS Invoice. Logging in to DataCert took more e-mails, one of which asked me for the name of my Microsoft contact, which I didn’t have. (I spoke to no one at Microsoft during the case; expert witnesses generally don’t speak directly to the party they testify for.) I read in the instructions that there was a substantial fee to use DataCert to cover setup costs. When I complained, I was told there would be no fee. There was also a dense, multipage legal agreement to sign. In the end, I signed the agreement and took their word that there would no fee.

Once I got into DataCert, I needed a Matter Number, which I also didn’t have. More e-mails to get it. Eventually, after weeks of this going back and forth, I was able to get my invoices recognized by the system, at which point I found out they would be paid in 90 days. I did eventually get paid everything they owed me, but, aside from those first two invoices, the total wait for invoice three was about six months.

So watch out if you’re working for a bureaucratic outfit like Microsoft. I don’t know if its ridiculous scheme is a deliberate way of improving its cash flow, or if it’s just complexity gone mad. Either way, getting paid was a challenge.

To add insult to injury, Microsoft specifically forbade me from billing Microsoft for the time it took me to bill Microsoft. Thus, several hours of my time went unpaid.

(In case you’re curious, I never did find out what happened with the lawsuit, as it was settled out of court, as most are, and the results were kept secret. I asked my lawyer contact what happened, but he just laughed and said he couldn’t tell me.)

The lesson: An agreement to pay you so much per hour is good, but in and of itself it won’t get you paid. Find out what you have to do to actually get paid, or you’ll wait a long time.

Chapter Summary

  • The customer for whom you develop the application determines its success, so you need to know who those customers are and what it will take to satisfy them.
  • The three dimensions of a project are requirements, people, and schedule. Setting any two determines the third.
  • The quality of the development team is the second-most important determinant of whether the application will succeed. (The first is having the right requirements.)
  • You have to schedule even though some factors, like requirements and how long it will take to implement them, are unknowable.
  • For PHP/MySQL projects, there are simple and obvious ways to divide the work. One guideline is to keep conversion and database design together, along with perhaps reports.
  • Always have a written contract, but you probably don’t need a lawyer to write it.
  • Just because you invoice the customer doesn’t mean you’ll get paid anytime soon. You also need to know how to collect.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.173.112