Urgent.News

What's breaking now, across thousands of outlets.

Tech

Should code comments link to Stack Overflow answers? Let's argue about it

Scheduled broken-link and redirect checks that tell you the moment a link breaks — linkbruno.com Open any mature codebase and search for stackoverflow.com . You'll find a few dozen comments like this: // Safari doesn't fire 'change' on autofill, see // https://stackoverflow.com/a/<answer-id> Some teams love these. Some ban them in code review. Most have never discussed it. I think it's worth…

The debate over whether code comments should link to Stack Overflow answers rages on. Some teams embrace these links, while others ban them during code reviews. The case for linking is strong: a single line explaining the "why" can make the otherwise confusing workaround much easier for future maintainers to understand. Links provide honest attribution, especially when code is adapted from an answer.

They also serve as a useful signal for later cleanup, as a comment pointing to an answer from several years ago can indicate that the current workaround may no longer be necessary. Search engines and AI assistants, however, do not replace these links. They simply assume the next developer knows how to search for the solution themselves.

Moreover, links in code are prone to rot. They are seldom checked, and links can break when answers get deleted, accounts removed, or URLs change format. Over time, even the version of the answer you initially linked to may change, making the explanation outdated. The case against linking is valid as well: links in code can quietly rot, becoming a riddle without an explanation.

If the link dies, the next maintainer may be left wondering why the workaround was used in the first place. This can lead to either keeping the confusing code indefinitely or removing it and reintroducing the original bug. Ultimately, the decision on whether to allow Stack Overflow links in your codebase, require them for copied code, or strip them in reviews should be a team decision, rather than left to individual reviewers.

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

Why red ink vanishes under a red sheet, and how I made an iPhone do it

I work on Red Sheet at W Lab. Students in Japan write answers in red or orange pen, lay a sheet of red plastic over the page, and the answers disappear while the black questions stay.

  • Red Sheet app conceals handwritten answers with red overlay
  • App identifies ink vs. paper using color analysis in CIELAB space
  • Pens hidden by red overlay, highlighters appear darker and block text

Security Audit Badges — What an Audit Covers, and What It Never Can

HostDeFi › Guides › Audit badges "Audited" is the most misread word in token marketing. It describes a code review with a date and a scope — not a background check on the people holding the keys.

  • Security audit badges do not guarantee audit credibility
  • Legitimate audit involves specific source files and graded findings
  • Badge legitimacy requires verification of auditor's website and contract addresses

Cutting out big product photos: mask resizing cost 1.5 of 255, the model cost 54

Picture a one-person shop with a few hundred product shots off a 24-megapixel camera and one weekend to cut them all out.

  • Resizing masks cost 1.5 out of 255, while model cost constant at 54
  • Heavy model resized 2048x2048 photo, mask quality dropped from 0.975 to 0.223
  • Resizing masks proved cheaper alternative than upscaling original images

Why Outer Wilds Bet on Unity: The Thesis Engine Behind a 22-Minute Solar System

Outer Wilds runs on Unity — Unity 2017 at launch, later Unity 2019 — not Unreal, not a custom C++ solar-system engine. That choice sounds boring until you see what tiny Mobius Digital asked it to do…

  • Outer Wilds uses Unity game engine for core development.
  • Unity offers cheap iteration and seamless platform transition.
  • Team adapted Unity's limitations to create a working solar system simulator.

More from Saturday 14 November →