flying-manLike anybody else in the industry, our team recieves vague requirements. But we overcame disorder called “You Asked Me The Wrong Question”. We mastered The Art Of Making Assumptions.

It is an outstanding method for turning vague requests into clear requirements.

Here is how it works. For example, client wants us to build an airplane. Literally, they say: “Build us an airplane.” This request makes no sense to engineer. There is a million of variables.

Rookie engineer will ask: “What kind of airplane?” And will get very helpful answer: “Big one.” But we are not that naive. We’ve been working with this client for some time already and know what they usually want. We respond with the following:

Dear Client,

We assume that you want us to build an 18 passenger jet with operational radius of 1000 miles.

Please confirm.

Regards,
Developers.

This simple approach is incredibly powerful. Specific questions get better answers than generic questions. Assumption is ultimate form of specific question, because it also contains the answer. Even if your assumption is wrong, you gave your client an example of what kind of answer is implied. This decreases chances for getting useless answers.

This works especially well for distributed teams. When you are several timezones away from your client, simple question-answer cycle can take a whole business day!

By thinking ahead and confirming assumptions instead of asking quesitons we save tons of time.

Photo from LIFE archive

I am not sure why I love Michael Lopp’s writing. It is far from perfect. And yet very enjoyable and often eye opening. I think the key here is that he and I are both on the same career path: software engineer evolved into management role. The difference is, Michael is 10 years ahead. Reading him for me is like talking to a wiser, more experienced version of myself.

managin_humans“Managing Humans” is largely based on entries Michael posted on his blog and it shows. It is not sequential systematic material. Rather, it is a collection of related articles. And chapters do vary in quality.

This review is a chapter-by-chapter guide, which designed to direct you to the good parts of this book.

SKIP: Chapter 1 – Don’t Be a Prick. Covers why book is called “Managing Humans”. We usually see this sort of material in preface. As most prefaces it is optional.

READ: Chapter 2 – Managers Are Not Evil. Probably the best chapter in the whole book. Michael reveals the nature of relationship between you and your manager at the level which was new to me:

Ironically, the second most common complaint I’ve heard from frustrated employees is, “My manager has no idea what I do.” There are a couple of possible causes for this situation. Your manager may not care what you are doing. It doesn’t mean the work you are doing is good or bad, it’s just not on his radar. Some folks find this arrangement of ignorance to be a cozy, warm blanket. It’s a no-fuss job. No awkward hallway conversation, just me and my code and . . . I’m what? I’m fired? Holy shit. Well, that’s the risk of having a covert job.

He describes a great strategy to evaluate your manager, and covers a touchy topic of over-delegation . Wonderful, wonderful material. Read it, know it, love it.

SKIP: Chapter 3 – The Monday Freakout. Chapter explores a situation when somebody on your team starts to panic. Another chapter to skip on your first read. You can go back to it when you have time for a couple of laughs.

READ: Chapter 4 – Agenda Detection. Chapter describes a systematic approach to ancient problem of meetings. It provides a framework to identify who wants what from a meeting. Get in, detect the agenda, help to move the issue in the right direction and get the hell out. Choice of true managers. Must read. Also see Chapter 26 – Meeting Creatures – on the same subject.

READ: Chapter 5 – Mandate Dissection.Team is not sure what to do next and everybody argues? But you will have to make a decision! And half of your team will not be happy about that. Chapter explains how to deliver controversial decisions so that rioting does not start. Five stars to author for this one.

READ: Chapter 6 – Information Starvation. Somewhat flaky chapter but worth reading nevertheless. Your job as a manager is to provide your team with relevant information and feedback. If you don’t – they might waste their time worrying, gossiping, and being otherwise unproductive. Author describes “Aggressive Silence” technique to determine how much information team needs.

SKIP: Chapter 7 – Subtlety, Subterfuge, and Silence. There is only one important message in this chapter: managers should listen more:

Managers lead, and a lot of managers translate that into “managers lead by talking.” We think we’re guiding you by filling the air with our thoughts. There’s a time and place for that, but in order to fill the air with something relevant, you’ve got to gather and process data. In silence, you can assess

