Skip to content

Replacing Placeholders

When a function isn’t implemented yet, a common pattern is to throw an error as a placeholder. hole() makes this intent explicit and trackable.

When a method isn’t implemented yet, a common pattern is to throw an exception as a placeholder. Hole.Todo() makes this intent explicit and trackable.

A common placeholder: throw new Error() marks an unimplemented function.

This will crash at runtime if called — but the intent to implement it later is implicit.

Replace throw new Error() with hole().

The gap is now explicit, named, and trackable — same runtime behavior, clearer intent.

export function deleteUser(_id: string): Promise<void> {
	throw new Error("delete user");
}
Crashes at runtime — intent is implicit Ln 2
export function deleteUser(_id: string): Promise<void> {
	hole("delete user")
}

A common placeholder: throw new NotImplementedException() marks an unimplemented method.

IDEs may show it in the TODO window, but it doesn't surface at compile time.

Replace throw new NotImplementedException() with Hole.Todo().

Holey's Roslyn analyzer now reports this as a compiler warning — the gap is visible in your Error List.

public Task DeleteUser(string id)
{
	throw new NotImplementedException("delete user");
}
Crashes at runtime — not visible at compile time Ln 3
public Task DeleteUser(string id)
{
	return Hole.Todo("delete user");
}
HLY102 ⚠ delete user Ln 3

TODO comments inside function bodies are easy to forget and hard to track. hole() turns them into a first-class concept.

TODO comments inside method bodies are easy to forget and hard to track. Holey turns them into a first-class concept.

A // TODO comment marks missing logic inside a function.

The function silently returns an empty array — the placeholder is invisible at runtime.

Replace the // TODO comment with hole().

The gap is now explicit. The return stays — hole() only marks what's missing, not what's there.

export function listUsers(): Promise<User[]> {
	// TODO: list users from database
	return Promise.resolve([]);
}
export function listUsers(): Promise<User[]> {
	hole("list users from database")
	return Promise.resolve([]);
}

A // TODO comment marks missing logic inside a method.

The method silently returns an empty list — easy to overlook during review.

Holey reports the plain // TODO as a warning. You can also add a tag to categorize it as a hole comment.

The [Database] tag turns it into a tracked hole comment, reported at information severity.

public Task<List<User>> ListUsers()
{
	// TODO: list users from database
	return Task.FromResult(new List<User>());
}
HLY101 ⚠ TODO comment should be addressed Ln 3
public Task<List<User>> ListUsers()
{
	// TODO [Database]: list users from database
	return Task.FromResult(new List<User>());
}
HLY201 ℹ [Database] list users from database Ln 3

Holey for C# recognizes four distinct types of incomplete code, each with its own editor severity:

TypeSyntaxSeverity
Todo Comment// TODO: descriptionWarning
Hole Comment// TODO [Tag]: descriptionInformation
Missing Implementationthrow new NotImplementedException("description")Warning
Side EffectHole.Todo("description", implementation?)Information