TweetFollow Us on Twitter

June 96 - The Veteran Neophyte: Manual Labor

The Veteran Neophyte: Manual Labor

JIM MENSCH

As a 14-year Apple veteran, why would I be writing a "neophyte" column? It's true that I've written system software for many Apple computers and I've been in every tech support capacity that Apple has ever dreamed of. I'm writing this because I'm in fact still wet behind the ears; I learn new things every day here at Apple. Most of what I learn involves problem solving and debugging. I believe that creative problem solving is the one trait that separates a great programmer from an average programmer. Great programmers must hone their problem-solving skills all the time, whether at a computer or not. In fact, sometimes examining how day-to-day problems are solved can help us develop proper coding and debugging skills at work. Here I'd like to relate a little fable to illustrate this point (the names have been changed to protect my automotive pride).

A FABLE

Bob and Stu were working on a primo 1963 Dodge Dart that they had just bought. It was a classic: push-button transmission, cherry upholstery, straight body. A classic car with a classic problem: it had been run dry of oil and the engine needed to be rebuilt. Flush with confidence (having just completed an engine rebuilding course at the local community college), Bob said, "No problem, man. Let's rebuild it ourselves; how hard can it be?" That, I suppose, was the first mistake.

So, Bob and Stu set out to rebuild the engine, using all new parts. A scant two months later, the ten-hour job was finished. Finally they were ready to install the engine. Struggling to get the 1000-pound engine into the car and onto two very small bolts that hold it at an angle too obtuse to allow it to drop in straight, they were cussing and cutting themselves constantly.

After a while it dawned on them that things were not going as planned. In a moment of brilliance, Stu said, "Hey, what does the manual say about installing this thing?" The manual! Every good car mechanic has a manual and follows it. Why didn't I -- er, Bob -- think of that? Reading the manual, they found that the torque converter (a big heavy round thing with teeth on it) was supposed to be mounted not to the engine but to the transmission!

They pulled out the engine and struggled for an hour to get the converter mounted to the transmission. After this the engine went in relatively easily (with the help of Thom the helpful Brit). Having connected all the hoses, belts, doodads, and whatnots, our intrepid pair looked at each other with giddy anticipation. "Could it be that we're ready to start this thing?" they wondered. So they tried to start it -- and they failed to start it. Just as with every major programming project, they had put in countless hours, and when the time came to fire the baby up, nothing happened.

It was time to debug this problem. "Hmm. Seems like a compression problem. Do we have compression?" asked Stu. "Yup, it's low, about 60%, but I guess that's because the engine hasn't been broken in yet," replied Bob. Were the plugs firing? Ground one side, turn out the lights, look for the blue spark: of course they were firing. Was the gas getting to the carburetor? Not yet, so they siphoned some up and tried again. Still no go.

So they started looking at the esoteric stuff. Was the timing chain on correctly? Well, we have compression, and it seems that we shouldn't if the timing is wrong. Three hours later, after Bob browbeat Stu into agreeing that the timing must be correct, Stu browbeat Bob into testing it anyway, since while Bob talked a good game it was always possible that he was wrong. They partly disassembled the engine and watched the little valve bits go up and down, and sure enough the timing was right. A victory for Bob, hollow as it may have been.

They continued to argue about what the problem could be, and finally decided to let it rest a while. This went on for weeks, until one day Bob remembered something that his teacher told him in class: a tablespoon of oil in every cylinder will get the seals sealing so that an engine could start. Could it be that easy? Could it be that the first thing that they had looked at -- the compression -- was in fact what was preventing the engine from starting? Bob put a little oil in each spark plug hole and the mighty engine roared to life! Our heroes stood dumbfounded at first, then quietly patted themselves on the back for such a fine job. Months after they had started their odyssey, they finally got the beast running.

YOU'RE NEVER TOO SMART TO READ THE MANUAL

The first thing to notice is that reading the manual was not the first step Bob and Stu took toward solving their problem. Neglecting to read the manual cost them hours of avoidable frustration and rework. Like Inside Macintosh, automotive manuals contain many hidden gems that are there for the asking. For instance, the shop manual didn't explicitly say, "Don't be a moron; the torque converter stays attached to the transmission!" but it did say, "Step 9. Remove torque flex plate screws, leaving converter attached to transmission."