READ: Chapter 8 – Managementese. Management lingo, “managementese”, is important language which helps different part of organization to understand each other. Author warns us, however, that we should refrain from using it when talking to our team:

The main issue folks have with managementese is not that they don’t understand what is being said; their issue is that they don’t trust it.

MUST READ: Chapter 9 – Technicality. Oh, my god, this question tortured me for ages! As a manager – should I write code or should I not? Pros and contras are all well known. Author’s answer makes a lot of sense: “stop coding and start programming again”:

1. Use the development environment to build the product.
2. Be able to draw a detailed architectural diagram describing your product on any whiteboard at any time. I’m not talking about the three-boxes-and-two-arrows versions. You need to know the detailed one, the hard one that isn’t pretty and is tricky to explain.
3. Own a feature. You are still a manager, so make it a small feature, OK? You’ve still got a lot to do. If you can’t imagine owning a feature, my backup advice is to fix some bugs.
4. Write a test script. I still do this late in the product cycle when folks are losing their minds. This is a simple script that you run with each build. Think of it as your checklist for understanding what your product does. Show it to coworkers. Do it often.

READ: Chapter 10 – Avoiding The Fez. Even though this chapter is build around fictional problematic programmer named Fez, it is in fact about how to prepare for annual review and evaluate an employee. Another must read.

READ: Chapter 11 – Your Resignation Checklist. Great chapter with some do’s and don’ts when leaving a company. Some of them is plain common sense, but some surprised me. For example – “Don’t volunteer to do work after you leave” and “Don’t give to much notice.” Worthy read.

SKIP: Chapter 12 – Saying No. Not particularly coherent chapter about courage to say “no” to your manager when he is not making sense.

READ: Chapter 13 – 1.0. This chapter is mostly about fundamental structure of a technical startup. It operates in such terms as “pitch”, “people”, “process”, and “product”. The chapter is addressed to an entrepreneur rather then to a manager. It is hard for me to judge since I never worked in a startup, but ideas author describes seem to make sense. Read if you work in a startup and let me know what you think. :)

READ: Chapter 14 – Taking Time To Think. Chapter describes in very specific, prescriptive manner how to harvest and work on ideas for a new product. Two meetings a week: one for brainstorming and another for prototype review. Participants must change, venting should be limited, records must be kept. Lots of meat in this chapter, good read.

READ: Chapter 15 – The Soak. Author describes a brain phenomena of background processing and decision making. He shares some ideas on how to leverage this ability:

I break soaking activities into two buckets: active soaks and passive soaks. The active soaks are activities that you can direct and usually involve gathering content, whereas passive soaks are activities when you just point your brain in a random direction and pray. Passive soaks are where the real work gets done.

READ: Chapter 16 – Malcolm Events. Chapter defines Malcolm Events as “Seemingly insignificant events that are intent on screwing you in an unlikely way.” Because of their insignificance, it is hard to recognize a Malcolm Event. To mitigate the risk of Malcolm Events author suggests proper artifact capturing system and provides some guidelines regarding what proper artifact capturing technique for this cause should be.

SKIP: Chapter 17 – Capturing Context. Skip, unless you are not familiar with the concept of version control.

READ: Chapter 18 – Status Reports 2.0. Author explains how status reports emerge as organization grows, and why everybody stops reading them. Author provides a recipe how to fix status reports. Chapter is worth reading and recipe is worth considering.

SKIP: Chapter 19 – Trickle Theory. If you estimated a task to take 45 hours, it might only take 7 hours, as it happened with author. Yeah, right. Happens to me all the time. Yet in some cases it worth attacking an impossible task without thinking too much. The question is how to identify those cases? Author does not answer this question. I say, tentative reading.

READ: Chapter 20 – A Glimpse and a Hook. Do you know how resumes are processed by recruiters and hiring managers? Author provides solid advice on how to write a resume which will go through camel’s ear of this process and get you a phone screen. Its a great summary of what you already know from other sources. Most definitely read it when it is time to update your resume.

