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.

OpenCode launches higher tier for Go Plan

https://twitter.com/opencode/status/2104548294718296064
1•dotmanish•19s ago•0 comments

Comparing exception behavior of magic statics, std:call_once, and std:async

https://devblogs.microsoft.com/oldnewthing/20260918-00/?p=112709/
1•ibobev•44s ago•0 comments

First DVD player announced Sept 26, 1996

https://dfarq.homeip.net/first-dvd-player-announced-sept-26-1996/
1•ibobev•57s ago•0 comments

Hijacking the PS5's RTMP Stream

https://yashgarg.dev/posts/hijacking-ps5-rtmp-stream/
1•ibobev•1m ago•0 comments

Rick Manelius on Forward Deployed Executives [video]

https://www.youtube.com/watch?v=QefuQEgVHOU
2•mooreds•1m ago•0 comments

Kids turned low-traffic NPR Spotify comments into a secret group chat

https://www.thisamericanlife.org/897/transcript
1•simonpure•1m ago•0 comments

I asked across LLMs what is the best email provider: Resend is cited most

https://openllmrank.io/blog/transactional-email-apis
1•zipvoila•1m ago•1 comments

What legal documents do startups need in the US?

https://stripe.com/resources/more/what-legal-documents-do-startups-need-in-the-us
1•Brysonbw•1m ago•0 comments

Gevva0 – a Jev like decision engine on Gemma 26B via direct logit scoring

https://github.com/solvingSteve/Gevva0
1•solvingSteve•2m ago•0 comments

Meta Poaches MongoDB CEO

https://www.mongodb.com/company/newsroom/press-releases/mongodb-announces-ceo-transition
1•theahura•3m ago•0 comments

Universal gates from braiding and fusing anyons on quantum hardware

https://pme.uchicago.edu/news-events/news/braided-exotic-particles-could-build-reliable-universal...
2•promptspheree•3m ago•0 comments

Ask HN: JEV for K1 Tax Forms

1•GoRudy•4m ago•0 comments

Updated Google Maps shows destruction of the city of Rafah

https://twitter.com/AliAbunimah/status/2103890594137309425
1•slowin•4m ago•0 comments

Investigating Jev's architecture and how to scale it

https://www.lowlevelml.com/blog/deciphering-jev
1•gowindone•4m ago•0 comments

Show HN: Agentic Engineered Social Connections and Travel App

https://www.viamour.app
2•jaidarukiya•5m ago•0 comments

Stop letting your agent's scripts die in /tmp

https://github.com/pfcoperez/scriptify
2•pfcoperez•6m ago•0 comments

What a sports medicine doctor wants patients to know about peptides

https://www.washingtonpost.com/wellness/2026/09/28/sports-medicine-doctor-heres-what-i-want-you-k...
2•brandonb•6m ago•0 comments

Concern mounts over slow-moving, planetary-scale Kelvin wave heading for Calif

https://www.theguardian.com/us-news/2026/sep/28/california-kelvin-wave
2•howard941•7m ago•0 comments

We Build a Digital World, Then Dream About a Garden

https://idlefy.medium.com/we-build-a-digital-world-then-dream-about-a-garden-62bdf6326afe
2•Idlefy_platform•7m ago•0 comments

How to Connect Your Drone or IP Camera Feeds to Red5

https://www.red5.net/blog/how-to-connect-drone-or-ip-camera-feeds-to-red5/
2•mondainx•7m ago•0 comments

Echoleak Beaten - almost

https://huggingface.co/ApolloRaines/Llama-3.1-8B-Instruct.immunized.v1
2•Apollo_R•8m ago•0 comments

Cf: The Agentic CLI for the Cloudflare API

https://blog.cloudflare.com/cloudflare-cf-cli-launch/
1•macleos•8m ago•0 comments

Macrocyclic peptides: a new third drug class?

https://www.empirical.health/blog/macrocyclic-peptides/
1•brandonb•8m ago•0 comments

The hottest new hangout for middle schoolers is NPR's comment section?

https://techcrunch.com/2026/09/25/the-hottest-new-hangout-for-middle-schoolers-is-nprs-comment-se...
1•mooreds•9m ago•0 comments

Dutch Police Arrest 'Reformed' Hacker in Shiny Hunters Investigation

https://krebsonsecurity.com/2026/09/dutch-police-arrest-reformed-hacker-in-shiny-hunters-investig...
1•CR1337•10m ago•0 comments

A case of Muse leaking personal information and keeping it for itself

https://simonwillison.net/2026/Sep/28/muse-ai-agent/
1•mseri•11m ago•0 comments

Kudu

https://pixabay.com/it/images/search/kudu/?pagi=2
1•ArthurFischerp•11m ago•0 comments

SpaceX's Starship Reaches Orbit for First Time in Major Test

https://www.bloomberg.com/news/articles/2026-09-28/spacex-to-stage-first-ever-starship-flight-to-...
3•mooreds•11m ago•0 comments

Show HN: Android-on-Device Harness – N8N Meets Tasker Meets AI

https://github.com/ankurCES/Mahout
1•ankurCES•12m ago•0 comments

Show HN: Short film made using MiniMax H3 on my home PC

https://chrisbeach.co.uk/space-adventure/
1•cbeach•12m ago•0 comments