SShortSingh.
Back to feed

Engineer Questions Pricing Rounding Logic Written by Principal Engineer

0
·3 views

While tracing an unusual result in the pricing service, a developer noticed a rounding step applied before a discount rather than after, which looked incorrect. The code was written three years earlier by the team's principal engineer, and the developer acknowledged they might be missing context. The article advises turning the suspicion into a concrete, reproducible test with a real order example, then raising it openly as a question with evidence in the ticket or team channel. Whether the behavior turns out to be intentional or a genuine bug, the author argues the process of careful reading and clear questioning is the valuable takeaway. The piece was written by Asael Shinder and published on DEV Community.

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 ·

12-Year-Old Developer's Security Tool Blocks Its Own Creator for Two Days

A 12-year-old developer built KAVLR, a security tool meant to act as a leash for AI agents, and tested it on a $150 Android phone using Termux. Its fail-closed design blocked commands whenever the backend server was unreachable, and attempts to host the backend on Vercel and Railway failed before Supabase Edge Functions worked. The tool then locked the developer out of their own terminal and files, creating what they called a zombie process that resisted deletion and corrupted their code. After tracing the problem with grep and rebuilding the affected files and symlinks, the developer restored normal function, and the hook correctly blocked a test command for a .env file. The developer shared the account as a lesson in persistence for others facing similar debugging battles.

0
ProgrammingDEV Community ·

Browser-Based File Converter Keeps Images Local, Avoiding Server Uploads

The article describes a free image converter that processes files entirely in the browser rather than uploading them to a server. The author argues that typical online converters expose sensitive files to infrastructure users cannot verify, and offers a simple network-inspection method to confirm no file is transmitted. Conversion relies on decoding with createImageBitmap, drawing to a canvas, and encoding through WebAssembly codecs running in a Web Worker. The piece also covers practical challenges, including EXIF rotation, worker timeouts, HEIC decoding under strict Content-Security-Policy, and binary-searching JPEG quality to meet target file sizes.

0
ProgrammingDEV Community ·

Six Pre-commit Hook Tips for Terraform and Python Repositories

A common frustration in pull requests is reviewers repeatedly flagging formatting and lint issues that could be caught earlier. Pre-commit hooks move these checks onto the developer's machine before a commit is created, which is especially useful for repos combining Terraform with Python code such as Lambda handlers. The guidance recommends pinning each hook to a specific tag or commit SHA rather than a branch name, and updating deliberately with autoupdate so local machines and CI stay aligned. It suggests starting with Terraform fmt, tflint, and terraform-docs, then using Ruff to handle Python linting and formatting in one tool. The article also warns that hook IDs can change between releases and that hooks should not run terraform plan, since that requires credentials and network access best kept in CI.

0
ProgrammingDEV Community ·

Sourcerer: an offline AI tool that tells resellers the most to pay for a thrift find

Sourcerer is an offline-first sourcing assistant for resellers that identifies an item from a photo or typed description using a local open-weight model. Plain TypeScript code, not the model, then calculates the maximum a buyer should pay after eBay fees, shipping, supplies, and a desired profit multiple. The tool runs on the user's own laptop or home machine, with the phone serving as camera and screen, so it works without internet or per-scan API costs. When no machine is reachable, it falls back to cached data and a clearly labeled estimate based on the user's sold history. The creator targets weekend flippers handling a few dozen items a month, and the app also drafts listing titles and descriptions.