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 Rocket Crashes into Moon

https://apnews.com/article/spacex-rocket-moon-crash-elon-musk-d64a98138fd19241700461c87b49e201
1•jumploops•8s ago•0 comments

Repurpose Your VR Content for Any Screen by Converting to Standard Video

https://news.qencode.com/posts/repurpose-your-vr-content-for-any-screen-by-converting-to-standard...
1•QencodeCorp•16s ago•0 comments

Modelregistry: Decentralizing distribution of open-source AI models

https://github.com/marella/modelregistry
1•simonpure•1m ago•0 comments

BasicSync and Synctrain: solid apps for bringing Syncthing to phones

https://manualdousuario.net/en/basicsync-android-synctrain-ios-syncthing-apps/
1•rpgbr•1m ago•0 comments

Impact Drones: Air Defense as a Service for Civilian Infrastructure

https://www.ycombinator.com/launches/SKo-impact-drones-air-defense-as-a-service-for-civilian-infr...
1•atlasunshrugged•2m ago•0 comments

Decimen Optical Transfer: fountain-coded QR file transfer

https://github.com/bashalarmistalt/decimen-optical-transfer/
1•rzk•4m ago•0 comments

No One Can Afford to Make Myst Games Anymore

https://www.wired.com/story/no-one-can-afford-to-make-myst-games-anymore/
1•littlexsparkee•6m ago•0 comments

El Nino Live

https://www.elninolive.com
2•Noaidi•12m ago•1 comments

Voice mode for Claude Code. Claude Code now answers you like a real person

https://heyski.io/
3•pattern-ai•12m ago•0 comments

Extinct toad from the Ice Age discovered at Los Angeles' La Brea Tar Pits

https://www.cnn.com/2026/08/05/science/ice-age-toad-la-brea-pits
2•1659447091•13m ago•0 comments

DuckDuckGo launches glasses and promises they're private

https://manualdousuario.net/en/duckduckgo-oculos-de-sol-normais/
2•rpgbr•13m ago•0 comments

The New DeepSeek Moment

https://cuecloud.substack.com/p/the-new-deepseek-moment-and-what
1•krav-sales•13m ago•0 comments

The Hidden Tax of Memory in Model Inference

https://cuecloud.substack.com/p/the-hidden-tax-of-memory-in-model
2•krav-sales•15m ago•0 comments

Literary Sins

https://www.thedial.world/articles/news/seven-literary-sins
1•lermontov•15m ago•0 comments

Free book (software development in the AI era)

https://books.kodel.com.br/pt-br/livros/software-development-ia-era/
1•JCKodel•19m ago•0 comments

Django 6.1 Released

https://docs.djangoproject.com/en/6.1/releases/6.1/
3•tony•19m ago•0 comments

AI Agents for Healthcare?

https://www.youtube.com/watch?v=XVgedf0TzYc
1•karissafho•23m ago•0 comments

Wikipedia Turned on Its Volunteers. Now It's Coming for Its Workers

https://www.quippd.com/writing/2026/08/04/wikipedia-turned-on-its-volunteers-now-its-coming-for-i...
2•cdrnsf•26m ago•0 comments

Your phone is the most intricate machine you've ever held. Let's take it apart.

https://everythingmachine.io/phone/
1•bookofjoe•26m ago•0 comments

Saudi wealth fund and Jared Kushner's Affinity finalize $55B EA Sports deal

https://www.cnbc.com/2026/08/05/saudi-wealth-fund-jared-kushner-ea-sports-deal.html
2•debo_•27m ago•0 comments

Show HN: Emporia Research

https://www.emporiaresearch.com/
1•not_wowinter14•28m ago•0 comments

STMicroelectronics profit misses estimates, shares fall 14%

https://www.reuters.com/technology/stmicros-q3-revenue-view-slightly-lags-estimates-even-chip-dem...
1•measurablefunc•29m ago•0 comments

Physicist Rigged His Pet Hamster's Wheel to Strava. It Runs Far Every Night

https://www.runnersworld.com/news/a73355106/hamster-wheel-strava-running/
3•aanet•31m ago•1 comments

Balanced polymorphism underlies the rhythm of daily sex alternation in avocado

https://www.pnas.org/doi/10.1073/pnas.2606876123#executive-summary-abstract
1•impish9208•33m ago•0 comments

A Vision for Cargo

https://epage.github.io/blog/2026/08/cargo-vision/
1•shalupov•34m ago•0 comments

L.A. County Fire Department – Eaton Fire Investigation Report

https://www.documentcloud.org/documents/28535082-la-county-fire-department-eaton-fire-investigati...
1•hotchip•36m ago•0 comments

Slime Without Plugins Using Kitty

https://lee-phillips.org/kittyslime/
1•leephillips•39m ago•0 comments

A Gallery of Installing from .dmg

https://unsung.aresluna.org/as-a-windows-user-its-a-very-surreal-way-to-install-a-program/
2•colinprince•42m ago•0 comments

Alexa+ Is a Buggy Embarrassment

https://pogueman.substack.com/p/alexa-is-a-buggy-embarrassment
1•colinprince•42m ago•0 comments

At-Communities #1: The Concierge, the Vault, and the Fuck-Ass Astro Website

https://www.essentialrandomness.com/posts/the-concierge-and-the-vault
1•erlend_sh•44m ago•0 comments