
“I wrote FAT on an airplane, for heaven's sake” - Hrundi
http://blogs.msdn.com/b/oldnewthing/archive/2013/10/08/10454920.aspx
======
consultant23522
I had a manager that would repeatedly use this type of remark. We had this
particular application that on one could touch without breaking something. It
was always a mess. He would often remark "I wrote the whole thing over a
weekend, why can't you guys make a tiny little change without breaking it?"
One day I finally got fed up with him and replied "Because it's the quality of
work you'd expect from an entire application written over a weekend."

~~~
ryandrake
I once worked with a founder who would always pull that kind of garbage: "I
wrote [simple software with no dependencies or integration requirements] in
[N] days! Why is it taking you guys [M] months to write [complex software
relying on several 1st and 3rd party libraries, a component that needs to work
within a large, old legacy system]?

Good on the develop manager!

~~~
teddyh
There was once a programmer who was attached to the court of the warlord of
Wu. The warlord asked the programmer: “Which is easier to design: an
accounting package or an operating system?”

“An operating system,” replied the programmer.

The warlord uttered an exclamation of disbelief.

“Surely an accounting package is trivial next to the complexity of an
operating system,” he said.

“Not so,” said the programmer, “when designing an accounting package, the
programmer operates as a mediator between people having different ideas: how
it must operate, how its reports must appear, and how it must conform to tax
laws.

By contrast, an operating system is not limited by outward appearances. When
designing an operating system, the programmer seeks the simplest harmony
between machine and ideas. This is why an operating system is easier to
design.”

The warlord of Wu nodded and smiled. “That is all good and well,” he said,
“but which is easier to debug?”

The programmer made no reply.

— _The Tao of Programming_ , Geoffrey James

~~~
iSnow
I believe the developers working on Windows Vista, Copland, Taligent and
GNU/Hurd would like to have a word with Mr. James.

------
mrmaddog
I think the real lesson here is that every time you add a feature, you are
adding development overhead to every other feature, leading to exponential
development time. I'm sure if segment tuning was one of the first thing to go
into windows, it would have been much simpler to implement. However, at later
stages in the development you have to account for how different, already-
written applications are loading their memory, and thus the feature needs
handle far more edge cases than it would have if this was an earlier-
implemented feature. I'm not saying the overall time to develop segment-tuning
would be shorter, in the long run had it been developed first, but the
perception of development-time for this feature would be shorter (since any
segment tuning edge cases that you ran into while writing an application would
be considered part of the app's development time, not segment-tuning's
development time).

I'm sure that if Mr. Gates had implemented FAT at a later date, he would have
needed a _much_ longer plane ride.

~~~
wtallis
I don't think segment tuning is the kind of "feature" your lesson needs as an
example. Segment tuning is just a link-time optimization phase. The people
doing manual segment tuning were just producing an ordered list of the
already-written functions, to be used as input for the linker. These days, it
would be implemented as a completely automated process using profile-guided
optimization. It's not something that you can do early in the project and get
it over with, because any time you do anything to change the call graph of
your code base or the size of a compiled function, you need to re-tune.

~~~
mrmaddog
Ah, I didn't realize this was done as a manual process back then. I assumed
the engineers were working on an automated system to do the segment tuning for
them, and that system was the new "feature" that Mr. Gates thought the
engineers were wasting too much time on. Feel free to re-read my above comment
with "segment tuning" replaced by "some other feature." Thanks for the
correction.

------
tmister
Gates is one of those rare people who is at a time a good developer, good
manager and a cunning businessman. I started to appreciate him after watching
_Triumph of the Nerds_ documentary series. I literally loled for 5 minutes
after watching Gates in an event parodying IBM which was organised by Jobs
[http://youtu.be/riyAe4BKAng?t=20m1s](http://youtu.be/riyAe4BKAng?t=20m1s).

~~~
hackula1
Wow, Larry Ellison predicts mobile web at 47:00.

~~~
BenderV
More Chromebook than Mobile Web.

------
virtualwhys
From 12BitSlab in article's comments

> I don't mind if billg gets a little arrogant at times. One merely has to
> look at how he wrote the ROM code for the Altair to realize his abilities.

> Also, ALL of the concepts embodied in modern tablets and smartphones were
> "invented" by billg when he wrote the code for the Tandy 100. Things like
> "instant on", data stored in non-volitile memory, small productivity apps,
> continue from the same point after power down, etc. Persoannly, I put billg
> in the Top 5 of all-time CS people who contributed to computing.

This is an interesting claim, I was always under the impression that while
Gates could code, he wasn't at all a CS giant.

~~~
cpr
When I was an undergrad (a year ahead of Gates, 72-76), Harvard had only
"intro to programming" undergrad courses, so those of us CS (well, applied
math) majors who arrived at college already competent at programming pretty
much just took all grad CS courses for 4 years. The faculty were enlightened
enough not to care that we weren't grad students.

Gates was certainly one of the brighter undergrads in those courses. I don't
know if that makes him a "CS giant," but he was no slouch.

~~~
virtualwhys
Awesome story, thanks.

While you guys were coding away at Harvard, I was not yet able to properly
focus my mind, and so took to running around the streets of Cambridge(port) in
diapers instead ;-)