Inside Macintosh contains many such tidbits waiting to be found. For instance, I was recently asked by a developer why a particular call to close a window wasn't causing the window behind it to redraw properly (it was leaving a desktop-patterned hole behind). Examining the problem a little further, we found that a resource that was needed had been purged and wasn't being reloaded. The code was smart enough not to crash when the purged resource was discovered, but it didn't seem to be able to reload the thing. As it turns out, the developer was using a rather strange strategy for manipulating the ResLoad attribute of the Resource Manager. He was turning it off when he wanted it off but not turning it back on again right away; instead he would turn it back on when he needed it on. I pointed out to the him that this was the problem, and he said, "I've been programming the Mac for almost 10 years and I've never read anywhere that the Window Manager assumes ResLoad is TRUE!"

While he's right about this on the surface, if we look we find that Inside Macintosh warns in the SetResLoad description that "If you call SetResLoad with the load parameter set to FALSE, be sure to . . . set [it] to TRUE as soon as possible. Other parts of system software that call the Resource Manager expect this value to be TRUE." (This has been in there so long that Caroline Rose wrote the first draft of it!) Since the WDEF is system software, it assumed that ResLoad would in fact be TRUE. After I pointed this out, the developer decided it was time to break out those manuals that had been collecting dust for so many years, and revisit some of the documentation he thought he had remembered.

YOUR FIRST INSTINCT IS USUALLY THE BEST

Another lesson to learn is that when problems arise, don't spend hours plodding through esoteric logic. First think, "What's the most obvious cause of this problem?" You might recall that Stu was right when he suspected a compression problem. By discarding the obvious without first examining it fully, we risk costing ourselves days of work only to find out that we were right all along. As a seasoned programmer, you'll learn that you can get a feel for why a problem exists. You may not have any ready logic to explain why an event occurred, but you might have a feeling anyway. Go with that feeling. The obvious things are the easiest to check (but don't make it too easy and stare past the real trouble). They're also usually the quickest to fix. Looking there first can save time, effort, aggravation, and lots of cussing. In my 14 years of problem solving for Apple, I've found that the simple, obvious solution is right 90% of the time.

CONFIRM YOUR LOGIC WITH REAL EXAMPLES

Why did Bob and Stu retest the timing, anyway? Experienced troubleshooters, they realized that simply arguing about a point may lead to a conclusion, but any conclusion that can be tested should be. Logic dictates that the cam shaft can be 180deg. out of phase (for every rotation of the cam shaft, the crankshaft rotates twice and thus will be in the same position at 0deg. cam rotation as 180deg. cam rotation), but you should check it anyway if you're stuck. It's easy to get your logical conclusions backwards and get your crankshaft 180deg. out of phase. On a car this might result in outright failure, while on a computer it can mean more insidious things.

I recently needed to use the Power Manager to control screen dimming, drive spindown, and CPU sleep. All of the calls had a "get" function that returned a Boolean, TRUE if the feature was on or FALSE if it was off. Strangely enough, two of the "set" calls required a value of TRUE to enable the feature but one required TRUE to disable the feature. I spent hours looking at the complex logic of IF statements before I simply watched it all go by in MacsBug and noticed that I was sending a TRUE value to a call named Disable. Going back through my logic again brought the error right out.

BACK TO WORK

If you've learned anything from the above tale, good. Remember, manuals contain quite a lot of information and they're a good place to start. Also remember that this isn't rocket (or automotive) science. Think simple thoughts; don't create extra work for yourself.

JIM MENSCH (mensch@applelink.apple.com, AppleLink MENSCH) has spent the last 14 years as a wage slave at Apple. Before that he did real work that involved cleaning and lifting and toting stuff and working with tools. While his mother is his real inspiration in life, he looks to the relaxed masses for guidance. An avid book collector and cook, he has absolutely no time for computers when he's not at work. His personal motto is "Eat more beets."*

 
AAPL
$100.58
Apple Inc.
+0.01
MSFT
$45.22
Microsoft Corpora
+0.27
GOOG
$583.37
Google Inc.
-1.12