READ: Chapter 21 – Nailing The Phone Screen. A decent overview of how to successfully pass a phone screening interview.

READ: Chapter 22 – Ninety Days. Through an interview you will only get a hint of what your new life is going to be. On a new job you have 3 months – 90 days to complete your interview. Mark these 90 days on calendar and roll up the sleeves. Chapter contains a list of things to do. A must read for anybody starting on a new job.

READ: Chapter 23 – Bellwethers. What kind of people you involve to interview a candidate? Author suggests involving Technical Bully, Culture Compatibility Detector and Vision Detector. After each one speaks to the candidate, make sure to have interview feedback meeting with all three.

SKIP: Chapter 24 – NADD (Nerd Attention Deficit Disorder). Author describes a NADD phenomena which seems to affect many modern programmers. I think you can safely skip it.

SKIP: Chapter 25 – Nerds Cave. Author talks about his home office and how he gets in the zone. Definite skip.

READ: Chapter 26 – Meeting Creatures. Aaah, good stuff again. Wonderful article about meeting inner structure and logic. Describes some of the most popular meeting creatures including The Anchor, Chatty Patty, Mr. Irrelevant, and other famous people. Read this chapter three times in a row to get +25% bonus to your meeting handling skill.

SKIP: Chapter 27 – Incrementalists and Completionists. One of the oldest holy wars in the book (yes, there is a book of holy wars). Author recommends that you figure out whether you are incrementalist or completionist and look for complementing qualities in your coworkers.

READ: Chapter 28 – Organics and Mechanics. Do you approach problems in systematic orderly fashion or you try different things and reach out to people chaotically? How about your boss? Is he different? Does that create problems between you? In this chapter author introduces Mechanics and Organics to describe these two types of problem solvers:

Mechanic: “An itch. Well. This itch seems familiar. In fact, I scratched this type of itch in January 2001. Let me first dig up my notes regarding that itching. Excellent. We’re going to need a matrix. The vertical column will be action items I can think of that will assess different scratching scenarios and the vertical axis will measure our progress against these different scenarios. OK, we’re going to need a meeting to form a committee . . .”
Organic: “Wow, an itch. Hmmmm . . . well, this sucks. Hey Frank, we’ve got an itch . . . whaddya think? Yeah, that’s what I was thinking. You know, this itch seems familiar . . . I think I’m going to deeply consider this itch while I drive home, but first, where’s Mary? She knows all about itches and I bet she’ll have some ideas . . . I wonder what happens when I type itch in Google . . . Hey . . . there’s an idea . . .”

It might be a challenge for Organic and Mechanic to understand each other. The chapter provides an advice on breaching the gap.

READ: Chapter 29 – Inwards, Outwards, and Holistics. Chapter describes three different types of managers depending on where their attention is directed to: Inwards – to to their team, Holistics – across the organization, Outwards – outside of the organization. Apparently I am an Inward with a hint of a Holistic. Interesting way of looking at management.

READ: Chapter 30 – Free Electron. Author describes a phenomena of Free Electron. Most likely you know this type of a guy. Very bright technical person who can quickly solve a wide range of technical problems. Somebody who writes code 10 times faster than anybody else and being thrown to put out most difficult fires. Got the picture? Know the guy? Alright. Besides that there is some advice regarding how to use a Free Electron properly so that he keeps solving these hard problems for you.

READ: Chapter 31 – Rules for Reorg. A number of wise observations regarding how to weather a reorganization and use it to your advantage:

Well, if we’re going to solve problem A right now, we should take a stab at problem B since we’re going to be mucking with everything anyway.” If you’ve got an agenda, if you’ve got a change in mind, it’s time to consider pushing it because the chances that you can effect change are vastly higher in the midst of a reorg.

SKIP: Chapter 32 – Offshore Risk Factor. Chapter outlines a method to evaluate whether you are at risk of being outsourced. Mostly common sense, therefore skip.

SKIP: Chapter 33 – Joe. Another chapter on outsourcing. Sort of a case study and an attempt to apply principles from previous chapter.

