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.

Intentionally Down

https://control.softlayer.com/
1•gfs•1m ago•0 comments

Show HN: Walkman – turn-by-turn routing in the browser, built from vector tiles

https://walkman.uz/
1•sardor_r1•1m ago•0 comments

Noise: Speedrun for Pretraining Without Backpropagation

https://qlabs.sh/noise#update
1•ZeroCool2u•2m ago•0 comments

Show HN: Taveo – Split bar and restaurant bills without sign-up

https://taveo.app/en
1•gallegodev•2m ago•0 comments

Startup plans to rejuvenate nuclear power industry with new manufacturing

https://news.mit.edu/2026/startup-rejuvenates-nuclear-power-industry-new-manufacturing-approach-1022
1•rbanffy•4m ago•0 comments

Kemp Folds: Ross Kemp's face, folded

https://kempfolds.blogspot.com/
2•tuvix•4m ago•0 comments

Man as Man: A Promise to the Dead

https://manasman.tiiny.site/png/man_as_man
1•shaunxcode•4m ago•0 comments

Created a free intuitive app to browse S3

https://s3-client-nu.vercel.app/
1•emilmoe•5m ago•0 comments

Emulator reimagines Nintendo's Virtual Boy with a full color display

https://arstechnica.com/gaming/2026/10/this-emulator-reimagines-nintendos-virtual-boy-with-a-full...
1•rbanffy•6m ago•0 comments

TorchTPU: Hybrid Eager/Compiled Architecture for Native PyTorch Execution on TPU

https://arxiv.org/abs/2610.24161
1•matt_d•6m ago•0 comments

GPUs from stolen $500k Nvidia shipment at Brazil airport appear for sale online

https://www.tomshardware.com/pc-components/gpus/gpus-from-nvidia-rtx-5090-stolen-usd470-000-shipm...
1•neilfrndes•7m ago•1 comments

Interoperability vs. Security: Why not both?

https://www.eff.org/deeplinks/2026/10/interoperability-vs-security-why-not-both
1•hn_acker•7m ago•0 comments

Canadians Are Running Out of Time to Oppose the Dangerous C-22 Surveillance Bill

https://www.eff.org/deeplinks/2026/10/canadians-are-running-out-time-oppose-dangerous-c-22-survei...
3•hn_acker•9m ago•0 comments

Jupiter Is a Jerk (2017)

https://www.popularmechanics.com/space/solar-system/a25693/jupiter-is-a-jerk/
1•sans_souse•10m ago•0 comments

Watching the Watchers

https://watchingthewatchers.github.io/watchingthewatchers/index.html
1•DeepLogin•10m ago•0 comments

Cerebras Deploys Trillion-Parameter AI Models

https://www.cerebras.ai/blog/how-we-deploy-trillion-parameter-frontier-models-on-cerebras
1•rbanffy•11m ago•0 comments

Hot Take – Alex Ewerlöf Notes

https://blog.alexewerlof.com/p/hot-take
1•vinnyglennon•11m ago•0 comments

Full transaction detection for Cloudflare WAF

https://blog.cloudflare.com/full-transaction-waf/
1•homero•11m ago•0 comments

Random Number (Xkcd)

https://xkcd.com/221/
1•mystcb•13m ago•0 comments

Speeding up code review with `small-change`

https://lethain.com/small-changes/
1•KothuRoti•16m ago•0 comments

Australia's Hydro Project Snowy 2.0 Now Costs 11 Times Original Estimate

https://www.bloomberg.com/news/articles/2026-10-22/australia-s-flagship-hydro-project-now-costs-1...
2•toomuchtodo•18m ago•1 comments

A Surprise Map of a Book

https://phasefield.ai/blog_entry_2.html
1•mctwo•18m ago•0 comments

Show HN: Work in Progress alternative to OWASP threat dragon

https://saerskriven.com/
1•AlexaDewit•18m ago•1 comments

Calley Means, top MAHA ally, resigns from Trump administration

https://www.politico.com/news/2026/10/22/calley-means-top-maha-ally-resigns-from-trump-administra...
2•bilsbie•19m ago•0 comments

Where did my freed memory (not) go?

https://yapfast.com/blog/where-did-my-freed-memory-go/
1•wiredtenshi•21m ago•1 comments

Claudia.gallery

https://claudia.gallery/
1•zestyping•24m ago•0 comments

The Browser Company Retires Its Arc Browser and Pushes Users to Dia

https://www.thurrott.com/cloud/343150/the-browser-company-retires-its-arc-browser-and-pushes-user...
2•joak•24m ago•2 comments

Cyberpunk 2077 in WebGPU

https://twitter.com/omonkeyzz/status/2113389957968785510
6•astlouis44•27m ago•0 comments

Some Will Appreciate

https://www.bradoyler.com/ai/airplane-mode-revisited/
1•bradoyler•28m ago•1 comments

ClaudeCode skill to easily protect your website from the PHP2Shell bug

https://github.com/DavidHuji/PHP2Shell-SKILL
1•davenu•29m ago•0 comments