SShortSingh.

Programming

0
ProgrammingDEV Community ·

Pest PHP bug: a misplaced failure message silently passes flawed tests

A developer discovered that their Pest PHP tests were falsely passing because the toContain method is variadic, meaning any text added as a failure message is treated as a second search needle instead. When using not->toContain, the framework catches the failure thrown by the missing 'message' string and incorrectly reports the assertion as successful. This flaw meant a stale pricing claim the developer specifically wrote a test to catch went undetected in published blog posts. Unlike 66 other Pest expectation methods, toContain and toContainEqual do not accept a dedicated message parameter, making the API inconsistent. The developer recommends wrapping such checks in toBeFalse or a similar method that properly supports a message argument, and always deliberately triggering a failure before trusting any load-bearing test.

0
ProgrammingDEV Community ·

How to Use Flutter Platform Channels to Call Kotlin from Dart

Flutter supports a single codebase for Android and iOS, but native platform features sometimes require direct communication with platform-specific code. Platform Channels, particularly MethodChannel, enable Dart code to invoke Kotlin functions and receive results on Android. A matching channel name must be defined in both the Dart and Kotlin layers for the bridge to work correctly. Developers can pass arguments, receive maps, and handle errors using PlatformException for robust native integration. Best practice recommends centralizing MethodChannel calls in a dedicated service class rather than scattering them across UI widgets.

0
ProgrammingDEV Community ·

What Technical Documentation Should Include and How to Structure It

Technical documentation is any material that helps users understand, use, or operate a system, and its effectiveness depends on enabling readers to take clear next steps without guesswork. Different reader tasks require different document types — tutorials, how-to guides, reference pages, troubleshooting guides, and release notes each serve a distinct purpose and should not be merged into a single page. The Diátaxis framework, which separates these categories, is recommended as a structural guide, though the reader's task ultimately determines where content belongs. Small teams launching a product do not need every document type upfront; a basic orientation page, a quickstart, and relevant reference material are often sufficient to start. Google's technical writing guidance also advises defining scope, audience, and non-scope before drafting, to prevent a single page from accumulating unrelated content.

0
ProgrammingDEV Community ·

Why applying DDD to simple CRUDs adds complexity without any real benefit

A developer recounts spending 90 minutes modifying eight files just to add a single text field to a basic customer registration form, highlighting how over-engineered architecture slows down simple tasks. The article argues that most teams adopt only the tactical side of Domain-Driven Design — entities, value objects, repositories — without understanding its strategic purpose of modeling complex business domains. When applied to plain CRUD systems with no real business logic, this approach multiplies indirection and maintenance cost while protecting no meaningful rules. The author draws a clear distinction between data complexity, which standard framework tools handle well, and rule complexity, where layered architecture genuinely pays off. The key takeaway is that both approaches can coexist in the same project, and choosing the right tool per context matters more than enforcing a uniform architectural pattern everywhere.

0
ProgrammingDEV Community ·

How to give code review feedback that informs without alienating teammates

Code review comments are written, asynchronous, and publicly visible, which strips away tone of voice and makes even well-intentioned feedback land as criticism. A developer-focused guide argues that small structural changes — such as addressing the code rather than the author, and always explaining the reasoning behind a suggestion — significantly reduce friction in pull request discussions. Using clear prefixes like 'blocker:', 'suggestion:', or 'nit:' helps reviewers signal the weight of each comment, so recipients can distinguish a security flaw from a minor stylistic preference. Framing questions with genuine curiosity rather than disguised accusation, and using built-in suggestion blocks on GitHub or GitLab, further shifts comments from tasks to collaborative help. The piece also notes that occasionally acknowledging good work calibrates how all other feedback is received and reinforces the coding standards a team wants to spread.

0
ProgrammingDEV Community ·

Next.js Advanced Server-Side Caching: Data Cache, Full Route Cache and Redis Explained

A technical deep-dive published on tamiz.pro outlines advanced server-side caching strategies available in the Next.js React framework. The guide covers three primary caching layers: Data Cache, which automatically stores fetch API responses persistently across requests; Full Route Cache, which caches entire rendered HTML pages for frequently static routes; and custom caching solutions using libraries such as lru-cache or Redis for distributed, fine-grained control. Next.js caching operates across deployment targets including Vercel's Edge Network and self-hosted Node.js servers. The article also details revalidation methods — both time-based and on-demand — to keep cached content fresh without sacrificing performance. Developers are advised that understanding how these caching layers interact is essential for reducing database load, cutting response times, and building scalable applications.

0
ProgrammingDEV Community ·

