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.

Exploring Thurston geometries

https://www.3-dimensional.space/
1•marysminefnuf•1m ago•0 comments

Closing the Sea: Lessons from Ancient Mediterranean Blockades

https://maritime-executive.com/editorials/closing-the-sea-lessons-from-ancient-mediterranean-bloc...
1•gumby•3m ago•0 comments

An Invisible Spirit

https://animationobsessive.substack.com/p/an-invisible-spirit
1•vinhnx•5m ago•0 comments

Trace the footsteps of England's most famous accused witches

https://www.bbc.com/travel/article/20261023-the-haunting-landscapes-of-englands-accused-witches
1•1659447091•10m ago•0 comments

Can a good philsophical contribution be made just by asking a question? (2022)

https://philpapers.org/rec/HABCAG
1•schoen•14m ago•0 comments

The Tesla-SpaceX merger explained

https://finshots.in/archive/tesla-spacex-merger-explained/
2•vismit2000•16m ago•0 comments

Show HN: Proc-CLI – An agent-friendly CLI tool for process and port management

https://proc-cli.com/
2•yazeedaloyoun•17m ago•0 comments

Minecraft: Java Edition 26.3 rewritten from scratch in Rust

https://github.com/ludovic111/horizon
1•privacyishuman•18m ago•0 comments

Cognitive Mercantilism: AI panic resembles fears of early capitalism

https://contraptions.venkateshrao.com/p/cognitive-mercantilism
1•ianand•20m ago•0 comments

Show HN: How religions evolved? Charts, Maps, Citations

https://howitevolved.com/chart/
1•silly073•23m ago•0 comments

Domain UserMemory.com now available on Spaceship

https://usermemory.com
1•dev1one1•24m ago•0 comments

Sharp Tools

https://bojidar-bg.dev/blog/2025-05-28-sharp-tools/
1•Curiositry•24m ago•0 comments

The "canal" in the Amazon that breaks the rules

https://signoregalilei.com/2026/10/25/the-canal-in-the-amazon-that-breaks-the-rules/
1•notfried•25m ago•0 comments

Rest of World faces prospect of shutting down

https://www.semafor.com/article/10/25/2026/rest-of-world-faces-prospect-of-shutting-down
2•colinprince•27m ago•1 comments

How hospitals used inspiration from F1 for surgery-to-ICU handovers

https://www.bbc.com/sport/formula1/articles/c6ly0q00gj5do
1•1659447091•30m ago•0 comments

Amundsen's Maxim

https://www.amundsens-maxim.com/
1•fagnerbrack•30m ago•0 comments

Roman Love

https://www.worksinprogress.news/p/roman-love
1•diodorus•32m ago•0 comments

Show HN: UIPalooza – Do AI models have a recognizable design taste?

https://uipalooza.ai/
4•joeysim•32m ago•0 comments

You Can't Change Your Boss

https://jacobian.org/2026/oct/12/you-cant-change-your-boss/
3•aray07•33m ago•1 comments

Waving Hands (1977), vibe-coded

https://hands.kestrelsnest.social/
1•quuxplusone•35m ago•0 comments

Ask HN: How do drone companies conduct tests internally?

1•vivek_sg•35m ago•0 comments

A Printer Prints onto Paper

https://twitter.com/macrofying/status/2114502527530172602
1•smusamashah•40m ago•0 comments

US Wages Share of GDI at 75 Year Low

https://fred.stlouisfed.org/series/W270RE1A156NBEA
4•omgwtfbyobbq•41m ago•1 comments

Show HN: AI Client Lead Qualifier and Review Responder for Agencies

1•TheGhaziVision•43m ago•0 comments

Show HN: AI Client Lead Qualifier and Review Responder for Agencies

1•TheGhaziVision•43m ago•0 comments

Open-source crypto trading terminal in Rust and WebAssembly

1•rsalianto•49m ago•0 comments

Netflix Users Are Watching Less, Not Opening the App as Often

https://www.bloomberg.com/news/articles/2026-10-25/netflix-users-are-watching-less-not-opening-th...
3•jmsflknr•53m ago•1 comments

Behind the scenes at the NeXT Computer office

https://exhibits.stanford.edu/menuez/browse/next-computer-inc?per_page=96&sort=pub_year_isi+asc%2...
13•Austin_Conlon•1h ago•4 comments

Has Opus 5.5 gotten dumber for anyone else in the last few days?

3•geuis•1h ago•2 comments

Show HN: Nodecode, open-source living agent in Lisp that rewrites itself for you

https://github.com/nodecode-ai/nodecode
2•svsairevanth•1h ago•0 comments