DEV Community

Cover image for How Would You Print Hello World Without printf?
vmx
vmx

Posted on

How Would You Print Hello World Without printf?

How would you print hello world on the screen if there were no printf?

You'd write to stdout directly. Before that, a syscall. Before that, poke bytes into a memory-mapped display buffer. Before that, flip switches on a front panel and watch lights blink back.

Every layer down, someone built something so the next person wouldn't have to. That's the whole field, really. Languages we didn't design, compilers we didn't write, protocols we didn't invent. We've always stood on a stack of other people's work and called the output ours.

Nobody ever had a problem with that though.

The stack of other people's work

printf wasn't always there. Someone wrote it. And we used it, no disclaimers, no guilt, no explaining that we could've done it the hard way. Same with frameworks, same with package managers, same with everything that came after.

Here's the actual progression, roughly:

front panel switches → machine code → assembly → C → printf
    ↓
    syscalls → write() → stdio → high-level languages → frameworks
Enter fullscreen mode Exit fullscreen mode

At every step, someone said "you don't need to do this part anymore." And at every step, someone else said "but then how do you really understand what's happening?"

The thing worth noticing

Every previous layer still asked you to think in the problem's language. C made you reason about memory. Concurrency made you reason about state. HTTP made you reason about failure modes.

The abstractions compressed the work, but they didn't skip the understanding. You still had to know what you were asking for, even if you didn't have to build the thing that answered.

The newer layers are different, not because they're higher, but because for the first time you can get output without having gone through the thinking that used to produce it. You can. Doesn't mean you do. Lots of people still think first. But the option to skip it is new, and that part is genuinely new.

The question that didn't change

So maybe the question isn't whether the tool counts. It probably always did.

Maybe the better question is, when the output looks right but isn't, would you know? Could you find it? Could you fix it?

That's not a gotcha, that's just the part that didn't change.

Top comments (0)