If You Gaze Long Into the Void

The same keyword means 'anything' in C and 'nothing' in modern languages. How did that happen?

· 3 min read

Table of contents
  1. In C: void* = "anything" (actually unknown)
  2. In modern languages: void = nothing
  3. What actually changed
  4. The mental trap
  5. Analogy

If you gaze long into an abyss, the abyss also gazes into you. --- Nietzsche

...but what about the void?

Let's look into the void together.

What do you see --- nothing or anything?

Same word. Different meanings. Different worlds.

In C: void* = "anything" (actually unknown)

It means: "This points to something... I just won't tell you what."

int x = 10;
void *ptr = &x;

That void*:

  • can point to any data
  • carries no type information
  • forces you to decide what it is
printf("%d", *(int*)ptr);

Which means:

  • You must cast it
  • You can be wrong
  • The compiler trusts you anyway

Technically it's not "anything" --- it's just unknown.

In modern languages: void = nothing

void myMethod() {
    // returns nothing
}

No tricks. No guessing.

Just: "There is no value here."

What actually changed

Modern languages didn't remove power --- they moved responsibility:

  • Generics instead of raw pointers
  • Type systems instead of blind casts
  • Memory safety instead of "good luck"

The mental trap

How can the same word mean both?

  • C-style thinking: unknown data (void*)
  • Modern thinking: no data (void)

Same keyword. Different abstraction level.

Analogy

C void* --- a sealed box. You must label it yourself.

Modern void --- no box exists.


Honest question:

Do you ever miss void*... or are you happy letting the compiler carry that burden?