知Yizhi Daily
← Back to this edition

Conversations

AI-generated logging code slowed welcome page; author reflects that architectural responsibility cannot be outsourced

Edition 2026-11-21 · 08:00 Beijing time

While troubleshooting performance issues with a Google Forms add-on, the author found that a colleague's AI-generated installation logging was repeatedly attempting to obtain email addresses and user IDs, generating multiple Google API calls and causing the welcome page to take 15 seconds to load. The article argues that AI carries out requirements but does not proactively weigh trade-offs among performance, security, and business needs.

The author explains that the problem was in the logging logic after add-on installation. Because Google has restricted the user information details available since last December, the AI wrote a set of try/catch blocks: first attempt to obtain the email when the user authorizes, then fall back to the user ID if that fails, and if that also fails, log an installation event with an unidentifiable identity. Although each piece of code is only one line, internally it makes multiple API calls to Google servers.

The logging was also the first logic executed after installation, so the static welcome page took 15 seconds to load. The author believes a senior developer or architect should first assess business necessity: only record the installation timestamp and tell the marketing team that follow-up emails cannot be sent based on installation alone; or show the welcome page first and then asynchronously record the email or user ID in the browser. The latter, however, could also involve unauthenticated payloads and security issues.

The article attributes the problem to architectural responsibility: AI is good at writing functional code, but it does not know whether the product has just launched or already has millions of users, and it tends to comply with requirements rather than challenge them. If developers only describe functionality and do not specify architecture, AI will make architectural choices for them.

The author recommends defining the architecture and data model first, then asking AI to code within those constraints; when a requirement would change the architecture or design, the tool should ask first. Developers also need to make clear when backward compatibility is required and when old logic or old tables should be removed, rather than letting the tool default to trading performance for security and piling up redundant versions.

Original sources

Hacker News ↗
Back to this editionOpen interactive reader