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.

Plotting AI model release cadence: two labs are accelerating, three aren't

https://swiftalerts.trade/the-cadence-trade-hn
1•abipal15•15m ago•0 comments

With Every Breath You Take, Thank the Ocean

https://ocean.si.edu/ocean-life/plankton/every-breath-you-take-thank-ocean
3•thunderbong•21m ago•0 comments

The snake-wrangling 84-year-old who lives on a remote barrier island

https://www.bbc.com/travel/article/20260612-the-snake-rearing-84-year-old-who-lives-on-a-remote-b...
1•1659447091•22m ago•0 comments

Show HN: Lean bulk, cut, body recomp. Calculate maintenance calories

https://macrocodex.app/
4•faangguyindia•46m ago•2 comments

The only cauldron ever found in a river in the British Isles

https://www.bbc.co.uk/news/articles/clyrn5e2k9no
1•nickt•46m ago•0 comments

Launch: MyIntelBrief – Smarter Competitor Monitoring

https://myintelbrief.com/
2•myintelbrief•47m ago•0 comments

Show HN: Cc-fleet – run other LLMs as Claude Code workers, your sub drives

https://github.com/ethanhq/cc-fleet
1•ethanhq•51m ago•0 comments

Show HN: Adbqr – ADB pair via QR code from the CLI

https://github.com/kristjan/adbqr
1•kristjan•55m ago•0 comments

Developers don't understand CORS (2019)

https://fosterelli.co/developers-dont-understand-cors
3•toilet•55m ago•0 comments

Australia confirms first case of H5N1 bird flu as virus reaches every continent

https://www.bbc.com/news/articles/c4gykxklvl5o
1•1659447091•58m ago•0 comments

White House delays US voting-machine vulnerability report

https://www.reuters.com/world/white-house-delays-release-us-voting-machine-study-midterms-near-20...
35•logickkk1•1h ago•17 comments

Hop.Earth – Google Maps and Need For Speed. World around created while driving

https://hop.earth/?server=RDgva&route=XxOaosUo
3•touchpadder•1h ago•1 comments

Data integrity in rqlite: what it checks and what it doesn't

https://rqlite.io/docs/guides/data-integrity/
1•otoolep•1h ago•0 comments

Ratchet – BIOS flashing toolkit with a built-in MCP server for AI agents

https://github.com/jackulau/ratchet
1•JackLau•1h ago•0 comments

Apple-FM – a command-line interface for Apple's on-device models

https://www.npmjs.com/package/apple-fm
2•brianwestphal•1h ago•2 comments

XRPentest: AI-powered security audit tool for VR/XR headsets

https://xrpentest.com
1•h_a_c_k•1h ago•0 comments

Google Can't Math Parsecs

https://www.lesswrong.com/posts/BmqzjcD4tGvy3bim8/google-can-t-math-parsecs
8•ubutler•1h ago•2 comments

How the AI Village Works

https://theaidigest.org/village/blog/how-the-ai-village-works
2•vinhnx•1h ago•0 comments

How Does One Brain Speak Two Languages?

https://www.nytimes.com/2026/06/15/science/brain-language-grammar.html
4•ripe•1h ago•0 comments

They Looked Like They Were Getting Rich on Polymarket–But None of It Was Real

https://www.wsj.com/business/media/polymarket-social-media-bets-prediction-market-441cdeb5
4•Vaslo•1h ago•0 comments

Parody Symbolics Lisp Machines software release (1982)

https://groups.google.com/g/comp.sys.ti.explorer/c/2sI_2_eOWug
1•gnodar•1h ago•0 comments

When I reject AI code even if it works

https://vinibrasil.com/when-i-reject-ai-code-even-if-it-works/
29•vnbrs•1h ago•11 comments

Show HN: GenAIDojo

https://www.genaidojo.io/
1•aniketwattawmar•1h ago•0 comments

An Apology for Idlers by Robert Louis Stevenson (1877) [video]

https://www.youtube.com/watch?v=a4T9pbxrlfw
2•SpiralLibrarium•1h ago•0 comments

Subquadratic claims it broke through a bottleneck that's holding back LLMs

https://www.technologyreview.com/2026/06/19/1139313/a-startup-claims-it-broke-through-a-bottlenec...
1•baddash•1h ago•1 comments

RocketAnalyzer · Streamlit

https://rocketanalyzer-ca7wd4a54c7sxjiuk6aewi.streamlit.app
1•ApplePanda03•1h ago•0 comments

Show HN: Rocannon – Any Ansible module to MCP Tool, record sessions as playbooks

https://github.com/msradam/rocannon
2•msradam•1h ago•0 comments

Adobe adds its AI assistant to Premiere, Illustrator, and InDesign

https://techcrunch.com/2026/06/18/adobe-adds-its-ai-assistant-to-premiere-illustrator-and-indesign/
4•breve•1h ago•0 comments

VibeThinker 3B – Taking on Giant Models [video]

https://www.youtube.com/watch?v=_a9Vv5dfW24
3•modinfo•1h ago•0 comments

A Visit to id Software ft Bobby Prince (1993) [video]

https://www.youtube.com/watch?v=HpEBUV_g9vU
4•qmr•2h ago•0 comments