p.s. from the above one can assume I was either born in '72 or was taking far
too much acid for my own good.

------
troyk
I'm old enough to know he didn't carry a computer on the plane....

~~~
nknighthb
But too young to know writing code and speccing data structures on paper
(and/or napkins...) was quite common before airplane-friendly computers were
available? (And for a long time after, really; ubiquitous ownership of laptops
is a quite recent thing).

~~~
bluedino
From this Woz quote it was pretty common:

"I wrote all my code on paper in hexadecimal. I couldn't afford an assembler
to translate my programs into hexadecimal bytes, I did it myself. Even my
BASIC interpreter is all hand written. I'd type 4K into the Apple I and ][ in
about an hour. I, and many others too I think, could sit down and start typing
hexadecimal in for a SMALL program to solve something that occured or
something that somebody else wanted. I'd do this all the time for demos. I
certainly don't remember which hexadecimal codes are which 6502 instructions
any longer, but it was a part of life back then."

~~~
pauljonas
When I started my programming career, my first boss did not know how to use a
text editor. He could perform a randomizing routine in his head but he
trembled at using a text editor -- he still used punched cards and/or a
mainframe utility that emulated a punch card. And lots of programmers coded
first on columnar grid paper (shades of green and white, demarcations at 8,
12, 16 to help you indent properly.

~~~
csixty4
My community college still had us writing C on huge tablets of that IBM grid
paper in the late 90s. I can't imagine writing huge amounts of production-
worthy code that way.

------
danso
So the FAT story may be an exaggeration, but does Brandon Eich's Javascript-
in-10-days ([http://www.quora.com/JavaScript/In-which-10-days-of-May-
did-...](http://www.quora.com/JavaScript/In-which-10-days-of-May-did-Brendan-
Eich-write-JavaScript-Mocha-in-1995)) still count as a "STFU-I'm-the-boss"
feat?

~~~
YooLi
So _that_ explains it...

;)

~~~
Tloewald
How do we explain C++?

~~~
pjmlp
Compatibility with C and its toolchain.

~~~
Tloewald
I think that's a weak response. obj-c was just as compatible and a far less
horrible language design.

~~~
pjmlp
Actually I don't have any praise for Objective-C's design.

And it also suffers from the same issues that pollute C++'s design.

------
teawrecks
Am I the only one who didn't interpret the quote as him showing off? If I used
that line, it would be a way of telling them that the problem of segment
tuning is an artificial limitation imposed by a format that hasn't gotten
enough attention. "I wrote FAT on an airplane" would be my way of saying,
"don't come up with better ways to work around my half-assed implementation.
spend time improving the implementation so segment tuning isn't even something
you have to worry about."

~~~
IgorPartola
FAT and segment loading have nothing to do with each other. Gates was just
bragging about having written something complex in a short period of time.

~~~
simula67
Still, he may have been pushing his team to do better.

------
chubbard
When he says "He wrote FAT on an airplane" he means with pencil and paper
since FAT is so old that there were no laptops to do that on. Which maybe he
figured out all of the specs, but he didn't put code down and debug it. Of
course in those days writing it on paper was quite common before people typed
it into the computer. And that is quite impressive in and of itself. Most of
the time people treated that activity as if they were coding so they were very
precise. Now a days we're fast, but we aren't as precise.

~~~
marssaxman
You can write code on paper and debug it in your head, running a simulator of
the target environment in your brain. There is no "as if"; this was actually
coding.

Coding is something you do in your brain, not in an editor.

------
ChikkaChiChi
Bill Gates complains that people aren't doing real programming and people
berate him to shut him up. Steve Jobs throws the first iPod into a fish tank
and he's revered as a God.

I guess it's no wonder why the mainstream of Apple and Microsoft is what it
is.

------
auctiontheory
Was it one of those planes that flies for six months?

~~~
nknighthb
The initial 8-bit version of FAT (which I personally do not know the history
of, but Wikipedia suggests Gates is probably taking more credit for than
deserved) and its rough successor, FAT12, are very simple structures. Weird
products of their time and place, but simple nonetheless.

Coming up with the blueprint for such on a flight of at few hours seems quite
reasonable for someone with the requisite knowledge.