MacTech Search:
Community Search:

Software Updates via MacUpdate

Pages 5.2.2 - Apple's word processo...
Apple Pages is a powerful word processor that gives you everything you need to create documents that look beautiful. And read beautifully. It lets you work seamlessly between Mac and iOS devices. And... Read more
Quicken 2015 2.0.1 - Complete personal f...
The new Quicken 2015 helps you manage all your personal finances in one place, so you can see where you're spending and where you can save. Quicken automatically categorizes your financial... Read more
CleanMyMac 2.2.7 - Delete files that was...
CleanMyMac makes space for the things you love. Sporting a range of ingenious new features, CleanMyMac 2 lets you safely and intelligently scan and clean your entire system, delete large, unused... Read more
MacFamilyTree 7.2.4 - Create and explore...
MacFamilyTree gives genealogy a facelift: it's modern, interactive, incredibly fast, and easy to use. We're convinced that generations of chroniclers would have loved to trade in their genealogy... Read more
Videobox 4.1.1 - Download Flash video th...
Videobox allows you to quickly and easily download Flash video from most all of the popular video sites on the internet. Videobox will convert the video into a native Quicktime format so it's ready... Read more
Web Snapper 3.3.5 - Capture entire Web p...
Web Snapper lets you capture Web pages exactly as they appear in your browser. You can send them to a file as images or vector-based, multi-page PDFs. It captures the whole Web page - eliminating... Read more
Picasa 3.9.138 - Organize, edit, and sha...
Picasa and Picasa Web Albums allows you to organize, edit, and upload your photos to the Web from your computer in quick, simple steps. Arrange your photos into folders and albums and erase their... Read more
Tidy Up 3.0.15.0 - Find duplicate files...
Tidy Up is a complete duplicate finder and disk-tidiness utility. With Tidy Up you can search for duplicate files and packages by the owner application, content, type, creator, extension, time... Read more
Parallels Desktop 10.0 - Run Windows app...
Parallels Desktop is simply the world's bestselling, top-rated, and most trusted solution for running Windows applications on your Mac. With Parallels Desktop for Mac, you can seamlessly run both... Read more
Apple Final Cut Pro X 10.1.3 - Professio...
Apple Final Cut Pro X is a professional video editing solution.Completely redesigned from the ground up, Final Cut Pro adds extraordinary speed, quality, and flexibility to every part of the post-... Read more

Latest Forum Discussions

See All

Pentumble (Games)
Pentumble 1.0 Device: iOS Universal Category: Games Price: $1.99, Version: 1.0 (iTunes) Description: *** Special Launch Price! 33% Off! *** Pentumble combines the joy of a free-flowing platformer with beautiful graphics and levels... | Read more »
DotEmu Summer Sale Cuts Several Games’ P...
DotEmu Summer Sale Cuts Several Games’ Prices to $0.99 Posted by Ellis Spice on August 21st, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
King Announces its Newest “Saga” – Diamo...
King Announces its Newest “Saga” – Diamond Digger Saga Posted by Jessica Fisher on August 21st, 2014 [ permalink ] Diamond Digger Saga, by King Digital Entertainment, promises to be another addictive, adorable game in the “Saga” | Read more »
Spacetime Studios’ Greg Mueller Tells Al...
| Read more »
TourStar Review
TourStar Review By Rob Thomas on August 21st, 2014 Our Rating: :: BORING TOURINGUniversal App - Designed for iPhone and iPad When The Ramones sang “Touring, touring/It’s never boring,” they clearly weren’t referring to TourStar.... | Read more »
Track Your Pregnancy with Glow Nurture
Track Your Pregnancy with Glow Nurture Posted by Jessica Fisher on August 21st, 2014 [ permalink ] iPhone App - Designed for the iPhone, compatible with the iPad | Read more »
Outcast Odyssey – An Interview with the...
At this year’s San Diego Comic-Con, fans got the chance to meet and mingle with several of the artists behind Magic Pixel Games and Namco Bandai’s upcoming card battler, Outcast Odyssey. Considering many of these artists have worked on comics in the... | Read more »
BoxPop Review
BoxPop Review By Jennifer Allen on August 21st, 2014 Our Rating: :: UNTAXING PUZZLESUniversal App - Designed for iPhone and iPad Move from tile to tile to clear the board in this slightly too simple and easy puzzle game.   | Read more »
Breakdown Buddy Review
Breakdown Buddy Review By Jennifer Allen on August 21st, 2014 Our Rating: :: FLAWED CONCEPTiPhone App - Designed for the iPhone, compatible with the iPad There’s a good idea here, but Breakdown Buddy isn’t as useful as it tries to... | Read more »
jamstik, the Guitar You Can Take Everywh...
jamstik, the Guitar You Can Take Everywhere, is Now Available for Purchase Posted by Jessica Fisher on August 21st, 2014 [ permalink ] Zivix has announced that their guitar-in-your-pocket, | Read more »

