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.

Turn your PC, Mac, or Linux box into an AI server

https://github.com/Light-Heart-Labs/DreamServer
1•dreamserver•59s ago•0 comments

AI Shocker

https://www.efinancialcareers.com/news/citi-s-global-head-of-ai-joined-in-september-and-has-just-...
1•GHHardy•1m ago•0 comments

Lawmakers propose banning all U.S.-Chinese research collaborations

https://www.science.org/content/article/lawmakers-propose-banning-all-u-s-chinese-research-collab...
1•ceejayoz•3m ago•0 comments

Why AI-generated draw.io AWS diagrams have empty squares (and a fix)

https://github.com/vidanov/aws-architecture-diagram-skill
1•vidanov•3m ago•0 comments

Know Your Point C

https://pointc.co/know-your-point-c/
2•benwerd•3m ago•0 comments

How should we think about Starship?

https://mceglowski.substack.com/p/how-should-we-think-about-starship
1•simonebrunozzi•4m ago•0 comments

Bare: Small and modular JavaScript runtime for desktop and mobile

https://github.com/holepunchto/bare
1•janandonly•4m ago•0 comments

Show HN: Scan your AI agent's code for tool calls with no checks

https://github.com/Diplomat-ai/diplomat-agent-ts
1•jguarnelli•5m ago•0 comments

Malware dev tries to steal Claude users secrets NPM slop, leaks own GitHub token

https://www.theregister.com/cyber-crime/2026/05/27/supply-chain-brain-drain-npm-attacker-foolishl...
1•Bender•7m ago•0 comments

Taste Is Necessary but Not Sufficient When Working with Agents

https://www.ssp.sh/brain/having-taste-with-ai/
2•zazuke•7m ago•0 comments

Show HN: Open-source alternative to Codex Chronicle, using Apple's local OCR

https://github.com/familiar-software/familiar
2•talsraviv•7m ago•0 comments

Where Are the Economies of Scale in Homebuilding?

https://www.construction-physics.com/p/where-are-the-economies-of-scale
3•crescit_eundo•8m ago•0 comments

Why does it take so long to mend an escalator? (2002)

https://www.lrb.co.uk/the-paper/v24/n05/peter-campbell/why-does-it-take-so-long-to-mend-an-escalator
2•downbad_•8m ago•0 comments

Vibe Gets to Work

https://mistral.ai/news/vibe-agent/
2•hacb•9m ago•0 comments

Never Pay for Claude

https://github.com/RyanKung/rotom
4•ryankung•10m ago•2 comments

How to avoid being outsourced or open sourced (2008)

https://www.johndcook.com/blog/2008/02/12/how-to-avoid-being-outsourced-or-open-sourced/
3•tapanjk•11m ago•0 comments

SpaceX-Stasy

https://substack.com/@edwardelson/p-199273735
2•simonebrunozzi•11m ago•0 comments

The Long, Bitter Fight at the Park Slope Food Co-Op

https://www.nytimes.com/2026/05/28/nyregion/the-long-bitter-fight-at-the-park-slope-food-co-op.html
2•brandonb•11m ago•0 comments

Check our new AI developer tool and please REVIEW

https://github.com/pwnaxe/squick
2•TrueSTRX•12m ago•0 comments

En Svensk Tiger

https://en.wikipedia.org/wiki/En_svensk_tiger
2•verandaguy•12m ago•0 comments

Company CEO flooded file share with smut, called for help after he deleted it

https://www.theregister.com/security/2026/05/28/company-ceo-flooded-file-share-with-smut-called-f...
2•Bender•13m ago•0 comments

Under the River

https://shopify.engineering/under-the-river
3•burke•13m ago•0 comments

AI hiring algorithms reject Black, Asian job seekers at higher rates

https://www.theregister.com/ai-ml/2026/05/27/ai-hiring-algorithms-reject-black-asian-job-seekers-...
2•Bender•13m ago•1 comments

Blood pressure tech floods the market after FDA relaxes wearables oversight

https://www.statnews.com/2026/05/28/fda-wellness-guidance-unvetted-blood-pressure-tech-floods-mar...
2•brandonb•13m ago•1 comments

Ask HN: Did forums solve what Discord and Reddit still don't?

4•tolarianwiz•13m ago•0 comments

Vc: SIMD Vector Classes for C++

https://github.com/vcdevel/vc
2•tosh•14m ago•0 comments

Five contributions to a project: money, effort, attention, memory and wisdom

https://improvesomething.today/five-contributions-to-a-project/
2•surprisetalk•14m ago•0 comments

France's parliament votes to repeal slavery-era "Black Code" laws

https://www.washingtonpost.com/business/2026/05/28/france-slavery-law-code-noir-repeal/220dedaa-5...
2•nkg•14m ago•0 comments

NPM staged publishing setup with approximately one click per package

https://lavamoat.github.io/stageclicker/
3•naugtur•15m ago•0 comments

Marines turn to modified Call of Duty 4 to train new sergeants

https://www.stripes.com/branches/marine_corps/2026-05-22/call-of-duty-4-marines-sergeants-school-...
2•randycupertino•15m ago•0 comments