RingCentral Uses 3D Animation Principles to Build User Trust in Its AI Tools

RingCentral has applied three 3D animation principles — depth, layering, and spatial motion — to make its RingSense AI feel more visible and tangible to contact center users. The approach addresses a common enterprise AI problem: agents and supervisors often distrust or ignore AI tools that operate silently in the background without a clear visual presence. In the RingCX interface, real-time agent alerts are accompanied by radar-like ripple animations, signaling that the AI is actively processing live voice data. AI-generated suggestions appear on elevated cards with drop shadows, visually separating them from flat CRM data and giving the algorithm a distinct spatial footprint. RingCentral's design strategy suggests that AI adoption depends not just on model accuracy, but on giving users an observable, spatially grounded experience of how the AI operates.

0
ProgrammingDEV Community ·

FFmpeg loudnorm in filter_complex causes audio-video sync drift, fix available

A known bug in FFmpeg 8.1.2 causes audio to desync from video when the loudnorm filter is used inside a -filter_complex graph. The issue stems from loudnorm's internal analysis running at 192kHz, which corrupts downstream presentation timestamps and results in the encoded audio track carrying roughly 2.5 times more samples than its declared duration. This misleads players, extractors, and transcription tools in varying ways. The recommended fix is to run loudnorm as a separate standalone audio pass and then remux the normalized audio with the video, rather than processing it within the filter graph. Developers can verify correct output by checking that nb_frames multiplied by 1024 divided by sample rate approximately equals the duration reported by ffprobe.

0
ProgrammingDEV Community ·

Roku TVs have a built-in local REST API that lets you script your remote

Every Roku device, including TVs made by TCL, Hisense, and Sharp, exposes a local HTTP API on port 8060 called the External Control Protocol (ECP), officially documented by Roku. The API requires no cloud connection, API key, or authentication — just an HTTP endpoint accessible on the local network. Developers can use simple curl commands or JavaScript fetch calls to control the TV, including pressing buttons, launching apps, and typing text. Browser-based implementations face two hurdles: ECP responses lack CORS headers, and HTTPS pages cannot make requests to plain-HTTP local addresses. The API is already used under the hood by home automation platforms like Home Assistant, Homebridge, and Node-RED for their Roku integrations.

0
ProgrammingDEV Community ·

Developer builds better-effect to bring type-safe dependency injection to TypeScript

A developer created better-effect, a TypeScript library, after finding that typed errors alone were insufficient to prevent runtime failures caused by missing dependencies. While typed Result types clearly describe success and failure outcomes, they do not capture what services or resources an operation requires to run. The new library allows dependencies to be declared directly inside generator-based effects using a yield* syntax, making requirements visible at the type level. If any required service is missing when assembling the application runtime, TypeScript rejects the code at compile time rather than allowing a startup crash. The approach, which the author calls typechecked wiring, keeps service definitions, implementations, and runtime configuration in sync without a separate dependency list.

0
ProgrammingDEV Community ·

Python's shutil module offers a workaround to detect screen orientation in Pydroid 3

Pydroid 3, a Python IDE for Android, does not support traditional methods for detecting phone orientation such as portrait or landscape mode. Pyjnius fails in this environment because Pydroid 3 cannot execute Java code in its terminal, and Kivy only works at the window level. A developer discovered that Python's built-in shutil module, specifically the get_terminal_size function, can serve as an indirect workaround. When the phone is rotated, the terminal dimensions reported by get_terminal_size change, effectively allowing orientation detection. This method offers a simple, dependency-free alternative for Pydroid 3 users needing basic orientation awareness.

0
ProgrammingHacker News ·

OpenSSH 10.5 Released With New Policy on AI-Assisted Code Fixes

OpenSSH has released version 10.5, marking a notable update to the widely used open-source SSH software. The release is accompanied by a shift in project policy, now welcoming fixes generated with the assistance of AI tools. Release notes for the update are available on the official OpenSSH website. The change signals a broader acceptance of AI-assisted contributions in open-source security software development.

0
ProgrammingDEV Community ·

Silent token refresh bug logged a Bluesky monitoring account out for two days

A developer running an automated job to monitor a Bluesky account for replies discovered that silently consuming an expired token produced results indistinguishable from a quiet inbox, masking the failure entirely. After adding proper error-checking, the developer attempted to fix the expired token by calling the AT Protocol refresh endpoint directly, which appeared to work initially. However, AT Protocol refresh tokens are single-use and rotating, meaning presenting one invalidates it and issues a new pair that must be saved. Because the monitoring job did not write the new token pair back to storage — to avoid corrupting the browser app's session — the browser was left holding an already-consumed token and was signed out the next time it attempted a refresh. The incident highlights a subtle integration risk: refreshing a token owned by another client causes delayed, hard-to-diagnose session revocation, deferred by roughly one access-token lifetime.

