Learn to Say “Hello, World”
Sure, said Hoppy, pull up a chair. I took care not to topple the empty cola cans stacked in a pyramid behind him.
What code?
In a function in a file, I said.
Where’s the IDE? Apparently Hoppy had no IDE running, just some editor which I couldn’t operate. He grabbed back the keyboard. A few keystrokes later and we had the file open — it was quite a big file — and were looking at the function — it was quite a big function. He paged down to the conditional block I wanted to ask about.
What would this clause actually do if is negative? I asked. Surely it’s wrong.
I’d been trying all morning to find a way to force x
to be negative, but the big function in the big file was part of a big project, and the cycle of recompiling then rerunning my experiments was wearing me down. Couldn’t an expert like Hoppy just tell me the answer?
Look! His actual program, conceived just a few minutes earlier, was now up and running. We tried a few values and confirmed my suspicions (so I’d been right about something!) and then he cross-checked the relevant section of K&R. I thanked Hoppy and left, again taking care not to disturb his cola can pyramid.
Back at my own desk, I closed down my IDE. I’d become so used to working on a big project within a big product I’d started to think that was what I should be doing. A general purpose computer can do little tasks too. I opened a text editor and began typing.
#include <stdio.h>
int main()
}
By Thomas Guest