Urgent.News

What's breaking now, across thousands of outlets.

Tech

One Read Core, and the Code That Proves It

A generic core is easy to describe and hard to show. So here it is, with the parts I would not put in a talk. ๐Ÿ‘‹ I'm Anton - a software engineer working mostly in PHP/Symfony and Go, carving a live PHP monolith into Go services. The previous piece was about why my code ended up on type parameters at all. This one is the code itself: the core, one instantiation of it, and a consumer that uses itโ€ฆ

The core of the system is a single, generic type that encapsulates the concept of a bitemporal entity with history. This core is designed to handle any data type through a type parameter. It consists of six methods and a Spec struct, which defines the structure of the data columns for identity, payload, and version. The Spec struct is shared across the entire system and contains three column groups: the identity group, the payload group, and the version group.

These groups are fixed and do not change; they are simply positions within the Spec. The core's main methods are Current, AsOf, KnownAsOf, Append, Correct, and Close, each performing a specific function in managing the history of the entity. The Append method, in particular, ensures that every change is a new version row, with no destructive updates or physical deletes allowed.

This design ensures that every historical fact is preserved, and there is never a situation where data needs to be rewritten in the past. The system is implemented as a single, unified core that handles all entities uniformly, regardless of the domain they belong to.

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

Smart Contract Vulnerability Surface Analysis: Bitfinex

Smart Contract Vulnerability Surface Analysis: Bitfinex Target Protocol : Bitfinex (TVL: $18684.6M) Smart Contract Vulnerability Surface Analysis โ€“ Bitfinex Protocol: Bitfinex (TVL: $18.68 B onโ€ฆ

  • Bitfinex ecosystem runs on Ethereum mainnet and Layer 2 chains
  • Four high-severity access control and governance issues found
  • Immediate action needed to address critical design choices

I expected hexagonal architecture to help my coding agent. It didn't.

I am a principal engineer, and I started this experiment trying to defend something I have believed for years: invest in a good structure now, and later changes should get easier.

  • Hexagonal architecture implementation was 38% slower than flat version.
  • Flat version reached acceptance faster despite architectural investment.
  • Experiment questioned architectural habits and benefits of clean code.

We scheduled a question for an hour when nobody could answer it

The run was fully unattended. That was the point. Everything upstream of the final step had been automated for weeks, and the last remaining human touch was an approval โ€” a request sent out, a wait, aโ€ฆ

  • Automated question pipeline experienced unexpected timeout glitch
  • Log entry provided no differentiation between rejection types
  • Gate assumed human presence without monitoring availability

More from Tuesday 15 September โ†’