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.

Shiny Forever: How Tamatoa Won

https://firasd.substack.com/p/shiny-forever-how-tamatoa-won-moana-maui-disney-crab-villain-song-j...
1•firasd•26s ago•0 comments

The SpaceX IPO It's Worse Than You Think [video]

https://www.youtube.com/watch?v=-X6YzlY_8tM
1•ZeljkoS•33s ago•0 comments

My Son's Hockey Team and the Crisis of American Resentment

https://www.theatlantic.com/ideas/2026/05/children-private-equity-sports/687222/
1•breve•1m ago•0 comments

Show HN: Smithereen – an early-Facebook-style Fediverse server

https://smithereen.software
1•grishka•1m ago•0 comments

I Got Sycophanted

https://whattotelltherobot.com/p/i-got-sycophanted
1•stefie10•1m ago•0 comments

Benchmarking Free-Threading Performance with Tachyon

https://blog.changs.co.uk/benchmarking-free-threading-performance-with-tachyon.html
1•rzk•4m ago•0 comments

Internet Sleuths Reconstruct Audio of Ups Plane Crash, NTSB Takes Down Dockets

https://www.paddleyourownkanoo.com/2026/05/21/federal-crash-investigators-discover-internet-sleut...
1•buildsjets•5m ago•1 comments

Cheap code means formal verification is reasonable now

https://antfly.io/blog/agent-formal-verification
1•dovin•5m ago•0 comments

August Sander's Enormous Attempt to Capture a Lost World

https://www.newyorker.com/culture/the-art-world/august-sanders-enormous-attempt-to-capture-a-lost...
1•petethomas•5m ago•0 comments

ConverseJS 13.0.0 – Web-based XMPP/Jabber chat written in JavaScript

https://github.com/conversejs/converse.js/releases/tag/v13.0.0
1•neustradamus•7m ago•0 comments

An LLM on a Sony PSP

https://granda.org/en/2026/05/16/an-llm-on-a-sony-psp/
1•austinallegro•9m ago•0 comments

Igor Babuschkin Seeks Up to $1B for River AI

https://letsdatascience.com/news/igor-babuschkin-seeks-up-to-1-billion-for-river-ai-8c36ce09
1•gmays•9m ago•0 comments

NPM registry sets stage for more secure package publishing

https://www.theregister.com/ai-ml/2026/05/21/npm-registry-sets-stage-for-more-secure-package-publ...
1•Bender•11m ago•0 comments

Zillow loses listings in fight over "hidden" homes

https://arstechnica.com/tech-policy/2026/05/zillow-loses-access-to-thousands-of-home-listings-ami...
1•Bender•12m ago•0 comments

AT&T sues California in attempt to shut off old phone network

https://arstechnica.com/tech-policy/2026/05/att-sues-california-in-attempt-to-shut-off-old-phone-...
1•Bender•12m ago•0 comments

EPA to End Some Limits on 'Forever Chemicals' in Drinking Water

https://www.nytimes.com/2026/05/18/climate/epa-forever-chemicals-pfas-drinking-water.html
1•igonvalue•14m ago•0 comments

How to Call an API from an Email

https://redo.com/eng-blog/how-to-call-an-api-from-an-email/
3•joshmoody24•14m ago•0 comments

Finland's bomb shelters draw world to Helsinki in quest for security

https://www.reuters.com/world/europe/finlands-massive-bomb-shelters-draw-world-helsinki-quest-sec...
1•JumpCrisscross•19m ago•0 comments

Tesla Announces Rollout of Fully Self-Driving Tech in China

https://www.wsj.com/business/autos/tesla-announces-rollout-of-fully-self-driving-tech-in-china-27...
2•bookofjoe•19m ago•1 comments

Show HN: Lumox – Wirelessly mirror multiple iPhones on Mac – Ditching QuickTime

https://lumox.app/
1•modrena•19m ago•0 comments

Better CLI Interactions for Agents and Humans

https://www.pulumi.com/blog/better-cli-interactions-for-agents-and-humans/
2•cnunciato•19m ago•0 comments

GrapheneOS Power Usage Recommendations

https://discuss.grapheneos.org/d/35721-grapheneos-power-usage-recommendations
5•Cider9986•20m ago•0 comments

Creating a Full PII Framework for Agents

https://pii-firewall.com/
1•lamne•20m ago•0 comments

AI is killing the cheap smartphone

https://davidoks.blog/p/ai-is-killing-the-cheap-smartphone
3•d0ks•24m ago•0 comments

Shira: Anti Phishing Training Platform

https://shira.app/
2•carohadad•24m ago•1 comments

Spotify and Universal Music strike deal allowing fan-made AI covers and remixes

https://techcrunch.com/2026/05/21/spotify-and-universal-music-strike-deal-allowing-fan-made-ai-co...
1•cdrnsf•24m ago•0 comments

Show HN: A Turing machine simulating a Turing machine simulating a...

https://narcissus.exe.xyz/
1•thingoptimizer•29m ago•0 comments

A cross section of a road in England

https://old.reddit.com/r/interestingasfuck/comments/1tjxi3j/this_is_a_cross_section_of_a_road_in_...
1•n1b0m•29m ago•0 comments

Curtis Yarvin and the Political Evolution of Silicon Valley Reactionaries

https://www.dontbeasucker.blog/p/the-butterflies-in-your-stomach
22•betterthanever•30m ago•5 comments

The Typo Vibe Shift

https://www.theatlantic.com/culture/2026/05/typo-ai-trend-human/687237/
1•paulpauper•30m ago•0 comments