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.

Bedtime Procrastination

https://en.wikipedia.org/wiki/Bedtime_procrastination
1•sand33pn•1m ago•0 comments

Deep Learning Overview

https://github.com/andrewt3000/machinelearning
1•andrewtbham•1m ago•1 comments

Making Weapons-Grade Plutonium at home [video]

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

Meditations on Moloch (2014)

https://www.slatestarcodexabridged.com/Meditations-On-Moloch
1•simonebrunozzi•3m ago•0 comments

First human trials of designer protein therapies stun US neuroscientists

https://cen.acs.org/biological-chemistry/biotechnology/human-trial-chemogenetic-brain-therapy/104...
2•gradus_ad•10m ago•0 comments

MTV Cribs: SF Startup (Parody) – Programmers are also human [video]

https://www.youtube.com/watch?v=x0Cr-UhKhZI
1•Gecko4072•12m ago•0 comments

Tess's Android Wayland Compositor

https://github.com/wmww/tawc
2•schmorptron•12m ago•0 comments

The flock uprising is just the beginning

https://www.msn.com/en-us/news/technology/the-flock-uprising-is-just-the-beginning/ar-AA2a5NbB
3•pilingual•13m ago•0 comments

The Output Style, It Does Nothing – Learning to Live with Claude

https://www.atomic14.com/2026/08/15/output-style-does-nothing
1•iamflimflam1•16m ago•0 comments

DHS demands AAMVA's national commercial driver database

https://papersplease.org/wp/2026/08/14/dhs-demands-aamvas-national-commercial-driver-database/
5•iamnothere•17m ago•0 comments

Show HN: sce (Simple Console Editor)

https://github.com/volution/simple-console-editor
1•ciprian_craciun•19m ago•0 comments

The Three AI Pills

https://thezvi.substack.com/p/the-three-ai-pills
3•stuartmemo•22m ago•0 comments

Planes With Same Call Sign at PHX – one departing, one arriving

https://www.nytimes.com/2026/08/15/us/american-airlines-call-signs-phoenix.html
1•jsrozner•24m ago•1 comments

The Mysterious Art of Conducting

https://www.theatlantic.com/magazine/2026/09/orchestra-conductor-profession/687962/
3•anarbadalov•24m ago•0 comments

Which monotheistic religions preceded Yahweh's religion?

https://ciron.medium.com/which-monotheistic-religions-preceded-that-of-yahweh-3218c780553f
1•raynchad•25m ago•2 comments

Tupoi: An attention-free LLM with strictly O(1) memory and 6 KB state

https://github.com/narelabs/TUPOI
1•IntellegenceIsP•25m ago•0 comments

Four Levels of In-Place Initialization (Rust)

https://blog.yoshuawuyts.com/four-levels-of-in-place-initialization/
1•dabinat•27m ago•0 comments

Alibaba AI Models Hit 3B Downloads, Passing Meta, Google

https://www.bloomberg.com/news/articles/2026-08-15/alibaba-ai-models-hit-3-billion-downloads-pass...
3•pluc•31m ago•1 comments

AI Isn't Outthinking Mathematicians. It's Out-Remembering Them

https://davidepiffer.com/p/ai-isnt-outthinking-mathematicians
64•rzk•34m ago•49 comments

React for Agents: Astro Creator Brings Hooks to Flue

https://www.latent.space/p/flue-2
1•flyaway123•35m ago•0 comments

Thunderbird's Desktop Calendar Visual Redesign

https://blog.thunderbird.net/2026/08/desktop-calendar-a-design-journey/
4•birdculture•37m ago•0 comments

AI detectors are creating a new era of distrust

https://www.theverge.com/column/976690/ai-writing-detectors-suspicion
3•saikatsg•39m ago•0 comments

Peer-reviewed study of 443,000 Backblaze drives ranks HGST most reliable

https://www.tomshardware.com/pc-components/hdds/peer-reviewed-study-of-443000-backblaze-drivers-r...
4•sbulaev•40m ago•1 comments

Fossilisation processes and our reading of animal antiquity

https://www.cell.com/trends/ecology-evolution/fulltext/S0169-5347(23)00137-4
2•joebig•40m ago•0 comments

Whiteboard lesson walking through postgres architecture basics. Part 1 [video]

https://www.youtube.com/watch?v=q9jixKv4h2I
2•adletbalzhanov•42m ago•2 comments

Notes on building products people love when software gets cheap

https://twitter.com/hnshah/status/2088663964116983856
2•tosh•44m ago•0 comments

Show HN: Jovethra – prepaid OpenAI-compatible API with hard usage limits

https://jovethra.xyz/playground
1•Belius•45m ago•0 comments

YouTube Dumps Cache Between Ads, Quality Toggling and Wastes Cellular Bandwidth

https://inavoyage.blogspot.com/2026/08/youtube-dumps-cache-between-ads-quality.html
2•initramfs•47m ago•1 comments

Ask HN: What non-technical skill boosted your engineering career the most?

1•pranav_tech26•49m ago•4 comments

Coming Soon to Shattered: The Vault Quest

https://shatteredpixel.com/blog/coming-soon-to-shattered-the-vault-quest.html
1•robin_reala•49m ago•0 comments