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.

SpaceX handed lowest possible ESG rating by MSCI

https://www.ft.com/content/a0dd4ea7-ef3d-4460-a96c-8c6975a053e3
1•mkl95•2m ago•0 comments

CIDR Report

https://www.cidr-report.org/
1•1vuio0pswjnm7•3m ago•0 comments

My recurse center return statement

https://www.lowimpactfruit.com/p/my-return-statement
1•mnky9800n•3m ago•0 comments

Norrin – Git/ diff control in Claude Code

1•gagewoodard•3m ago•1 comments

Gsocket Alternative, Hgsocket

https://hgsocket.com/
1•hgsocket•4m ago•0 comments

Ask HN: What's your go-to queue system?

1•absoluteunit1•4m ago•1 comments

Scion: A next-generation inter-domain routing architecture

https://docs.scion.org/en/latest/index.html
1•dgellow•4m ago•0 comments

Don't rely on instructions; use Agent Hooks to enforce guardrails

https://bitbytebit.substack.com/p/agent-hooks-deterministic-guardrails
1•recroad•7m ago•0 comments

Show HN: A C++ ALNS routing engine for LEO satellite mesh networks [video]

https://www.youtube.com/watch?v=6xXRh7PC7nI
1•ADARSHLILHARE•10m ago•1 comments

A Star's Death Throes Involves a Lot of Kicking

https://www.caltech.edu/about/news/a-stars-death-throes-involves-a-lot-of-kicking
1•gmays•13m ago•0 comments

Performance Improvements in Libffi

https://atgreen.github.io/repl-yell/posts/libffi-plan-cache/
2•atgreen•19m ago•0 comments

Town Square, the community deserves connection

https://cauenapier.com/blog/town-square-the-community-deserves-connection/
1•birdculture•20m ago•0 comments

Defending bot-detection code that runs on the attacker's own machine

https://trustsig.eu/blog/reverse-once-run-forever/
2•TrustSig•23m ago•0 comments

Is Trump-Netanyahu Rift on the Cards?

https://trump-netanyahu-rift.pagey.site/
1•freakynit•23m ago•0 comments

Crawling BitTorrent DHTs for Fun and Profit [pdf]

https://www.usenix.org/legacy/event/woot10/tech/full_papers/Wolchok.pdf
1•dgellow•24m ago•0 comments

Daily_stock_analysis: LLM-powered multi-market stock analysis system

https://github.com/ZhuLinsen/daily_stock_analysis
4•vantareed•27m ago•0 comments

Who Owns Your ATProto Identity? Hint: It's Probably Not You

https://kevinak.se/blog/who-actually-owns-your-atproto-identity-hint-its-probably-not-you
12•kevinak•28m ago•2 comments

Show HN: lpviz – Interactive linear programming visualization in the browser

https://lpviz.net/
5•klamike•28m ago•0 comments

8086 Segmented Memory was a good idea

https://owl.billpg.com/8086-segmented-memory-was-a-good-idea-almost/
3•billpg•30m ago•1 comments

Experiments in Sports Seismology for the World Cup

https://pnsn.org/blog/experiments-in-sports-seismology-for-the-world-cup
2•jmward01•30m ago•0 comments

Refloow Photo Studio – A local, offline photo editor with on-device AI

https://github.com/Refloow/Refloow-Photo-Studio
1•refloow•32m ago•0 comments

Ask HN: Part time developer reality check

1•tim_loaf-father•33m ago•0 comments

The New Cloud in the Stochastic CPU Era

https://twitter.com/yossieliaz/status/2068693960814424362
1•zozo-king•34m ago•0 comments

Kansas City's push for facial recognition on public buses sparks privacy debate

https://apnews.com/article/kansas-city-facial-recognition-ai-cameras-privacy-87847f57c94b6c2a9e22...
3•smurda•34m ago•0 comments

Online haters in the low-budget literary biz

https://statmodeling.stat.columbia.edu/2026/06/21/online-haters-in-the-low-budget-literary-biz/
1•Tomte•37m ago•0 comments

Prompt Caching: Just do it

https://kreidemann.com/blog/prompt-caching
2•kreidema•39m ago•1 comments

I'm done with LLM-through-chat-experience

https://www.thoughtfultechnologist.com/p/im-done-with-llm-through-chat-experience
2•nisabek•42m ago•0 comments

The Role of Carbon Capture and Storage in Decarbonizing U.S. Data Centers

https://pubs.acs.org/doi/10.1021/acs.energyfuels.6c01309
2•giuliomagnifico•42m ago•0 comments

AI Under Trump's Control: Can France Still Avoid Digital Dependence?

https://thenewassociationwebmasters.blogspot.com/2026/06/ai-under-american-control-can-france.html
14•laurentlof•45m ago•4 comments

Show HN: Stock analysis tool with quality scores and fundamental charting

https://intrinsiqq.com
2•FlippieFinance•48m ago•0 comments