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.

GitHub has another tough day

https://surfingcomplexity.blog/2026/08/13/github-has-another-tough-day/
1•azhenley•3m ago•0 comments

Do Apple's green text bubbles have an accessibility problem?

https://colorschemer.com/color-theory-course/utilizing-wcag-to-improve-text-readability-and-contrast
2•maxsavin•6m ago•0 comments

A Walkable ASCII Cyberpunk City in One HTML File [video]

https://www.youtube.com/watch?v=3YtygAx_C6A
1•reader9274•7m ago•0 comments

German Tank Problem

https://en.wikipedia.org/wiki/German_tank_problem
1•jxmorris12•7m ago•0 comments

Show HN: Control Claude Code, Codex, Pi and Gemini CLI from Telegram

https://github.com/choiyounggi/cliclaw
2•dch0202•12m ago•0 comments

A digestion of the proof of Sendov's conjecture

https://terrytao.wordpress.com/2026/08/12/a-digestion-of-the-proof-of-sendovs-conjecture/
1•surprisetalk•16m ago•0 comments

An Infinite Waltz – A Must Read (Docu-Video Audio/ Visual Adaptation Included)

https://iamwisdom.substack.com/p/an-infinite-waltz-the-dance-beyond
1•I_Am_Wisdom•21m ago•0 comments

The great silence: why haven't we found any aliens yet?

https://www.theguardian.com/news/2026/aug/11/the-great-silence-why-havent-we-found-any-aliens-yet
1•thm•21m ago•0 comments

Show HN: VeerHost – $1/month web hosting, limited spots

https://veerhost.com/1-dollar-web-hosting/
5•betterornotss•23m ago•0 comments

Phoebe Gates' startup Phia faces cookie stuffing allegations

https://www.bloomberg.com/news/articles/2026-08-11/phia-app-co-founders-pushed-for-features-takin...
2•saeranv•24m ago•0 comments

Show HN: Journal, Interstitial Journaling

https://journal.lasagna.pizza/
1•kinduff•26m ago•0 comments

Show HN: Lexicon AI – Exam-focused vocabulary journal for SAT and IELTS prep

https://lexicon-ai-journal.vercel.app/
1•wayne_14e•27m ago•0 comments

How to Look the Sky in the Face

https://www.raptitude.com/2026/08/how-to-look-the-sky-in-the-face/
1•inatreecrown2•28m ago•0 comments

Trump order lets US firms hack overseas groups under certain conditions

https://www.cnn.com/2026/08/13/politics/cyber-privateers-trump-order-overseas-groups-hacking
5•freditup•31m ago•0 comments

Apple trains its own AI model for China market with Alibaba's support

https://www.reuters.com/business/retail-consumer/apple-trains-its-own-ai-model-china-market-with-...
4•petethomas•32m ago•0 comments

RegExp /V in JavaScript: Sets, Intersections, and Unicode

https://www.jstools.space/blog/regexp-in-javascript/
1•javatuts•33m ago•0 comments

Trump's Gift to the Money Launderers

https://www.thebulwark.com/p/trumps-gift-to-the-money-launderers-database-treasury
3•computerliker•33m ago•0 comments

FieldRobin – AI-native field service software for small service businesses

https://fieldrobin.com
1•pdgrg•35m ago•0 comments

Counterstrike 1969 TV Series

https://archive.org/details/counterstrike-1969-tv-series
2•petethomas•41m ago•0 comments

Trump orders aircraft carrier redesign to use steam catapults to launch jets

https://www.theguardian.com/us-news/2026/aug/13/trump-aircraft-carriers-steam-catapults
6•decimalenough•41m ago•0 comments

Users of psychedelics narratively turn bad trips into valuable experiences

https://www.sciencedirect.com/science/article/pii/S0955395920303352#bib0056
4•MrJagil•44m ago•0 comments

The Making of Cursor's Icons

https://www.minoradventures.co/blog/the-making-of-cursors-icons
1•duck•45m ago•0 comments

Definium says LSD-based pill reduces anxiety in late-stage study

https://www.reuters.com/business/healthcare-pharmaceuticals/definium-says-lsd-based-pill-reduces-...
3•oliverulerich•46m ago•0 comments

Cicada.os, Graphene.os for Your Laptop

https://kpres12.github.io/Cicada.OS/
1•kpres62•51m ago•1 comments

How Claude's watermarking (probably) works

https://johnjwang.com/post/2026/08/12/how-claude-watermarking-probably-works/
2•882542F3884314B•55m ago•0 comments

Infodump about Monkey Island

https://pants.fishing
2•dmarinus•56m ago•0 comments

User reports show problems with LinkedIn

https://downdetector.com.au/status/linkedin/
1•hahahaa•57m ago•0 comments

Border blaster

https://en.wikipedia.org/wiki/Border_blaster
9•petethomas•1h ago•0 comments

Programing language faster than Python for ML (Jaithon 3.1)

https://github.com/abhiramasonny/jaithon
1•AbhiramaVS•1h ago•2 comments

Elon Musk is suing California over an AI law. Here's why transparency matters

https://www.sfchronicle.com/opinion/openforum/article/ai-data-law-california-22382698.php
5•newsomix9xl•1h ago•0 comments