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.

Historically grounded settlement simulation set in Northern Germany around 1500

https://samenland.app/
1•doener•54s ago•0 comments

Digestive Tract for Digestion, Respiration in Air-Breathing Weatherloach [pdf]

https://pmc.ncbi.nlm.nih.gov/articles/PMC11201251/
1•thunderbong•1m ago•0 comments

I Tested a Popular A.I. Slop Detector. It Felt Empowering

https://www.nytimes.com/2026/08/13/technology/personaltech/pangram-ai-detector-test.html
1•paulpauper•1m ago•0 comments

Musk reposts tweet calling Starlink service for Ukraine 'mistake'

https://kyivindependent.com/musk-reposts-tweet-calling-starlink-service-for-ukraine-mistake/
1•doener•3m ago•0 comments

Notes on San Marino

https://mattlakeman.org/2026/11/05/notes-on-san-marino/
1•paulpauper•3m ago•0 comments

A Preposterous, Overpriced, Beautiful Disaster of a Car

https://www.theatlantic.com/technology/2026/11/rip-cybertruck/689340/
1•paulpauper•5m ago•0 comments

Constraining the Commit Boundary: DIO/ODI Authorization Guardrail for Agentic ER

https://arxiv.org/abs/2610.37407
2•danielberanek•9m ago•0 comments

Trigger.dev: Security incident report – Sunday November first

https://trigger.dev/blog/security-incident-report-nov-2026
3•soheilpro•14m ago•0 comments

ESLint now officially supports linting of shell scripts

https://eslint.org/blog/2026/11/eslint-shell-plugin-announcement/
1•soheilpro•16m ago•0 comments

Meteorite found in the Sahara shows what Mars was like 4.1 billion years ago

https://www.cnn.com/2026/11/06/science/mars-meteorite-sahara-teghaza-discovery
2•cisc•16m ago•0 comments

Bends in magneto-inductive waveguides (2010) [pdf]

https://www.imperial.ac.uk/media/imperial-college/faculty-of-engineering/electrical-and-electroni...
1•peter_d_sherman•16m ago•0 comments

Show HN: I built ivyNote, a local-first Markdown notes app

https://ivynote.app/
1•songtianlun1•33m ago•0 comments

The AI sell-off compared to well-known stock market crashes

https://www.kadoa.com/companies/insights/ai-selloff-perspective
2•hubraumhugo•35m ago•0 comments

Diana – a terminal that records what your coding agents did

https://heydiana.ai/
2•gyandroid•35m ago•0 comments

Coding agents ranked for builders shipping AI software

https://rankings.leffke.com/categories/coding-agents
1•rcleffke•39m ago•0 comments

Man reaches the Bay Area after walking across the country from New York City

https://www.nbcbayarea.com/news/local/man-walk-across-country-new-york-city-san-francisco/4165421/
2•inatreecrown2•42m ago•0 comments

Z2RAM – HBM replacement, no capacitor, mass manufacturable at 300nm

https://www.nagarelabs.ai/
1•peter_d_sherman•43m ago•1 comments

An app aimed to solve the loneliness crisis

https://apps.apple.com/qa/app/lc-lets-connect/id6792295616
2•Pahal10•45m ago•0 comments

Black holes are simpler than forests and science has its limits(2017)

https://aeon.co/ideas/black-holes-are-simpler-than-forests-and-science-has-its-limits
3•num42•47m ago•0 comments

Show HN: I built an AI photo editor powered by GPT-Image-2.6

https://getaiphotoeditor.com/
1•CoderLim110•47m ago•0 comments

Herbert Blomstedt, former SF Symphony music director, dies at 99

https://www.sfchronicle.com/entertainment/classical/article/herbert-blomstedt-former-s-f-symphony...
3•dsubburam•48m ago•1 comments

His Job Is to Turn Walmart's Customer Data into Profit

https://www.wsj.com/business/retail/seth-dallaire-walmart-ef8827b5
2•impish9208•53m ago•1 comments

FLEY a voice AIassistant thatwill notonly talkwith youbut canalso control yourPC

1•Drfoxi•55m ago•0 comments

Agents reveal secrets when offered to team up with each other

https://www.theregister.com/security/2026/11/06/agents-reveal-secrets-when-offered-to-team-up-wit...
3•pseudolus•56m ago•0 comments

It's never been easier to build a RollerCoaster Tycoon

https://twitter.com/noriagent/status/2117256979542397106
1•theahura•56m ago•0 comments

Cellular pathway that allows colorectal cancer to metastasize

https://news.mit.edu/2026/biologists-identify-cellular-pathway-allows-colorectal-cancer-metastasi...
5•gmays•57m ago•0 comments

Despite headwinds, Vineyard Wind, Revolution Wind come online

https://newbedfordlight.org/despite-headwinds-vineyard-wind-revolution-wind-come-fully-online/
1•geox•59m ago•0 comments

Agentic QA for Marketing

https://www.arbiterqa.com
1•digitalgeek9•1h ago•1 comments

Show HN: Select – AI agents that earn autonomy through verified work

https://github.com/Kirby54/Select
1•Ahmedch11•1h ago•0 comments

Show HN: We filmed a bird-themed Iliad using mallard

https://mallard-ai.com/Rika321/Homer?tab=files&file=The_Iliad_Complete.mp4
1•rika321•1h ago•0 comments