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.

We are all Product Engineers Now

https://seldo.com/posts/we-are-all-product-engineers-now/
1•max-ch•19s ago•0 comments

GPT-6 Astra solves puzzles

https://quesma.com/blog/gpt-6-astra-solves-puzzles/
1•stared•23s ago•0 comments

How does call center headset noise canceling filter out keyboard sounds?

1•beienchina•40s ago•0 comments

How Good Are Frontier Models at Physics? Expert Re-Grading Reveals Broken

https://arxiv.org/abs/2609.13009
1•sbulaev•2m ago•0 comments

MPs and Lords call for new law to address AI threat to human rights

https://www.bbc.co.uk/news/articles/cwyzvgj70y4o
2•chrisjj•13m ago•0 comments

OpenArch – PyTorch implementations of modern LLM architectures

https://github.com/anuj0456/OpenArch
2•anuj0456•13m ago•1 comments

Tesla owners to get insurance discount if they use self-driving

https://www.afr.com/companies/transport/tesla-owners-to-get-insurance-discount-if-they-use-self-d...
2•Alien1Being•17m ago•0 comments

1.8x faster than GitHub Actions

https://ogirardot.writizzy.blog/p/rickub-1-8-faster-then-github-actions
1•ssaboum•17m ago•1 comments

Would you like to be a helpful idiot to our AI overlords? [video]

https://www.youtube.com/watch?v=CZB7wlYbknM
1•gilfoyle_7•21m ago•0 comments

An open-source diagram skill for designer

https://github.com/cathrynlavery/diagram-design
1•Nina_antalpha•23m ago•0 comments

Is PDF a Problem for AI?

https://pdf4wcag.com/blog-news/is-pdf-a-problem-for-ai
1•JilBill•31m ago•1 comments

Finding All Solutions to LinkedIn-Queens Puzzle

https://wyounas.github.io/model-checking/puzzles/2026/06/06/finding-all-solutions-to-linkedin-que...
1•simplegeek•33m ago•0 comments

SpaceX sues to block release of tax-break records for its Texas Terafab project

https://www.businessinsider.com/spacex-terafab-tax-break-records-ai-transparency-texas-2026-9
3•snikolaev•33m ago•0 comments

Show HN: 1080p is 920px tall – 1k real browser viewports

https://screensize.net/reports/viewport-stats
3•zenpe•34m ago•0 comments

Language Makes Power Feel Like Common Sense

https://linguistically.substack.com/p/antonio-gramsci-how-language-makes
1•akbarnama•35m ago•0 comments

Australian insurer offers discount to self-driving car owners

https://www.smh.com.au/business/consumer-affairs/humans-make-mistakes-insurer-offers-discount-to-...
2•Alien1Being•35m ago•0 comments

Human bottleneck will not let AI replace any jobs

2•jatindavis05•38m ago•0 comments

Open-source project: Use ChatGPT Web models directly in Codex

https://github.com/miuuyy/codex-chatgpt-web
1•Moon_Y•41m ago•0 comments

Confessions of an Unrepentant Slop Snob

https://charity.wtf/p/confessions-of-an-unrepentant-slop
2•BerislavLopac•44m ago•0 comments

Show HN: Descles, response level LLM message control with HITL approval flows

https://www.descles.com/
1•chiatzen•47m ago•0 comments

If Astra was trained on 100k Blackwell GPUs, what happens with 1M Rubin?

https://twitter.com/JensenHuang/status/2096700264569090384
2•aurareturn•48m ago•1 comments

South Africa's weigh-and-pay shops are tackling 'poverty tax' head on

https://www.theguardian.com/global-development/2026/sep/14/south-africa-weigh-and-pay-shops-food-...
2•ljf•49m ago•0 comments

Three Reasons Europe learned to distrust Big Tech before America did

https://thebulletin.org/premium/2026-09/three-reasons-europe-learned-to-distrust-big-tech-before-...
2•vrganj•51m ago•0 comments

My experience of September 11, 2001, from across the Hudson

https://medium.com/freedomofthought/if-nobody-loved-me-the-city-did-27ad19dbcb8a
2•raynchad•51m ago•0 comments

Ansto nuclear reactor marks 20 years of health and technology innovation

https://www.abc.net.au/news/2026-09-14/ansto-opal-nuclear-reactor-celebrates-20-years/107132928
2•ggm•51m ago•0 comments

Teaching a fruit fly to play chess

https://flychess-hq.vercel.app
1•qsort•51m ago•0 comments

The Cost of Omelas – 10 centuries of total people killed by nation states

https://omelas-dj1.pages.dev
1•epsteingpt•1h ago•1 comments

War over robotaxis in NYC heats up with retracted Waymo report, 'Autokill' novel

https://gothamist.com/news/war-over-robotaxis-in-nyc-heats-up-after-retracted-waymo-report-and-au...
3•tape_measure•1h ago•0 comments

What an ERC-4626 price test shows

https://medium.com/@giladha/what-an-erc-4626-price-test-actually-shows-9fce352c5bde
1•giladha•1h ago•0 comments

Show HN: I made an unlimited TikTok video generator to get views on the internet

https://cloney.app
1•phanahm•1h ago•0 comments