frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Avoid Continue

https://www.teamten.com/lawrence/programming/avoid-continue.html
2•todsacerdoti•1y ago

Comments

zoezoezoezoe•1y ago
I dont know if I fully agree. Sure, there is definitely an argument the be had about whether or not `continue` is the best word to use in this instance, but why avoid it entirely? Every programmer is able to easily understand what code like this would do:

``` for (Node node : nodeList) { if (node.isBad()) { continue; } processNode(node); } ```

Every keyword in any programming language is largely arbitrary in my opinion let's take a look at the beginning of the codeblock `for (Node node : nodeList)` also completely arbitrary, though it's clear to anyone who's ever written C++ that it is equivalent to saying "for every node in nodeList".

Continue is not meant to read as "continue execution" it's meant to be "continue to the next item of the list", and I think avoiding it entirely is a pointless effort.

Ukv•1y ago
I feel `skip` may have been a better name, but disagree with it being logically difficult to parse beyond that.

If I'm reading a loop and see

    for x in y {
        if exclusions.contains(x) { skip; }
        if x.children.length == 0 { skip; }
        if os.file.exists(x.name) { skip; }
        ...
I instantly know that processing for those elements is skipped, and they won't be relevant for the rest of the loop.

Whereas if I see

    for x in y {
        if !exclusions.contains(x) {
            if x.children.length != 0 {
                if !os.file.exists(x.name) {
        ...
I feel like there's still mental overload with not knowing where those `if` blocks end, and so having to keep the conditions in mind. It doesn't immediately tell me that the rest of the loop is being skipped.

The `log()` mistake seems no less likely to happen using early-returns in function instead, and I'd argue nesting checks actually introduces more room for that kind of error overall, where you append something at the end within the wrong set of brackets, compared to a flatter structure.

Stellantis plans $17,500 small EV to revive European market

https://www.reuters.com/world/china/stellantis-produce-small-e-car-italys-pomigliano-2028-2026-05...
1•vrganj•1m ago•0 comments

Claude Player: royalty-free elevator music on Claude Code

https://github.com/betacar/claude-player
2•betacar•1m ago•1 comments

Lexicon – Manipulate DNS records on various DNS providers in a standardized way

https://github.com/dns-lexicon/dns-lexicon
2•indigodaddy•4m ago•0 comments

20k+ ACID transactions/SEC on a single laptop: consistency vs. speed myth

https://medium.com/@hugo.vantighem/postgres-grade-serializable-at-20k-ops-s-on-a-laptop-dont-try-...
1•le_yougue•5m ago•0 comments

Next.js May 2026 security release

https://vercel.com/changelog/next-js-may-2026-security-release
1•whicks•6m ago•0 comments

Canonry – CLI to track how ChatGPT, Claude, and Gemini cite your site

https://github.com/AINYC/canonry
1•arberx•6m ago•1 comments

Show HN: Gpubook – An order book for GPU compute

https://gpubook.io
1•jesse_portal•7m ago•0 comments

ASDL: Enable graphic programming when no other ways are easily viable

https://github.com/NuxTuxSux/ASDL
1•tosh•8m ago•0 comments

Andrej Karpathy joins Anthropic

https://twitter.com/karpathy/status/2056753169888334312
52•dmarcos•8m ago•6 comments

Sendcutsend CEO Once Spurned Venture Capital.Now He's Taking $110M

https://www.wsj.com/business/entrepreneurship/this-manufacturing-ceo-once-spurned-venture-capital...
1•bkraz•8m ago•0 comments

Civilization 4 AI Survivor

https://www.sullla.com/civ4survivorindex.html
1•tmtvl•10m ago•0 comments

Socrates Warned Us About AI

https://antar.me/blog/socrates-warned-us-about-ai/
1•redaantar•10m ago•0 comments

Cardputer Zero – Pocket Raspberry Pi Computer for Hackers

https://shop.m5stack.com/pages/m5-cardputerzero
2•dr_kiszonka•11m ago•0 comments

Claude Managed Agents on Cloudflare

https://blog.cloudflare.com/claude-managed-agents/
2•mikece•11m ago•0 comments

Agentyc – deterministic browser automation for coding agents

https://github.com/distillation-labs/agentyc
2•japneetkalkat•12m ago•0 comments

Sendapi.co – One API for WhatsApp, SMS, and Email

https://sendapi.co/
1•nimana•12m ago•0 comments

Cracking Enigma with an FPGA

https://people.ece.cornell.edu/land/courses/ece5760/FinalProjects/s2026/ej289_kr562_isf9/ej289_kr...
1•vha3•13m ago•0 comments

Google Analytics is the wrong tool for your indie project and here's why

https://statjot.com/blog/google-analytics-alternative
2•dvalenzu17•14m ago•0 comments

Why Agents Suddenly Need a Sandbox [video]

https://www.youtube.com/watch?v=hkEH_fTH8iI
1•cms4dlols•14m ago•0 comments

AI's favorite coding language is also the most expensive

https://everythingengineer.substack.com/p/ais-favorite-coding-language-is-also
2•mikecarroll•15m ago•0 comments

Collective intelligence for AI-assisted chemical synthesis

https://www.nature.com/articles/s41586-026-10131-4
1•vednig•15m ago•0 comments

AI system fails during Glendale Community College graduation ceremony

https://www.azfamily.com/2026/05/19/ai-system-fails-during-glendale-community-college-graduation-...
1•Kapura•15m ago•0 comments

Elevated errors on Claude Opus 4.7

https://status.claude.com/incidents/f9yk8lqw384x
1•rob•16m ago•0 comments

The Not So Simple Task of Identifying Retail Trading Flow

https://medium.com/prooftrading/the-not-so-simple-task-of-identifying-retail-flow-a290c47944ba
1•smarkelon•16m ago•0 comments

Safetykit: A small collection of safety demos for human-in-the-loop scripts

https://thundergolfer.com/safetykit
1•thundergolfer•17m ago•0 comments

What's behind an unfindable feature for hotel management software?

https://littlelanguagemodels.com/but-its-right-there-on-the-website/
1•mooreds•17m ago•0 comments

Webb discovers one of the universe's first galaxies

https://phys.org/news/2026-05-webb-universe-galaxies.html
2•gmays•17m ago•0 comments

ICRA: We Turned iPhones into Spatial Data Capture Rigs

https://arxiv.org/abs/2605.05945
1•satpal•17m ago•0 comments

Dating Advice for Men

https://www.noahpinion.blog/p/dating-advice-for-men
2•mooreds•18m ago•1 comments

NATO Has Seen the Future and Is Unprepared

https://www.wsj.com/opinion/nato-has-seen-the-future-and-is-unprepared-887eaf0f
1•mooreds•19m ago•0 comments