Saturday, November 29, 2025

How Ray Konopka Improved My Delphi Code Overnight

Every now and then, you get a piece of advice that stays with you. Not because it was dramatic or complicated, but because it quietly made everything better.

Two years ago, I sent a simple question to Ray Konopka — the Ray Konopka — about his coding style. I had noticed that his Delphi method declarations didn’t look like the IDE defaults. He added spaces inside parentheses and brackets, and his code just… breathed better. It had clarity.

I finally went back and reread that email thread, and I realized something.

The guidance Ray gave me that day permanently changed how I write Delphi code.

This blog post is long overdue.

How It Started

Here is the short version of what I asked Ray. I wanted to know why his method declarations looked like this:
procedure FormCreate( Sender: TObject );

Instead of the standard IDE formatting:

procedure FormCreate(Sender: TObject);

My question was simple:
Is there a setting that does this automatically? And why do you prefer this style?

Ray’s reply was thoughtful, detailed, and generous. And it opened my eyes to something subtle but powerful.

Why Ray Adds Spaces Inside Parentheses

Ray explained that adding a space after the opening parenthesis and before the closing parenthesis helps your eyes distinguish the method name from the parameter list. It creates a visual delimiter that makes code easier to scan.

He illustrated this beautifully by showing side-by-side method declarations from the TString class. With spacing added, the entire block becomes more readable and less cramped.

When you look at example after example, the difference becomes obvious — almost impossible to ignore.

Smart Tab: The Secret Weapon

The second thing Ray emphasized was the use of Smart Tab.

With Smart Tab enabled, wrapping long parameter lists becomes far easier and dramatically cleaner. Ray demonstrated it with a real method declaration on multiple lines, perfectly aligned with a single press of the Tab key.

After seeing that, I turned Smart Tab on — and I’ve never turned it off again.

Delphi 13 Options - Smart Tab

https://docwiki.embarcadero.com/RADStudio/Florence/e/index.php/Source_Options#Options_tab

The Three Rules That Changed My Coding Style

After just three days of practicing what Ray shared, I wrote him back with a summary of what made the biggest impact on my coding clarity. Here were the top three:

1. Smart Tab On

It makes aligning wrapped parameters effortless. This one toggle improves readability more than people realize.

2. Spaces after ( , [ and before ] , )

This small visual pause gives every method declaration and parameter list more clarity. It is now second nature for me.

3. Two blank lines between method implementations

This simple spacing rule makes code blocks easier to navigate, search through, and mentally organize. It is one of the fastest ways to reduce visual clutter.

These three rules alone made my Delphi source code noticeably cleaner.

Not fancy. Not complicated. Just better.


Ray’s Full Coding Style Guide

At the end of our email exchange, Ray did something incredibly generous. He made the full Raize Delphi Coding Style Guide available as a free PDF download.

If you want the complete reference, you can access it here:
https://raize.com/wp-content/uploads/RaizeDelphiCodingStyleGuide.pdf

This is required reading for any Delphi developer who cares about clean, consistent, readable code.

Two Years Later

I’ve been following Ray’s guidance ever since that email exchange. You’ve even seen it in the code I’ve generated or shared online — it became the standard I hold myself to.

What surprised me most is how such small adjustments created such a big improvement. Enough improvement that I felt compelled to finally write this post, two years delayed but not forgotten.

Ray — thank you for the clarity, the generosity, and the craftsmanship you bring to the Delphi community.


Enjoy!
Semper Fi
Gunny Mike
https://zilchworks.com

P.S.
Over the past two years, every time I asked ChatGPT to help me generate Delphi source code, I asked it to follow the Konopka Style Guide. It became my north star for clean, readable formatting — and even AI had to get on board.


No comments:

Post a Comment