Urgent.News

What's breaking now, across thousands of outlets.

Tech

The measurement in my permanent log was a string literal

This line is in a record I cannot edit, because the record is append-only and that is the point of it: OK_ATOMS atoms=0 top=0 bot=0 It reads as a measurement that found nothing. It is a placeholder. The three zeros are characters in the source file, written while the real counter was still being built, and the line was emitted unconditionally every run. Nothing counted anything. There is no code…

The permanent log contained a placeholder measurement line in the format of OK_ATOMS atoms=0 top=0 bot=0. This line was emitted unconditionally every run, as it was a string literal placeholder that survived because it was well-formed and resembled other lines in the file. The placeholder was used because the counter had not yet been built, and it would produce a legitimate zero value if there was nothing to count.

However, when counting began, the line remained unchanged. This placeholder line, being a string literal, was indistinguishable from the real log, leading to it being appended to the permanent record and turning an embarrassing constant into a problem. The rule for placeholders was that they should never be treated as print statements, but as genuine measurements if they were to be meaningful.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Your first ASP.NET App: Introduction

Hello! In this tutorial we will build your own ASP.NET Service! Requirements IDE like Visual Studio/JetBrains Rider .NET >= 10 Base C# skill Creating project New Solution -> Web Write your project…

  • Install Visual Studio or JetBrains Rider with .NET version 10
  • Create new Web API project named ExampleProject
  • Add OpenAPI documentation and configure HTTP pipeline

More from Saturday 12 September →