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.

Printable Blank Calendar Generator

https://blankcal.app/?r=this-month&dp=1
1•zapeterson16•38s ago•0 comments

Google's Ambitious AI Search Changes (Biggest in 25 Years) Are Risky. Here's Why

https://www.inc.com/connor-jewiss/googles-ambitious-ai-search-changes-are-risky-heres-why/91347071
1•connorjewiss•1m ago•0 comments

Xi told Trump that Putin might 'regret' Ukraine invasion

https://www.ft.com/content/567c57b0-6346-43e6-9d14-840a793b4d1d
1•cwwc•2m ago•0 comments

Jigs, Products, and Appearances: The Vibe Coding Distribution Problem

https://trevoragilbert.com/posts/jigs-products-appearances-vibe-coding-distribution/
1•trevoragilbert•2m ago•0 comments

I created Age of Empires 2: The Conquerors

https://twitter.com/i/status/2056763353369063571
2•Michelangelo11•3m ago•0 comments

Trump's deal with government ends his tax audits

https://www.justice.gov/opa/media/1441216/dl
1•defly•5m ago•0 comments

Ask HN: How are people managing multi-node WireGuard deployments?

1•dminglv•6m ago•0 comments

Backup Photos from Google Photos: A Detailed Guide

https://blinkdisk.com/blog/backup-photos-from-google-photos
1•pauxel•6m ago•0 comments

Occupations with the Highest Divorce Rates

https://flowingdata.com/2026/05/07/divorce-and-occupation-2026/
1•gmays•7m ago•0 comments

This was Coworking Tech Week 2026

https://www.coworkingtechweek.com/blog/this-was-coworking-tech-week-2026/
1•inchevd•7m ago•0 comments

Hey Platforms: Add Take It Down to Your Transparency Reports

https://www.techdirt.com/2026/05/19/hey-platforms-add-take-it-down-to-your-transparency-reports/
1•hn_acker•9m ago•0 comments

Sōzune – a reverse proxy built on Sōzu, with Traefik-style autodiscovery

https://github.com/kemeter/sozune
2•Shine-neko•10m ago•2 comments

Concluding the Arc Experiment

https://www.ietf.org/archive/id/draft-adams-arc-experiment-conclusion-00.html
1•upofadown•10m ago•0 comments

Power prices on America's largest grid rose 76%

https://techcrunch.com/2026/05/15/power-prices-are-up-76-on-americas-biggest-grid-and-a-watchdog-...
1•logickkk1•11m ago•0 comments

Flyline: A Bash plugin to replace readline for a modern line editing experience

https://github.com/HalFrgrd/flyline/
4•hellohal•14m ago•3 comments

Purerl: Erlang back end for the PureScript compiler

https://github.com/purerl/purerl
1•tosh•15m ago•0 comments

A frightening weekend doesn't settle the license plate reader debate

https://www.statesman.com/opinion/editorials/article/license-plate-reader-debate-opinion-22264336...
1•jkestner•15m ago•0 comments

Trump Mobile is leaking customer info [video]

https://www.youtube.com/watch?v=voxXDDq58Bk
2•geerlingguy•16m ago•0 comments

Slow Mode

https://blog.val.town/slow-mode
2•yurivish•16m ago•0 comments

Show HN: Cable Detective

https://apps.apple.com/us/app/cable-detective/id6765963737?mt=12
1•franze•18m ago•0 comments

Raven Software's Jedi Academy sources, from 2013, had all the crunch rage intact

https://old.reddit.com/r/programming/comments/1thewau/raven_software_released_the_jedi_academy_so...
1•perching_aix•18m ago•1 comments

VeilGate- Deception Reverse Proxy

1•C0oki3s•20m ago•0 comments

Latest step in quest to 'de-extinct' Giant Moa? Hatching chicks from fake eggs

https://thespinoff.co.nz/science/20-05-2026/the-latest-step-in-the-quest-to-de-extinct-the-moa-ha...
1•HBcodes•23m ago•0 comments

Auto-Brewery Syndrome

https://en.wikipedia.org/wiki/Auto-brewery_syndrome
2•pulkitsh1234•23m ago•0 comments

Predicting categorical&continuous Alzheimer's disease outcomes from 1 MRI scan

https://www.nature.com/articles/s43587-026-01121-2
4•bookofjoe•23m ago•0 comments

Show HN: Enforra – open-source action governance for AI agent tool calls

https://github.com/enforra/enforra
3•rohitguptap•25m ago•1 comments

Perplexity says its AI agent cut Rho's weekly meeting time by 90%

https://twitter.com/perplexity_ai/status/2056749555346235704
1•Otek•28m ago•0 comments

Google Antigravity Built an OS from a single prompt

https://antigravity.google/blog/google-antigravity-built-an-os
3•py4•28m ago•4 comments

Gmail is going to start talking to you

https://www.theverge.com/tech/932973/google-gmail-live-ai-keep-docs-io-2026
1•cdrnsf•29m ago•2 comments

The Telescope That Got Shot (2023)

https://www.amusingplanet.com/2023/04/the-telescope-that-got-shot.html
2•NKosmatos•30m ago•0 comments