SShortSingh.
Back to feed

How PHP Developers Survived Without Generics Before Go Came Along

0
·1 views

Software engineer Anton, who works primarily in PHP/Symfony and Go, reflects on the challenges of building type-safe code in PHP, a language that has no native generics support. In the absence of type parameters, PHP developers historically relied on interfaces, abstract base classes, mixed arrays, and duck typing to approximate type safety. Tools like Psalm and PHPStan later introduced comment-based generics via annotations such as @template, offering a real but limited form of static analysis. However, these annotation-based types remain vulnerable to silent drift, since they live in comments that can be edited without affecting runtime behavior. Anton now contrasts this era with his current Go-based services, where type constraints are enforced directly by the compiler rather than by convention or optional tooling.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Team Built an Approval Gate Scheduled Precisely When No Human Could Approve It

A software team discovered a critical flaw in their automated pipeline after an approval request timed out during an unattended run. The system had been designed to pause for human sign-off, but the run was deliberately scheduled at a time when no one was available to respond. Compounding the problem, the failure logs could not distinguish between a rejected request and one that was simply never seen, making diagnosis impossible. The team responded by improving failure logging to capture which type of error occurred, and by building awareness of human availability into the pipeline itself. The incident highlights a broader pattern where humans remain nominally present in automated workflows but have effectively disappeared from them in practice.

0
ProgrammingDEV Community ·

Hexagonal Architecture Slowed AI Coding Agent by 38%, Engineer's Experiment Finds

A principal engineer tested whether hexagonal architecture would help an AI coding agent work more efficiently, expecting the structured approach to prove its worth. The experiment used a Java billing service called ChargeLedger, built for an EV charging network, with two versions: one following hexagonal architecture principles and one using a flatter, architecture-neutral design. Across nine features, the hexagonal version took 38% longer to reach acceptance compared to the flat implementation. The engineer concluded that architectural indirection added by habit — such as interfaces with single implementations and pass-through methods — carries a real cost for both humans and AI agents. While not abandoning clean code principles, the engineer now argues that every layer of abstraction requires concrete justification rather than being applied as a default practice.

0
ProgrammingDEV Community ·

Security Analysis Flags 19 Vulnerabilities in Bitfinex Smart Contracts

A DeFi security research report dated September 15, 2026, identified 19 vulnerabilities across Bitfinex's on-chain smart contracts, which collectively secure approximately $18.7 billion in user funds on Ethereum and Layer 2 networks. The analysis categorized nine high-severity issues spanning access control, proxy upgradeability, and cross-chain bridge logic, alongside medium and low-severity flaws involving re-entrancy, oracle manipulation, and flash-loan exploits. Critical findings include an unguarded ownership transfer function, a missing multi-signature requirement for key lending pool operations, an open bridge operator setter, and a governance timelock bypass in the DAO contract. The protocol received an overall risk score of 7 out of 10, indicating a moderately high threat level given its complexity and asset value. Researchers called for immediate remediation of all high-severity items to reduce the protocol's risk posture to a low-to-medium level.

0
ProgrammingDEV Community ·

Why Most AI Projects Fail Long Before a Single Line of Code Is Written

AI software projects most commonly fail not due to coding limitations but because of unclear business goals, unready data, and underestimated technical constraints identified before development begins. Experts warn that teams often start by choosing a technology — such as a chatbot or AI agent — rather than first defining a measurable business problem they want to solve. While building an AI prototype has become relatively straightforward with modern tools, scaling it into a reliable production system demands addressing security, monitoring, cost controls, and integration with existing software. Data quality and accessibility are frequently the harder challenge, as issues like outdated documents, inconsistent records, or unclear data ownership can undermine even the most sophisticated model. Organizations are advised to treat data readiness and business clarity as prerequisites, not afterthoughts, before committing to AI development.