The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Using RAII to remedy a defect where not all code paths performed required exit actions
Oct 16, 2025
Post comments count 1
Post likes count 1

Using RAII to remedy a defect where not all code paths performed required exit actions

Raymond Chen
Raymond Chen

Passing the obligation onward.

Why can you increment a reference count with relaxed semantics, but you have to decrement with release semantics?
Oct 15, 2025
Post comments count 6
Post likes count 3

Why can you increment a reference count with relaxed semantics, but you have to decrement with release semantics?

Raymond Chen
Raymond Chen

It's more important to clean up when you leave.

I remember taking a screen shot of a video, and when I opened it in Paint, the video was playing in it! What witchcraft is this?
Oct 14, 2025
Post comments count 11
Post likes count 5

I remember taking a screen shot of a video, and when I opened it in Paint, the video was playing in it! What witchcraft is this?

Raymond Chen
Raymond Chen

You copied the green screen.

API design principle: Don’t tempt people to divide by zero
Oct 13, 2025
Post comments count 4
Post likes count 3

API design principle: Don’t tempt people to divide by zero

Raymond Chen
Raymond Chen

Remove it from the equation.

The self-assignment principle for Windows Runtime properties: Don’t change behavior based on whether a property has been written to
Oct 10, 2025
Post comments count 5
Post likes count 2

The self-assignment principle for Windows Runtime properties: Don’t change behavior based on whether a property has been written to

Raymond Chen
Raymond Chen

The fact that a property has been set does not by itself trigger functionality.

The self-assignment principle for Windows Runtime properties applies to default values
Oct 9, 2025
Post comments count 4
Post likes count 2

The self-assignment principle for Windows Runtime properties applies to default values

Raymond Chen
Raymond Chen

The default value must be legal.

Windows Runtime API design principles around read-write properties: Idempotence and self-assignment
Oct 8, 2025
Post comments count 7
Post likes count 2

Windows Runtime API design principles around read-write properties: Idempotence and self-assignment

Raymond Chen
Raymond Chen

Setting it to the value it already has is not a crime.

Remembering the end of support for VRML in Internet Explorer
Oct 7, 2025
Post comments count 6
Post likes count 2

Remembering the end of support for VRML in Internet Explorer

Raymond Chen
Raymond Chen

No one left standing.

Code comments should apply to the state of the system at the point the comment “executes”
Oct 6, 2025
Post comments count 10
Post likes count 3

Code comments should apply to the state of the system at the point the comment “executes”

Raymond Chen
Raymond Chen

Putting them in the flow.