------
mtkd
If he'd kept one foot in the codebase - he might not have made so much money -
but his software legacy might have turned out differently.

~~~
angersock
I'm not sure that Microsoft's is a bad legacy. They did a whole hell of a lot
to put programming and office tools in the hands of normal people.

~~~
gxs
I agree. Regardless of what they've done, they largely accomplished their
vision. Their vision was to put a PC in every home. They started with such a
lofty goal and delivered. The first thing I ever learned on a pc was typing a:
<return> to load a floppy on MS DOS.

It seems this is largely their problem today - they no longer have a lofty
goal to focus their energy on. Most companies have one. Google - organize the
world's information etc. etc.

------
delucain
"Tony Stark was able to build [a miniaturized arc reactor] in a CAVE! With a
box of scraps!"

~~~
korethr
I'm sorry, sir. I'm not Tony Stark.

------
Aldo_MX
To be honest I can't afford to commute and do nothing, I have to plan new
features for my products, redesign existing ones, or at least read a tech
book/article, otherwise I feel really frustrated because I dislike to stay
still.

The best ideas I have ever had happened during my commute, so I feel familiar
with the "I wrote FAT on an airplane" statement.

~~~
Pxtl
This is why I'm envious of cities with real transit. Driving sucks.

------
sarreph
So _that 's_ why everyone uses NTFS...

~~~
Zardoz84
EXT4 fs and other fs , NTFS is a little pony if you go to servers world

~~~
count
NTFS is way more sophisticated than ext2/3/4\. ZFS is probably got it beat,
but it's actually a pretty great filesystem. Don't confuse 'windows' with
'NTFS'.

------
eksith
Isn't this basically Bill Gates exemplifying the "Rockstar Programmer"
persona?

"I did X in Y time so why don't you follow my lead" may have been a
motivational tactic at the time, but it did backfire. I'm forced to wonder if
this is how the motif began.

------
graycat
About "optimization", Gates likely had a point. That problem of assigning code
blocks (subroutines/functions) to memory segments does suggest a significant
role for optimization.

What is optimization? For a very sparse description, for the set R of real
numbers, positive integers m and n, functions f: R^n --> R and g: R^n --> R^m,
find x in R^n to solve

minimize f(x)

subject to

g(x) >= 0

So, set up a mathematical description of the problem based mostly just on the
'cost' function f, that is, what want to minimize, and 'constraints' g that
keep the solution 'feasible', that is, realistic for the real problem. Then
look for a solution x. Yes, easily enough such problems can be in NP-complete
and still difficult otherwise.

Likely what Gates wanted was function f to be the execution time and function
g to force honoring the 64KB limit per segment, etc.

Then a big question would be, assuming what software to have its segments
assigned?

So, for an answer, just take some Windows and/or Office code and get the total
execution time on a _typical_ workload.

Might also want to be sure that on any of several workloads, the optimal
solution was no worse than some factor p in R of the best solution just for
that workload. Then keep lowering p until the f(x) starts to rise
significantly and come up with a curve of f(x) as a function of p. Present the
curve to Gates and have him pick a point.

Gee, should we rule out having the same subroutine/function in more than one
segment? Hmm ....

Just where Gates learned about optimization would be a question, but he had a
point.

------
nicholassmith
You can read it a couple of ways, you can take it as Gates showing off that he
did something hard quickly, which is certainly valid, or you can take it as
Gates saying 'stop fiddling whilst Rome burns and get it done'. You can hammer
out complex ideas quickly and lose your life twiddling the details, or just do
it and move on.

Or more likely he was being a bit of a jerk.

------
fmax30
Am i not getting something i thought that fat was created by Marc Macdonald?
[http://en.wikipedia.org/wiki/File_Allocation_Table#Original_...](http://en.wikipedia.org/wiki/File_Allocation_Table#Original_8-bit_FAT)

------
Theriac25
It took me a while to realize that it didn't mean writing code that ran aboard
an airplane, but code that was written while on an airplane. Somehow the
latter didn't even cross my mind as something that could be considered
impressive.

------
samspenc
And they got a patent for it? :D

~~~
asveikau
IANAL and I haven't read up on everything, but I thought it was just the long
filename support that was patented. My understanding is that if you just
support 8.3 names it's unencumbered.

Edit with further detail: The thing that's unique about LFN are the rename and
delete behaviors. Lots of filesystems support more than 8.3 or multiple names
for files (hardlinks) but I don't think any of them have alternate names for
files that "stick" when you move them into another dir, or that behave
somewhat cleanly when a non-LFN-aware OS does so.

------
chris_wot
So he got out a notepad and pen, then wrote the word "FAT"... whilst on a
plane. Awesome!

------
yOutely
Skip to the last 2 paragraphs of this article. The rest is filler.

