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.

New Tesla Roadster floats and 0-60 in <1s

https://www.theverge.com/transportation/1012552/tesla-roadster-next-gen-reveal-elon-musk
1•skadamat•14s ago•0 comments

Artificial intelligence is capitalism's final destination

https://www.equator.org/articles/arundhati-roy-artificial-intelligence
1•tirumaraiselvan•28s ago•1 comments

Upcoming change to Bitbucket SSH access: from bitbucket.org to ssh.bitbucket.org

https://community.atlassian.com/forums/discussion/3234032/upcoming-change-to-bitbucket-cloud-ssh-...
1•w3ll_w3ll_w3ll•1m ago•0 comments

Eh – Edit Here – vi(1) a minimalist version of vi(1) with zero configuration

https://codeberg.org/SirWumpus/eh
1•speckx•1m ago•0 comments

Abolish the Public Suffix List

https://circleid.com/posts/abolish-the-public-suffix-list
1•woodenspoongang•2m ago•0 comments

AeroSandbox: Design and optimize aircraft through automatic differentiation

https://github.com/peterdsharpe/AeroSandbox
1•Luc•3m ago•0 comments

Reuters: White House ordered restrictions on Starlink Ukraine

https://www.reuters.com/world/europe/order-limit-starshield-ukraine-came-inside-white-house-sourc...
1•KellyCriterion•3m ago•0 comments

White House Ordered Starshield Restrictions, Disrupting Ukrainian Drone Defense

https://www.kyivpost.com/post/87219
2•vrganj•4m ago•0 comments

The AI Bill Is the Cheap Part

https://avivbenyosef.com/the-ai-bill-is-the-cheap-part/
1•mooreds•4m ago•0 comments

Will the AI Boom End Like the Railroad Crash of 1873? [video]

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

Imaging with Zero Photons

https://physics.aps.org/articles/v19/s127
1•Luc•8m ago•0 comments

EU Chat Control Reports Processed with Palantir Software

https://reclaimthenet.org/eu-chat-control-reports-palantir-software
2•nickslaughter02•10m ago•0 comments

Mont Blanc, the 'roof of Europe', loses more than a metre of height in a year

https://www.theguardian.com/environment/2026/oct/14/mont-blanc-loses-metre-height
1•bookofjoe•11m ago•0 comments

Google models no longer Zero Data Retention on Openrouter

https://openrouter.ai/sign-in?redirect_url=https%3A%2F%2Fopenrouter.ai%2Fsettings%2Fprivacy
2•paweladamczuk•12m ago•2 comments

Let's Fix Temperature

https://owl.billpg.com/lets-fix-temperature/
2•billpg•13m ago•0 comments

Show HN: Deterministic AI Agents Guardrail

https://github.com/aws-safebox/aws-safebox
1•fb-dev•15m ago•0 comments

Show HN: PTrace – An iPhone Running Tracker with MCP

https://apps.apple.com/us/app/ptrace-run-tracker/id6785292238
2•slaskis•21m ago•1 comments

Matt Mullenweg Orders Accessibility Revert

https://www.therepository.email/matt-mullenweg-orders-accessibility-revert-tells-core-committer-t...
1•robin_reala•21m ago•0 comments

Open Source Drone Simulator

https://github.com/vishwagw/Sky-Sim-drone-simulator-3.0
2•vishwagw98•22m ago•0 comments

Blue Origin is going all in on the New Glenn rocket

https://arstechnica.com/space/2026/10/blue-origin-is-going-all-in-on-the-new-glenn-rocket/
2•rbanffy•23m ago•0 comments

Rosemont Residency Master Plan – Project Layout and Details

1•cemaljustime•24m ago•0 comments

UK Police Arrest 15-Year-Old over Posts Mocking Politician

https://reclaimthenet.org/uk-police-arrest-teenager-over-councillor-mocking-posts
4•nickslaughter02•25m ago•0 comments

State of agentic coding #11: the curiosity test, Lisp, and labs that can't fail

https://ghuntley.com/toronto/
2•ghuntley•26m ago•0 comments

Sunsetting Decomp.dev

https://decomp.dev/
1•wicket•27m ago•0 comments

The code was never the hard part

https://neverthehardpart.com/
1•oskarglauser•29m ago•0 comments

Building AGI Using Language Models (2020)

https://bmk.sh/2020/08/17/Building-AGI-Using-Language-Models/
2•rzk•31m ago•0 comments

Ask HN: A platform where anyone can earn money by advertising any product

2•reader_reads•34m ago•0 comments

Show HN: AlphaDocs – Offline document editor with LAN collaboration

https://github.com/AlphaWorkroom/AlphaDocs
1•AlphaWorkroom•36m ago•0 comments

Show HN: Flashpapers – Interactive explainers for AI papers

https://flashpapers.ai/
1•intertwiner•38m ago•0 comments

Build or Surrender

https://twitter.com/arthurmensch/status/2110990492930314712
1•tosh•38m ago•0 comments