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.

Most cited comments on Hacker News

https://www.orangecrumbs.com/most-cited-hn-comments
1•oyster143•30s ago•0 comments

Fieldwatch: Receive-Only Wi-Fi and Bluetooth LE Observer for Android. MIT

1•XzetaU8•2m ago•0 comments

Show HN: RepoGuard – Architecture linter for AI-generated code (Cursor, Claude)

https://github.com/taylormatematica-beep/repoguard
1•taylormatematic•2m ago•0 comments

Physarium Transport Network Visualization

https://github.com/samjsnn/Physarum-Transport-Network/
1•suopspaces•5m ago•0 comments

I know you run LLMs. Will it boot?

https://mondegreens.github.io/apron/blog/2026/10/02/i-know-you-run-models-will-it-boot/
1•vladryzhkov•7m ago•0 comments

Protect Your Friends and Loved Ones

https://ephemeral.cx/2026/07/protect-your-friends-and-loved-ones/
1•speckx•7m ago•0 comments

Emails to and from Elon Musk that have been made public

https://elonemails.com/
2•measurablefunc•8m ago•0 comments

Getting the most out of Opus 5.5 in Claude and Claude Code

https://claude.dev/blog/getting-the-most-out-of-opus-5-5/
1•saikatsg•10m ago•0 comments

Government of India officially removes bitchat from the App Store

https://twitter.com/jack/status/2106359514391871540
2•HotGarbage•10m ago•0 comments

A modern open-source Amiga CDFileSystem replacement

https://github.com/reinauer/ODFileSystem
1•doener•12m ago•0 comments

What Meta Got Right with Muse

https://metedata.substack.com/p/what-meta-got-right-with-muse
2•young_mete•15m ago•0 comments

Show HN: Claude Code Routine Session Cleanup Skill

https://github.com/naw103/claude-routine-cleanup
1•naw103•19m ago•0 comments

Show HN: Revline – an AI web app that researches TikTok and Instagram for you

https://tryrevline.com/
1•ZuraMakaradzeHe•19m ago•0 comments

Show HN: Audio Merger – Merge audio files in your browser, no upload

https://audiomerger.org/
1•liweipt•20m ago•0 comments

Delta WiFi Survival Guide

https://dialta.adorellc.pro/
5•husky8•21m ago•3 comments

Spherical Snake

https://slitherworld.com/
1•nickandbro•21m ago•0 comments

Ordering Items for the Orderly

https://vjay15.github.io/blog/ordering/
1•vjay15•23m ago•1 comments

An artistic journey between Cairo and Amsterdam

https://aatonau.com/moussa-salman-an-artistic-journey-between-cairo-and-amsterdam/
2•yunessalman•25m ago•0 comments

Show HN: Made a Taboo-style game where Jev tries to guess your word

https://yorohan.com/clue-me
1•rohanm93•27m ago•1 comments

FerrumPix: Bringing photo management, RAW editing and image editing on Linux

https://linuxcommunity.io/t/ferrumpix-bringing-photo-management-raw-editing-and-image-editing-tog...
1•ashitlerferad•28m ago•0 comments

So, Gutenberg Didn't Invent Printing as We Know It

https://lithub.com/so-gutenberg-didnt-actually-invent-the-printing-press/
1•axiologist•29m ago•0 comments

ADHD, autism or complex trauma? [pdf]

https://www.cambridge.org/core/services/aop-cambridge-core/content/view/30CC4826561366615BFAEC807...
30•skeptical1884•31m ago•0 comments

Georgia holds emergency meeting on AI exposing voters' secret ballots

https://www.theguardian.com/us-news/2026/oct/02/midterms-ai-ballot-privacy
3•sbulaev•32m ago•2 comments

Hole Punch: Sling your spaceship around gravitational fields

https://notoriousbfg.com/hole-punch/
7•trwhite•32m ago•0 comments

Boy with cerebral palsy passes GCSEs with eye-tracking technology

https://www.theguardian.com/education/2026/oct/02/patrick-mccabe-success-cheshire-reveals-limits-...
1•bookofjoe•34m ago•0 comments

Reading in Hindsight: The Feeling of Power by Isaac Asimov

https://multijimbo.com/2026/05/13/reading-in-hindsight-the-feeling-of-power-by-isaac-asimov/
1•bearseascape•34m ago•0 comments

Why the Next Urban Vision Is a 2030s Story

https://conorsen.substack.com/p/why-the-next-urban-vision-is-a-2030s
1•mooreds•35m ago•0 comments

DarkBASIC Online by Rick Vanner

https://darkbasiconline.com/
2•klaussilveira•36m ago•0 comments

P=NP Proof

https://lebaux.github.io/animation.html
2•lebaux•38m ago•3 comments

Treachery in the Rodin Museum 3D Scan Verdict

https://cosmowenman.substack.com/p/rodin-museum-3d-scan-verdict
1•CosmoWenman•38m ago•0 comments