Price Scanner via MacPrices.net

Pro.Calendar – New Productivity App for iPad...
Austin, Texas based mobile business and productivity app developer LightArrow, Inc. has announced Pro.Calendar, a powerful and intuitive calendar app with eight versatile calendar options including... Read more
SanDisk Ultra II SSD — Supercharge Your Syste...
SanDisk Corporation has announced the new SanDisk Ultra II SSD with enhanced SSD Dashboard. The new drive is designed to deliver a cost-effective and easy upgrade solution for PC owners looking to... Read more
Samsung and Barnes & Noble Introduce New...
Samsung Electronics America and NOOK Media, a subsidiary of Barnes & Noble, Inc. have announced the introduction of the new Samsung Galaxy Tab 4 NOOK, a 7-inch tablet combining Samsung’s leading... Read more
21-inch iMacs on sale for up to $150 off MSRP
B&H Photo has 21″ iMacs on sale for up to $150 off MSRP including free shipping plus NY sales tax only. B&H will also include a free copy of Parallels Desktop software: - 21″ 2.7GHz iMac: $... Read more
27-inch 3.2GHz iMac on sale for $1698, save $...
Abt has the 27″ 3.2GHz iMac on sale for $1698 including free shipping. Their price is $101 off MSRP. Read more
Mac Backup Guru 2.0 Drive Backup/Cloneing Uti...
Mac Backup Guru developer MacDaddy has released Mac Backup Guru 2.0, offering new and enhanced advanced features, such as bootable backups, synchronised volumes and folders, and a Snapshot mode that... Read more
Operate GE’s New Free-Standing KItchen Range...
Think you accidentally left the oven on? Switch it off while on the go. The new free-standing Profile™ Series gas and electric ranges are GE’s second cooking appliances, following their wall oven, to... Read more
Parallels Announces Parallels Desktop 10 for...
The no. 1-selling software for running Windows applications on a Mac becomes an even easier choice for millions of consumers and IT professionals worldwide with the launch of the most powerful... Read more
Apple now offering certified refurbished 2014...
 The Apple Store is now offering Apple Certified Refurbished 2014 MacBook Airs for up to $180 off the cost of new models. An Apple one-year warranty is included with each MacBook, and shipping is... Read more
Best Buy’s College Student Deals: $100 off Ma...
Take an additional $100 off all MacBooks and iMacs, $50 off iPad Airs and iPad minis, at Best Buy Online with their College Students Deals Savings, valid through September 6th. Anyone with a valid .... Read more

Jobs Board

*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
Position Opening at *Apple* - Apple (United...
**Job Summary** As more and more people discover Apple , they visit our stores seeking ways to incorporate our products into their lives. It's your job, as a Store Read more
Position Opening at *Apple* - Apple (United...
…Summary** As a Specialist, you help create the energy and excitement around Apple products, providing the right solutions and getting products into customers' hands. You Read more
Project Manager, *Apple* Financial Services...
**Job Summary** Apple Financial Services (AFS) offers consumers, businesses and educational institutions ways to finance Apple purchases. We work with national and Read more
*Apple* Solutions Consultant (ASC)- Retail S...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.