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.

Evaluating Geekbench 6

https://chipsandcheese.com/p/evaluating-geekbench-6
1•wmf•8m ago•0 comments

Canadian sues DHS over alleged Google data grab tied to social media posts

https://www.cbc.ca/news/world/us-dhs-aclu-lawsuit-canadian-john-doe-9.7187851
2•cdrnsf•16m ago•0 comments

How to Generate Terraform from Existing AWS Resources

https://www.ops0.com/blog/generate-terraform-from-existing-aws-resources
1•sureshpaulchamy•17m ago•0 comments

Worlds first OptoSAR Satellite launched

https://www.indiatoday.in/science/story/galaxeye-mission-drishti-optosar-satellite-launch-india-p...
3•raks619•20m ago•0 comments

Australian Renewable Energy Hub

https://research.csiro.au/hyresource/australian-renewable-energy-hub/
1•mooreds•20m ago•0 comments

Critical RCE found in Obsidian Tasks plugin

https://zeroquarry.com/research/obsidian-tasks-rce/
2•eskibars•21m ago•1 comments

AI at Discount

https://tomtunguz.com/ai-at-discount/
1•swolpers•24m ago•0 comments

Data Race Freedom in OxCaml

https://kcsrk.info/ocaml/oxcaml/x-ocaml/blogging/2026/05/07/data-race-freedom-in-oxcaml/
1•matt_d•27m ago•0 comments

Got the syntax highlighting right, theming too – EaglePress.org v1.43

https://eaglepress.org
2•eagle10ne•28m ago•0 comments

Show HN: Loxai.tech and Neutboom – Gen AI's frontier of individuality

https://www.neutboom.com
1•audreyfei•28m ago•0 comments

SpaceX is starting to move on from the most successful rocket

https://arstechnica.com/space/2026/05/spacex-is-starting-to-move-on-from-the-worlds-most-successf...
1•rbanffy•29m ago•0 comments

Mojo 1.0 Beta

https://mojolang.org/
2•sbt567•29m ago•0 comments

Why Are Morel Mushrooms Hard to Grow?

https://mushroomwowhub.com/why-are-morel-mushrooms-hard-to-grow/
2•thunderbong•30m ago•0 comments

Coding plan comparisons based on actual usage

https://sites.diy/blog/2026-05-01-coding-plan-comparisons/
1•gmays•34m ago•0 comments

DNA matches identify four more sailors from Franklin expedition

https://uwaterloo.ca/news/media/dna-matches-identify-four-more-sailors-franklin-expedition
1•bandrami•36m ago•0 comments

Claude Code CVE-2026-39861:sandbox escape via symlink

https://github.com/advisories/GHSA-vp62-r36r-9xqp
2•Armor1AI•38m ago•1 comments

Anthropic response to 1-click pwn: Shouldn't have clicked 'ok'

https://www.theregister.com/security/2026/05/07/claude-code-trust-prompt-can-trigger-one-click-rc...
3•Lihh27•40m ago•0 comments

Hexo accidentally made the repository private and lost all stars

https://github.com/orgs/hexojs/discussions/5775
1•ZeroAurora•41m ago•0 comments

Stop paying twice for storage. Use your spare webhosting as your own cloud drive

https://github.com/KyleBenzle/FreeCloud
1•Hilliard_Ohiooo•44m ago•0 comments

Thermal event affecting AWS AZ use1-az4

https://health.aws.amazon.com/health/status#786566
4•themenomen•45m ago•0 comments

Companies help parents try to pick their babies' traits

https://text.npr.org/nx-s1-5704317
1•mooreds•45m ago•1 comments

Bliss (Photograph)

https://en.wikipedia.org/wiki/Bliss_(photograph)
1•cainxinth•47m ago•0 comments

Silver, Silk, and States: The Spanish Empire and Ming China

https://andrewhuangster.substack.com/p/silver-silk-and-states-how-a-single
3•soupspaces•47m ago•0 comments

SDLC is a power tool, not a compliance document

https://blog.robbowley.net/2026/05/07/your-sdlc-is-a-power-tool-not-a-compliance-document/
2•8organicbits•51m ago•0 comments

Anthropic and the Department of War

https://www.hyperdimensional.co/p/clawed
2•mooreds•51m ago•0 comments

Summer of Math Expositions(2021-2025) – 3b1B archive

https://some.3b1b.co/archive?category=video&year=2021&page=1
1•num42•54m ago•0 comments

Archive.today requires scanning a QR code on your phone to use

https://archive.fo
3•Cider9986•55m ago•1 comments

Show HN: AnamDB – An AI-native, differentiable Datalog engine written in Rust

https://github.com/jam5991/anam
1•jam5991•55m ago•0 comments

Agentic Coding at ClickHouse

https://clickhouse.com/blog/agentic-coding
1•ubolonton_•56m ago•0 comments

It's time to stop using SMS, here's why [video]

https://www.youtube.com/watch?v=B9BWXvn-rB4
1•Cider9986•56m ago•0 comments