SKIP: Chapter 34 – Secret Titles. There is an official title – what is printed on your business card – and secret title – what you actually do. Author claims that some problems with managers occur because they don’t understand what your secret title is. Make them aware of your secret title and these problems will go away.

Ooookay. Will do.

Skip it.

Bonus! Memorable quotes from Michael Lopp:

  • Managers don’t start crazy. Its a learned trait.
  • Meetings are always going to be inefficient because language is hard.
  • Part of management is getting folks to comfortably bend in an uncomfortable direction
  • As a manager you are representing the company until the moment you are out the door.
  • Shipping a 1.0 product isn’t going to kill you, but it will try.
  • Panic is the mother of the path of least resistance.
  • The best sign of a productive design process is that the players change.
  • Call it bureaucracy, call it group think, but understand that very large groups of people working together barely looks like working because they move so slowly.

Children study things by taking them apart. As software professionals we are overly concerned about NOT breaking things. So concerned, that even in controlled, safe environment we rarely break our software on purpose.

What purpose, you say?

To see how it fails and learn from it!

Couple of weeks ago I was giving a bath my daughter Sasha. My phone rang. There was a problem in production. One of the apps we support was showing an alert. It was complaining it could not access a certain folder. I wrapped Sasha in a towel and we went to computer to investigate. Looking into logs Sasha and I quickly realized that the folder in question was located on a remote server. This server was not responding to pings.

I called operations and asked him to check that server. As it turned out, it was powered down. Operations turned it on and alert cleared.

Now, our client never turns off production servers just because they feel like it. They run very organized operations. So it was not a production server. It was an old staging server. It was not in use for a long time and the guy responsible for it decided to turn it off.

Two hours later, I got a call.

On a next day I tried to find out why our production app depends on staging infrastructure. Our team took this app over from Dan, Dan got it from Joe and Joe got it from Dmitry, and Dmitry developed it. As I worked my way through this chain of programmers, I kept hearing the same story: “I do not know why it is pushing files to staging. It was like that when I took over.”

But Dmitry revealed the shocking truth to me: “Oh, I added this for debugging and forgot to turn it off.”

You hear it? When we maintain old code, we tend to be way too careful. This is very hard to overcome. This is how our brains are wired: behavior which does not kill or injure us is remembered as “safe”. And not changing the old code usually keeps as alive and unscaved.

But this is not they way to deal with old system in active maintenance. Sooner or later you will have to make big changes. And if you did not break this code on purpose regularly, you will not know it good enough.

Every time I catch myself being afraid to break old code, I open Michael Feathers’ “Working Effectively With Legacy Code” and look for encouragement. And it is right there on almost every page! Some day I will write a great review of this book. But for now, here is a quote about breaking code for learning:

One of the best techniques for learning about code is refactoring. Just get in there and start moving things around and making the code clearer. The only problem is, if you don’t have tests, this can be pretty hazardous business. How do you know that you aren’t breaking anything when you do all of this refactoring to understand the code? The fact is, you can work in a way in which you don’t need to care— and it’s pretty easy to do. Check out the code from your version-control system. Forget about writing tests. Extract methods, move variables, refactor it whatever way you want to get a better understanding of it —just don’t check it in again. Throw that code away. This is called Scratch refactoring

Photo by su-lin.

writers_blockToday I finished working on my first big business proposal. The project is big enough to make thirty men busy for a whole year. Seven-digits budget. It was a bumpy ride, and we missed the deadline by two hours. Overall quality of the proposal I think is acceptable, but barely. We might make it to the shortlist though.

So what can we learn from my experience?

Evaluate The Scale Of Disaster. Before you start reading Request For Proposal carefully, skim it first. Evaluate what kind of experts you will need and for how long. If you need a lot, start crying for help and explain to your superiors what will happen if you do not get help by Monday.

Create and Maintain a List of Client’s Requirements. Requirements will be scattered all over the Request For Proposal. As you read and notice them, write them down. Things like “no open-source components are permitted”, or “we will need at least 5 members of the team to be on-site”, or “here be dragons” must be kept track of. Publish it and make sure your teammates read it. When you have a draft, validate your proposal against these requirement.