0
ProgrammingDEV Community ·

Self-Taught Developer Builds Streaming AI Copilot and 3D Studio on Smartphone During Factory Breaks

A self-taught developer has built CoSpatial 3D, a mobile-optimized spatial design and generative concept tool, coding it entirely from a smartphone during short breaks on a factory production line. The project hit a major technical obstacle when the in-app AI Copilot triggered HTTP timeout errors and mobile browser crashes while processing complex requests. To resolve this, the developer replaced standard request-response cycles with Server-Sent Events (SSE) streaming on a Python backend paired with a token-by-token fetch reader loop on the React frontend, eliminating the timeout issues. The app is now live at cospatial3d.xyz, featuring a 3D canvas that renders geometric shapes using raw trigonometry rather than AI-generated approximations. The developer is fully self-funding the project from factory wages and is seeking community support and technical feedback to sustain hosting and GPU costs.

0
ProgrammingDEV Community ·

System Design Basics: Why Problem-First Thinking Beats Memorizing Tech Tools

A structured guide for beginners explains that effective system design starts with understanding requirements, scale, and trade-offs rather than memorizing tools like Redis or Kafka. Designers are advised to follow a sequential thinking process covering traffic estimation, API design, database selection, bottleneck identification, caching, scaling, reliability, and monitoring. Traffic estimation is highlighted as a critical early step, since a system serving 10 million users demands a fundamentally different architecture than one built for 1,000. Database choice should be driven by data relationships, query patterns, and consistency needs rather than personal preference, as neither SQL nor NoSQL is universally superior. Identifying bottlenecks before scaling infrastructure is also emphasized, since adding more servers cannot fix a constrained database.

0
ProgrammingDEV Community ·

TechEmpower Benchmarks Archived; HttpArena Emerges as Stricter Replacement

The TechEmpower Framework Benchmarks, a 13-year-old reference for web framework performance, were shut down and archived in March 2026 after growing unsustainable in scale and volunteer support. The project had expanded from 25 frameworks in 2013 to over 330 implementations by its final Round 23, but maintenance costs and dwindling volunteer capacity led to its closure. A new benchmarking project called HttpArena has stepped in to fill the gap, running all tests on a single standardized AMD Ryzen Threadripper PRO machine under controlled, non-self-reported conditions. HttpArena covers 30 test profiles across six boards including HTTP/1.1, HTTP/2, HTTP/3, gRPC, Gateway, and WebSocket, with strict anti-cheat and correctness validation rules. Unlike its predecessor, HttpArena prohibits pre-computed responses and pre-compressed bodies, requiring frameworks to perform real serialization and compression per request.

0
ProgrammingDEV Community ·

Python's del Statement Removes Names, Not Objects, from Memory

A technical explainer on DEV Community clarifies a common misconception about Python's `del` statement among intermediate programmers. In Python, variables are names bound to objects, meaning multiple names can reference the same object simultaneously. When `del` is used on a name, it removes only that binding — the underlying object survives as long as at least one other name still points to it. A `NameError` is raised only when code tries to look up a name that no longer exists, not because the object itself was destroyed. The article notes that what happens when the very last reference to an object is deleted will be addressed in a follow-up piece.

0
ProgrammingDEV Community ·

Developer Builds InstaFetch, a Clean Next.js Tool for Downloading Public Instagram Media

A developer has launched InstaFetch, a browser-based tool that allows users to download publicly available Instagram videos, Reels, and photos by simply pasting a URL. The application requires no Instagram login credentials and was built using Next.js, React, TypeScript, Tailwind CSS, and deployed on Vercel. The developer designed the tool to simplify a workflow that many existing downloader sites complicate with multiple steps, popups, or credential requests. Separate landing pages were created for different content types — videos, Reels, and photos — each targeting specific search intents, and a sitemap was submitted to Google Search Console. The project is still in early stages, with planned improvements covering download reliability, mobile user experience, and handling of unsupported URLs.

0
ProgrammingDEV Community ·

Choosing the Right Game Engine: Game Maker and Godot Among Top Picks

A developer exploring game engine options has narrowed their focus to Game Maker and Godot as primary candidates. Both engines are widely discussed in the game development community and each uses its own specific programming language. The developer noted that numerous online videos praise various engines, making the choice difficult. They are seeking additional recommendations beyond their current two options to help guide their decision.

← NewerPage 62 of 1190Older →