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.

Creating Teensy ELF Executables for Linux (Or, "Size Is Everything")

https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
1•Bluestein•33s ago•0 comments

AI chatbots are becoming experts at changing people's minds. What's their edge?

https://www.science.org/content/article/ai-chatbots-are-becoming-experts-changing-people-s-minds-...
1•pseudolus•4m ago•0 comments

Tmp.0ut, Vol. 5

https://tmpout.sh/5/
1•kmstout•5m ago•0 comments

M-Block – New Adblock

https://gitlab.com/mak_dev/m-block
1•MakLanDEV•5m ago•0 comments

Apple's new Mac mini, featuring M6 and M5 Pro

https://www.apple.com/newsroom/2026/08/apple-unveils-a-more-powerful-mac-mini-featuring-the-all-n...
1•runako•7m ago•0 comments

FinalSpark. Rent Brain Power

https://finalspark.com/neuroplatform/
2•pelagicAustral•9m ago•0 comments

Second Reality by Future Crew (1993) in JavaScript

https://www.secondreality1993.com/
1•ibobev•9m ago•0 comments

JSON evolution in Go: from v1 to v2

https://antonz.org/go-json-v2/
2•typical182•10m ago•0 comments

Triangulating AI's Climate Impact, a Look at Studies, Research and Regulation

https://read.misalignedmag.com/triangulating-ais-climate-impact-a-look-at-studies-research-and-re...
1•lcubw•10m ago•1 comments

My Apple Watch would rather I skipped the winter coat

https://www.thisandthat.chat/blog/garbage-in-dressed-up-in-tech/
1•jreynar•11m ago•0 comments

Merchants of Insecurity

https://blog.happyfellow.dev/merchants-of-insecurity/
2•jwdunne•12m ago•0 comments

Mold: A Parallel Linker

https://arxiv.org/abs/2608.23228
1•chrsw•12m ago•0 comments

US data centers tripled annual water consumption to 17B gallons

https://forgeeks.net/us-data-centers-water-use-17-billion-gallons/
1•kuuuzya•12m ago•0 comments

Polars – Prototype on a laptop, scale to 16B rows: one Polars query

https://pola.rs/posts/market-data-to-plotly-enterprise-dashboard/
1•speckx•12m ago•0 comments

Realme P4 vs. Tecno Pova 7 Neo: Comparing two 7000mAh phones side-by-side

https://forgeeks.net/realme-p4-vs-tecno-pova-7-neo-which-budget-battery-giant-actually-wins/
1•kuuuzya•13m ago•0 comments

Casio MQ24: Hands-On with the (Often) Cheapest Watch on Amazon

https://www.hodinkee.com/articles/with-the-often-cheapest-watch-on-amazon
2•xeonmc•13m ago•0 comments

Extending Life Perception

https://herman.bearblog.dev/extending-life-perception/
1•HermanMartinus•15m ago•0 comments

EVE Online moves to Python 3

https://www.eveonline.com/news/view/the-move-to-python-3-begins
3•TylerJaacks•15m ago•0 comments

Apple Introduces New Mac Studio with M5 Max and M5 Ultra

https://www.apple.com/newsroom/2026/08/apple-introduces-new-mac-studio-with-m5-max-and-m5-ultra/
35•interpol_p•17m ago•18 comments

Show HN: Wirespan, a daily power grid optimization puzzle I made for my son

https://wirespan.app/?r=hnn
5•dualarte•17m ago•3 comments

Show HN: Canned Web – Lock a Mac to a single website (kiosk mode, no MDM)

https://cannedweb.app/
2•kazbeki•18m ago•0 comments

FreeCP/M, a modern take on the classic CP/M operating system

https://github.com/Mazin-O3/freecpm
2•oldnetguy•18m ago•0 comments

Apple introduces M6 and M5 Ultra for a big leap in performance and AI compute

https://www.apple.com/newsroom/2026/08/apple-introduces-m6-and-m5-ultra-for-a-big-leap-in-perform...
61•interpol_p•19m ago•23 comments

The Rules Won't Help You When the Game Is Rigged

https://matthogg.fyi/the-rules-wont-help-you-when-the-game-is-rigged/
2•speckx•20m ago•0 comments

An open protocol for AI-mediated product discovery

https://github.com/open-receipt-protocol/orp/blob/main/README.md
1•NiklasHenkel•20m ago•1 comments

Android is getting its own weird dots to cure car sickness

https://www.theverge.com/tech/984226/google-motion-assist-anti-nausea-car-sickness-cure
2•corvad•21m ago•0 comments

Decades-long Linux ownership dispute dead after Xinuos appeal rejected

https://www.tomshardware.com/software/linux/decades-long-linux-ownership-dispute-effectively-dead...
2•theanonymousone•23m ago•0 comments

My agent inflated its own state file to 49MB. Every check passed for three days

https://wisplu.com/blog/en/status-file-blew-up/
1•dustinchu•24m ago•0 comments

Show HN: Turn a Sandbox into an MCP Server

https://github.com/substructureai/mcpd
1•xwil•25m ago•0 comments

Ask HN: Best LLM Subscription as of Now?

1•Simon2712•26m ago•0 comments