Keep It Clean. Never (ever!) write in proposal anything that you do not plan to be part of the final document. Notes to self or comments for teammates. You will forget to remove them and you will regret it. Either track them in separate document or use commenting feature of your text editor (“Insert” -> “Comment” in MS Word 2003 for example). You will be able to remove them quickly without reading the whole document. More about this here – “Get rid of tracked changes and comments once and for all.

Broadcast Timelines And Expected Results. Don’t assume that people on the team understand the timeline just because you described it before. Keep informing all key players about milestones coming. Tell them exactly what you need from them to move project forward. This includes people above you. I am used to be that specific with people who report to me, but I failed this time to manage people above me. Hence the two hour miss on deadline.

Plan For Crazy Input. You will need to review estimates with people who produced them, if it wasn’t you. Discuss what assumptions they made, what estimation method they used, how much padding they built-in. What are the units: is it pure effort hours or working hours with interruptions, meetings, sick days and other nonproductive time cushioning embedded? Plan for these reviews.

Allocate Enough Time For Writing. Coming up with estimates and solutions is only a part of the job. Putting everything together in a coherent proposal document took me almost the same amount of effort as research.

After you are done writing, take a break. Grab a lunch, go for a jog. Review and edit all you wrote:

  1. Make sure each section is comprehensible. Is it short enough? Are diagrams and tables simple enough? Rearrange, redraw, simplify as necessary.
  2. Remove unnecessary words.
  3. If you cannot simplify and declutter – write a summary in the beginning of section.
  4. After this, take another break and review again to make sure that you did not introduce inconsistencies.

Leave enough time at the end for your boss to review. And then even more time for you to make changes based on his feedback. Ideally, you should finish the draft in around five business days before the deadline:

  1. One day for your own internal review
  2. Two days for your boss to review
  3. One day for you to make updates based on feedback
  4. One extra day to stop and the smell roses. :) Well, not really. Most likely you will continue reviewing and polishing until the cows come home.

Photo credit: Jonno Witts

danger-keep-back

It is quite common for managers to have problems with delegation. Especially those of us, rising from the ranks. We often just can’t let our toys go. We think nobody can do our job better than us. Or we think it is too much of a hassle to explain what needs to be done. It is easier just to do the work ourselves, right?

But we all know that this approach does not scale. Next thing you know is you are overworked and stressed while your team is twisting their thumbs and your project is two weeks late.

The opposite – over-delegation – is more dangerous, because it does not manifest itself as quickly as under-delegation. Lets say, you mastered the art of delegation and moved on to higher level of perceiving reality. But as you stop interacting with low level nitty-gritty details of your project on a regular basis, your level of understanding and quality of your work start to decline.

It might take you a while before you recognize the problem, and because of that it is harder to fix, than not-enough-delegation.

Michael Lopp writes wonderfully in his Managing Humans book:

The act of delegation is a slippery slope for managers. Yes, you want to figure out how not to be a bottleneck in your organization and, yes, you want to figure out how to scale, but you also want to continue to get your hands dirty.

Pure delegators are slowly becoming irrelevant to their organizations. The folks who work for pure delegators don’t rely on them for their work because they know they can’t depend on them for action. This slowly pushes your manager out of the loop and, consequently, his information about what is going on in his organization becomes stale.

Today I rolled up the sleeves and spent two hours on a pretty mundane task that deals with nitty-gritty details of my project. I could have easily delegated it to someone on my team. Nevertheless, this time was well spent. Now I have a better understanding of what the heck is going on with my project.

Photo by john-p.

spiral_time_thumb

I noticed recently that word “tomorrow” has practically disappeared from my emails. The problem is that you never sure when your email will be read. Your “tomorrow” can be their “today” or even “yesterday”. And when “tomorrow” is important deadline, you are in trouble just for not being clear.

This is particularly true for distributed team where members are many time zones apart. Your “tomorrow” becomes their “today” on a regular basis. Never say “tomorrow”, say “on Wed 1/20″. Similarly, never say “by the end of the day”. Instead say “by 6 pm London time”.

