frontpage.
newsnewestaskshowjobs

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.

The log/event processing pipeline you can't have

https://apenwarr.ca/log/20190216
1•kklee•51s ago•0 comments

Intel Makes Chipmaking History with High-NA EUV Panther Lake Production

https://hothardware.com/news/intel-first-high-na-euv-production
1•kristianp•2m ago•0 comments

Too Old for Silicon Valley? Think Again. AI Is Changing the Math

https://www.kqed.org/news/12090173/too-old-for-silicon-valley-think-again-ai-is-changing-the-math
2•andsoitis•7m ago•0 comments

Looking for Work

4•rmcdermott•10m ago•1 comments

TDD is dead. Long live testing. (2014)

https://dhh.dk/2014/tdd-is-dead-long-live-testing.html
2•yokto•11m ago•0 comments

Vint Cerf is working on a plan to unleash AI agents on the open internet

https://techcrunch.com/2026/07/15/vint-cerf-is-working-on-a-plan-to-unleash-ai-agents-on-the-open...
2•indigodaddy•12m ago•1 comments

Dan Boneh: The elliptic curve running the modern internet might have a backdoor [video]

https://www.youtube.com/watch?v=8WDOpzxpnTE
2•philipfweiss•13m ago•1 comments

Show HN: One More Letter

https://playonemoreletter.com/
4•hmate9•14m ago•1 comments

Reverse Engineering Apple Wallet

2•asxeem•15m ago•0 comments

Show HN: A Monte Carlo model that called the World Cup finalists 2 weeks ago

https://github.com/fabio-ricardo/worldcup-forecasting-model
2•fabioricardo7•15m ago•1 comments

Nul Characters in Strings in SQLite

https://sqlite.org/nulinstr.html
4•basilikum•20m ago•0 comments

Can AI Do RCA?

https://coroot.com/blog/hard-part-of-ai-root-cause-analysis-is-no-longer-the-model/
2•ekiauhce•22m ago•0 comments

Decarbonizing Singapore's Data Centers Using Sumatra's Geothermal Resources

https://ccsi.columbia.edu/the-case-for-decarbonizing-singapores-data-center-boom-using-south-suma...
2•crookedroad44•23m ago•0 comments

Will AI Fix Prior Authorization – Or Make It Worse?

https://undark.org/2026/07/15/medicare-prior-authorization-ai/
2•EA-3167•23m ago•0 comments

Metal-Organic Frameworks, Chemistry's New Miracle Materials

https://chemistry.berkeley.edu/news/meet-metal-organic-frameworks-chemistry%E2%80%99s-new-miracle...
6•andsoitis•23m ago•0 comments

Eaon (Preview)- Private all in one AI super app

https://eaon.dev
2•morriszdweck•24m ago•1 comments

New York won't build big data centers for 12mos, weighs energy and climate risks

https://apnews.com/article/new-york-data-centers-moratorium-ai-c1e05b74208a6c570eec7c658ac8f187
5•1vuio0pswjnm7•24m ago•1 comments

LeetCode in Your Terminal

https://github.com/HarryYCChou/lcx
2•harryycchou•27m ago•0 comments

The Anti-Mac User Interface (1996)

https://www.nngroup.com/articles/anti-mac-interface/
9•ninglor•31m ago•0 comments

Show HN: Homer's Odyssey Tree Viewer

https://github.com/pettijohn/homer-odyssey-tree/
4•pettijohn•33m ago•0 comments

Japan Builds Intelligence Agency It Hasn't Had Since World War II

https://www.nytimes.com/2026/07/13/world/asia/japan-intelligence-agency.html
3•gmays•39m ago•0 comments

Zoom warns of critical account takeover vulnerability

https://www.bleepingcomputer.com/news/security/zoom-warns-of-critical-account-takeover-vulnerabil...
3•tatersolid•39m ago•0 comments

Great mysteries of archaeology: an ancient Amazonian world revealed from the sky

https://theconversation.com/great-mysteries-of-archaeology-an-ancient-amazonian-world-revealed-fr...
5•zeristor•40m ago•0 comments

SQLite should have (Rust-style) editions

https://mort.coffee/home/sqlite-editions/
28•gnyeki•41m ago•12 comments

Concurrent JavaScript: It can work (2017)

https://webkit.org/blog/7846/concurrent-javascript-it-can-work/
2•Altern4tiveAcc•41m ago•0 comments

Are my evals lying to me?

https://hoplabs.substack.com/p/are-my-evals-lying-to-me
4•joanwestenberg•43m ago•0 comments

UK 16- and 17-year-olds to be encouraged to follow midnight social media curfew

https://www.theguardian.com/technology/2026/jul/14/uk-16-17-year-olds-midnight-social-media-curfew
2•bookofjoe•44m ago•0 comments

Anthropic Accidentally Made the Perfect Commercial

https://www.theatlantic.com/technology/2026/07/anthropic-ai-commercial/687925/
5•samizdis•45m ago•1 comments

I don't like the "staff engineer archetypes"

https://www.seangoedecke.com/staff-engineer-archetypes/
4•gfysfm•45m ago•0 comments

Carucate, An Ancient Unit of Land

https://en.wikipedia.org/wiki/Carucate
3•frikyng•45m ago•0 comments