frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Overly Long Variable Name Could Have Been a Comment

https://jonathan-frere.com/posts/names-vs-comments/
3•rbanffy•4h ago

Comments

d0liver•3h ago
Reading this, the principle of least astonishment immediately comes to mind. I think a lot of the time when a lengthy comment is needed, refactoring or external documentation (maybe with a link in the comments) is actually a better option. PR descriptions and comments have the upside of existing in a historical context; they don't rot because they simply don't exist outside of that context. But, of course, they can be a little bit harder to find.

I definitely do agree that this is often a good use case for a nice comment though, especially because those weird expressions are usually locally scoped so that you don't have to worry too much about comment rot. But yeah, using a proper variable name has that advantage when it isn't local -- changing it in one place will queue the type system to tell you to change it everywhere (and you can probably automate it if you want to).

I guess that I don't think comments, variable names, or PRs are particularly good at conveying broader context though (like what the use case is, historical considerations from bugs, legal requirements, etc.). I think you're kind of talking to a reader who already has the context, and if they don't then none of those things do a great job of clarifying. Kind of circling back, I really like to push more things to external documentation paired with nice conventions and patterns. A lot of the time those docs also have the benefit of being at a high enough level that they don't rot, too. If you know the pattern then you just read the code and it doesn't matter so much if the specifics changed.

How to crack FAANG coding interviews

https://www.mlwhiz.com/p/how-to-crack-faang-coding-interviews
1•ai_unwrapped•1m ago•0 comments

Artificial Intelligence in Miniature Format for Small Devices

https://www.tugraz.at/en/news/article/kuenstliche-intelligenz-im-miniaturformat-fuer-kleinstgeraete
1•gnabgib•1m ago•0 comments

The Self That Never Was

https://hedgehogreview.com/web-features/thr/posts/the-self-that-never-was
1•rntn•4m ago•1 comments

Techno-Feudalism and the Rise of AGI: A Future Without Economic Rights?

https://arxiv.org/abs/2503.14283
1•lexandstuff•5m ago•0 comments

How to Crack ML System Design Interviews

https://www.mlwhiz.com/p/crack-ml-system-design-interviews
1•ai_unwrapped•7m ago•0 comments

WinUAE 6.0.0 Amiga Emulator

https://www.winuae.net/
1•doener•11m ago•0 comments

Show HN: Web Metadata search. Search for headers, web apps, CMSs, and versions

https://dnsarchive.net/web-search
1•danielcid•11m ago•0 comments

A100 is a puzzle game inspired by the mobile game „1010 " by Gram Games

https://cobour.itch.io/a100
1•doener•12m ago•0 comments

How Tether became money-launderers' dream currency

https://www.economist.com/1843/2025/07/04/how-tether-became-money-launderers-dream-currency
2•simonebrunozzi•12m ago•0 comments

Inertial forces (indirect terms) in problems with a central body

https://astro.theoj.org/article/141682-on-inertial-forces-indirect-terms-in-problems-with-a-central-body
1•raattgift•13m ago•0 comments

Video captured during Alberta storm could be rare ball lightning event

https://globalnews.ca/news/11272805/alberta-storm-lightning-ball-video-july/
2•amichail•14m ago•0 comments

How to Network as an Introvert

https://aginfer.bearblog.dev/how-to-network-as-an-introvert/
3•agcat•18m ago•0 comments

Free Lunch Is over for the AI That Broke the Web

https://gizmodo.com/free-lunch-is-over-for-the-ai-that-broke-the-web-2000623837
4•zvr•20m ago•0 comments

AI helps find formula for paint to keep buildings cooler

https://www.theguardian.com/technology/2025/jul/02/ai-helps-find-formula-for-paint-to-keep-buildings-cooler
2•doener•23m ago•1 comments

The Memory Wall

https://semianalysis.com/2024/09/03/the-memory-wall/
4•FrojoS•30m ago•0 comments

Ask HN: How do you sell to B2B in current state of AI?

3•salesdo•32m ago•1 comments

Optimizing Tool Selection for LLM Workflows with Differentiable Programming

https://viksit.substack.com/p/optimizing-tool-selection-for-llm
2•viksit•32m ago•1 comments

Free tool for engineering managers: Never show up unprepared to a 1-on-1 again

https://tndm.app/
2•TandemApp•34m ago•0 comments

Drunk Tourist Damages Kyoto Temple Tied to Samurai Legend

https://www.tokyoweekender.com/japan-life/news-and-opinion/tourist-damages-kyoto-temple-tied-to-samurai-legend/
2•gnabgib•36m ago•0 comments

Cap and Trade, but for Rent Control

https://nodumbideas.com/p/cap-and-trade-for-rent-control
3•apesti•37m ago•0 comments

Building accurate postal address matching systems

https://www.robinlinacre.com/address_matching/
4•fanf2•43m ago•0 comments

Approach to LLMs and Other Reflections

https://matttproud.com/blog/posts/approach-to-llm.html
3•todsacerdoti•44m ago•0 comments

Litestar 2.16.0

https://docs.litestar.dev/latest/release-notes/changelog.html#2.16.0
2•akkad33•46m ago•0 comments

The Internet as Our Nervous System: From Cloud to Local-First (2024)

https://blog.anytype.io/from-cloud-to-local-first/
2•danial•46m ago•0 comments

Holding Cellphone while driving is illegal, California court rules

https://www.latimes.com/california/story/2025-06-05/holding-your-cell-to-navigate-while-driving-is-illegal-court-says
22•firefoxd•48m ago•19 comments

Lefties Aren't as Creative as We Thought

https://nautil.us/lefties-arent-as-creative-as-we-thought-1222179/
3•dnetesn•52m ago•0 comments

The New Interstellar Object 3I/Atlas Is Smaller or Rarer Than It Looks

https://avi-loeb.medium.com/the-new-interstellar-object-3i-atlas-is-smaller-or-rarer-than-it-looks-d2623ba1b1cf
3•TheBlight•55m ago•3 comments

Saving energy with efficient code [video]

https://www.youtube.com/watch?v=XntLynSlYjI
4•frevib•55m ago•1 comments

The Prime Reasons to Avoid Amazon

https://blog.thenewoil.org/the-prime-reasons-to-avoid-amazon
62•DanAtC•56m ago•4 comments

China helped Pakistan with 'live inputs' in conflict with India

https://www.reuters.com/world/china/china-helped-pakistan-with-live-inputs-conflict-with-india-indian-army-deputy-2025-07-04/
5•ironyman•1h ago•1 comments