When you send meeting invitations, Outlook will take care of crossing time zones for you. But in all other cases it is safer to be specific and time zone agnostic.

Photo credit: AMERICANVIRUS

forgot_something

Human perception and memory works in a funny way sometimes. Two people seeing and hearing same thing filter and remember it differently. At work this can get you in trouble easily. One of the ways to mitigate this is to write follow-up notes.

Suppose, you spoke to your colleague John and came to a certain agreement. For example, you decided to use stored procedures and never use inline SQL. Not that there is anything wrong with paramentrized inline queries – they have their place under sun. But a month later you run into inline SQL statement in fresh code written by John. Surprised, you turn to him. But instead of talking to a reasonable person, you find yourself talking to a stranger. Stranger denies any memory of such agreement and advocates inline SQL to be the next best thing after Chinese takeouts.

And he is not doing it on purpose. At some point after your covnersation, his brain decided to alter the memory. He either forgot completely or remembers it differently now. So here is what I often do. After conversations, where decisions are made or agreements are reached, I write a quick summary email and send it to all participants. In case with John such note would go like this:

John,

As per our conversation:

1. We will use only stored procedures for database access in project “Server Not Available”.
2. You agreed to research on the Internet why Dilbert does not have a mouth.

Let me know if I missed anything.

Thanks!
Regards, Doe.

Follow-up notes help to resolve “spoken and forgotten” problem. When people have document in front of their eyes, they usually remember things better. If your conversation was one-on-one with John, CC somebody else when sending your email, your boss for example. This will increase John’s accountability.

Not only this trick improves memory of your co-workers, but also helps to avoid misunderstanding. Having things written down increases your chances for being understood correctly. By writing a summary you also create a paper trail and document a decision you made. You can later dig it up and present as a proof in case of any concerns.

As any other method, this one has it’s own place and time. For some projects this won’t make sense. In fact, there are organizations where follow up notes are not welcome and provoke violence. Therefore, apply carefully.

Photo by BillRhodesPhoto.

number-pillows1

There are two deadly sins of planning: no planing and too much of planning. Most of us have too many things to do. Therefore we need to plan. If we don’t plan, we spend our time reacting on things. It is probably ok if you are a firefighter or a support engineer, but for most people it doesn’t work..

So a plan is a must. And it has to be an accomplishable plan. Shortly after I started planning my days, I realized that I suffer from planning greed. Planning greed is a special kind of planning disorder when patient is trying to cram as much items into his day plan as possible. He neglects the fact that he cannot be productive 100% of his awake time, and that unexpected happens. As a result, he consistently makes unrealistic plans, consistently fails them and consistently feels bad about himself.

I tried to control my planning greed and practice lightweight planning: plan a little, but accomplish everything. Anything I can do beyond that is a bonus. Made me feel really good… both those days when I was able to stick to this principle. And boy, that was hard! These unfilled spots in my calendar are so empty and so tempting to fill! I have so much stuff to do! I just had to fill them all. So I fill them all, I fail and I feel miserable.

But then I invented a lifehack. I introduced a couple of fake one-hour daily appointments. I called them “Cushion 1″ and “Cushion 2″. They automatically appear on my schedule every day and provide, well, cushioning. Cushioning to account for unexpected and all sorts of unproductive activities like chatting with a colleague or procrastinating.  The rule is that I cannot remove these fake appointments from my schedule. I have to work around them. If something does not fit in, it is postponed.

It works pretty good for me. My plans are realistic, I am productive, I accomplish things. Feels good. If you are like me, and suffer from planning greed, try it. It might help you as well.

Photo by redshoesannarbor

crazy-eye-thumb

Ok. Relax. Breethe deep. I have some news for you. Your boss is not crazy. Yes, I am talking about that guy. The one that walks like a nutcase and talks like a loony. With pointy hair. The chances are he is very sane and reasonable man.

You see, his deal with your company is to think about stuff which doesn’t even cross your mind. More often than not you have no idea what he has to consider to make a decision. That is why his decisions seem crazy to you.

