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.

Ben Evans AI Questions

https://www.ben-evans.com/presentations
1•xmpir•3m ago•0 comments

Today, Voyager 1 Becomes the First Spacecraft a Full Light-Day from Home

https://www.cnet.com/science/space/voyager-1-passes-one-light-day/
1•pseudolus•3m ago•0 comments

Struggling to understand why AI would harm humans? This explains it perfectly

https://the-case-for-ai-safety.vercel.app
1•isaacbitran•4m ago•0 comments

What's New in Alfred 6?

https://www.alfredapp.com/whats-new/
1•Blazing•4m ago•0 comments

AI use is up 330×. The bill is up 115×

https://www.modelcompare.ai/blog/ai-tokens-vs-spending
1•gitowiec•4m ago•0 comments

Show HN: Eventkiwi – Scheduled reports for your app's events

https://eventkiwi.com/
1•Ddel•5m ago•0 comments

Just Because You Can, Doesn't Mean You Should: Re-Evaluating Galera Node Weights

https://www.percona.com/blog/just-because-you-can-doesnt-mean-you-should-re-evaluating-galera-nod...
2•Sigmazero60•6m ago•0 comments

The Boring Company and the Future Underground

https://twitter.com/DavidGeorge83/status/2122715101300158735
1•rmason•7m ago•0 comments

Accountability Sinks (2025)

https://www.250bpm.com/p/accountability-sinks
2•elinear•8m ago•0 comments

Show HN: Robotics needs better CAD, so I wrote a B-rep kernel and 3,487 tests

https://springcraft-ai.github.io/springrep/
2•atomarch•8m ago•0 comments

DIY in-car navigation and reverse camera

https://yaky.dev/2026-11-11-chevy-volt-carputer/
2•speckx•9m ago•0 comments

OpenAleph securely store large amounts of data and make it searchable

https://darc.li/openaleph/
2•Bluestein•12m ago•0 comments

The internet is held together with shoestring and bubblegum

https://www.cnn.com/2026/11/18/tech/whats-causing-outages
2•Philadelphia•12m ago•0 comments

Gemini 4 Neon

https://aistudio.google.com/docs/models/gemini-4-neon
8•urda•16m ago•0 comments

What's new in Gemini 4 Neon

https://aistudio.google.com/docs/whats-new-gemini-4-neon
4•sync•16m ago•0 comments

Token Budgets

https://major.io/p/on-token-budgets/
1•speckx•19m ago•0 comments

Show HN: Fazor – offline electrical calculators for Android (IEC and NEC)

https://kalkansoftware.com/fazor/
1•sabahattink•21m ago•0 comments

Ask HN: Anyone Used ClickAway in Bay Area?

1•HoldOnAMinute•21m ago•0 comments

Apache Shiro security framework releases 3.0.2

https://shiro.apache.org/blog/2026/11/apache-shiro-302-released.html
2•lprimak•21m ago•1 comments

Fardesk – fast iPhone app to manage your Claude sessions

https://fardesk.franzai.com/
1•franze•21m ago•0 comments

Airmash – Multiplayer Missile Warfare HTML5 Game

https://airma.sh/
2•mashedmashity•21m ago•0 comments

Daily Mail, New Scientist Daily Mail join publishers taking on AI news scrapers

https://pressgazette.co.uk/news/daily-mail-joins-coalition-of-publishers-taking-on-ai-news-scrapers/
2•ilamont•24m ago•0 comments

The Codebase Is the Harness

https://jonathannen.com/codebase-is-the-harness/
1•jwilliams•24m ago•0 comments

Daily HN Podcast

https://github.com/denolfe/hacker-news-highlights
1•sadrasabouri•24m ago•0 comments

GTA VI like Claude Desktop theme

https://github.com/komodin/claude-neon-coast-theme
1•komodin•25m ago•0 comments

Ask HN: Is Claude Down?

2•testrun•25m ago•1 comments

Will your MongoDB upgrade break? Check it with UCFM

https://www.percona.com/blog/will-your-mongodb-upgrade-break-check-it-with-ucfm/
4•millspore•26m ago•0 comments

Show HN: Indexing Doctor – free checker for why Google isn't indexing a page

https://indexingdoctor.com/
2•alescalaios•28m ago•0 comments

Claude solves two open problems in the physics of black holes

https://www.anthropic.com/research/claude-black-hole-physics
3•Handy-Man•31m ago•0 comments

Yes, Gemini Carbon is that slow

https://micjm.com/blog/carbon-is-that-slow/
2•seizethecheese•32m ago•0 comments