I’ve only mentioned ‘format’ before; now, as a beginner, I’ll casually complain about the use of +combined with type conversion functions, just for fun.
Some might feel that
age := 3;
height := 1.7;
s := 'My age is ' + IntToStr(age) + ' My height is ' + FloatToStr(height) + ' meters.';
and
age := 3;
height := 1.7;
s := $'My age is {age} My height is {height} meters.';
are quite similar, and programmers may be more used to the former. Let me share some thoughts from a programming perspective:
As a user of the Lazarus IDE, my primary goal is getting development tasks done. When I look at code like this, I naturally focus more on business logic. Seeing:
s := $'My age is {age} My height is {height} meters.';
my attention goes toward checking whether the statement expresses the intent correctly and whether the variables are the right ones — without explicit calls like IntToSt rappearing in plain sight. I do know implicitly that a variable is being converted to a string here, but that awareness stays shallow and doesn’t consume mental effort.
In contrast, when I encounter:
s := 'My age is ' + IntToStr(age) + ' My height is ' + FloatToStr(height) + ' meters.';
the repeated pattern ' + IntToStr(...) + 'visually jumps out at me. The information reaches my brain, which then analyzes: “Ah, here a variable is being converted to an string.” That’s programming‑level detail, not business‑logic level. It’s as if my mind, originally engaged in analyzing business requirements, suddenly gets interrupted by a lower‑level implementation concern — a coding‑related interruption. My knowledge has to step in: What is this? Is the syntax correct? Only after that analysis is done can I return to the main thread of business‑logic thinking.
To me, that seems entirely unnecessary. This isn’t what I want to focus on; it’s something the language itself should handle, and shouldn’t appear explicitly in the code. Don't need to show me the detail.
I know some might think I’m too weak — bothered even by such minor details. Maybe so: I’m like a 386, you’re an i9. But regardless of processing power, unnecessary interruptions and extra cognitive load simply shouldn’t exist.
Just like you reading this now: your brain coordinates muscles around your eyes to move them, coordinates hand muscles to move and click the mouse — yet you don’t need to know exactly how it’s done! You keep your attention where it should be.
As Lazarus users, we also want to keep our focus where it belongs. Some things we’ll just have to rely on those maintaining Lazarus and Free Pascal to handle it well — thanks.