One of the team leads I work with told me: “I don’t understand this. Why do we need several vendors? Why does he make us work with Awkward Compatibility Inc.? You guys are so much better! You have better technical talent, you are better organized and you communicate more clearly. These guys from Awkward Compatibility is just a bunch of over-caffeinated squirrels. Why don’t he just work with your company?”

Well, I can explain that. I just happen to know why his boss works with multiple vendors: risk management. His boss knows very well, probably from painful experience, that life is full of surprises. Governments can be overthrown, economies can collapse, and earthquakes can destroy his vendor’s building with all 200 developers and the front desk girl.

That is why he diversifies. He gives some work to us, some – to Awkward Compatibility Inc., some – to Highly Coupled Code Written Quickly LLC. If anything happens to one of us, his projects won’t stall. It will be delayed, sure, but it will survive. But his team lead doesn’t think about that. It is not his job. All he cares about is having good programmers to work with.

Next time, when your boss says something stupid, don’t scoff and write him off as a loony. Your boss is not crazy. He is just on a different level of perceiving reality.

Photo by joshunter.

 

mainframe

We often complain about how hard it is to read and maintain legacy code. Now get this. I recently run into an old programmer, Ed. As often older guys do, he said:

“What do you boys know about legacy code that is hard to read! I programmed in machine codes! Try reading this code for example.”

And he gave me the following snippet:

100) 00 12 0001 0001
101) -10 00 0100 0001
102) -10 01 1000 2000
103) -20 01 0102 0104
104) -10 00 0000 0001

Yes. No words, just numbers. And then Ed turned it into a little game for me. He said:

“Ok, boy, I will give you some hints about this little program and I will ask you a question. If you can answer my question, I will buy you a lunch.”
“You are on, old timer”, I replied respectfully and the game started.

Here is what Ed told me. This program is written in machine codes for old Soviet mainframe computer “Minsk-22″. It copies 10 values from 10 subsequent memory cells from one memory area to another. Source area starts from address 1001. Target area starts from address 2001. Here is what happens line by line:

100) 00 12 0001 0001

Each line in machine code starts from memory address where this command should reside. This command will reside in memory cell at address 0100. It merely creates a constant in current memory cell (0100). The constant’s value is 0012 0001 0001. The second and the third parts of this constant (0001 and 0001 correspondingly) describe how the source and the target addresses will change in the loop. In this case both source and target address will increase by 1 on every iteration: 1001 and 2001, 1002 and 2002, etc. Ed did not tell the meaning of the first part of this constant (0012). That is what I had to figure out.

101) -10 00 0100 0001

This line prepares loop index variable. It consists of operator 10 and it’s three arguments: 00, 0100, and 0001. Operator 10 copies values from one memory cell to another. In this case – from cell 0100 (second argument) to cell 0001 (third argument). First argument (00) is optional and in this case is ignored.

102) -10 01 1000 2000

This line is the body of our loop. It copies value from source to target memory cell. Similar to line 101 above this line consists of operator 10 and it’s three arguments: 01, 1000, and 2000. In this line first argument (01) refers to our index variable at address 0001, second argument (1000) refers to the base address of source memory area and the third argument (2000) refers to the base address of target area.

103) -20 01 0102 0104

This line checks whether the loop is complete. If it is not complete, it jumps to line 102. If complete, jumps to 104. And finally,

104) -10 00 0000 0001

is just to have something outside of the loop. It resets our index variable.

So the question, again, what is value 0012 in the first line of this program? Why is it 0012? I was able to figure this out over one cup of tea. Can you?

The answer is below (white on white, just select to see):

Value 12 is an exit condition for the loop. It is relatively easy to conclude just by looking at the code provided. There is just no exit condition anywhere else! It must be it!

But why 12? This required some research. If you google for “Minsk-22″, you will probably get this link as the first result: Minsk Family of Computers. It mentions that “Minsk-2″ (predecessor of “Minsk-22″) used octal notation. Octal 12 is decimal 10! It just specifies number of cycles in the loop.

Photo by LIFE

Follow

Get every new post delivered to your Inbox.