frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Avoid Continue

https://www.teamten.com/lawrence/programming/avoid-continue.html
2•todsacerdoti•8mo ago

Comments

zoezoezoezoe•8mo 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•8mo 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.

Show HN: vmux – Run Python in Cloudflare containers in 3s

https://vmux.sdan.io/
1•sdan•33s ago•0 comments

Linux Is Not Stable

https://crowfunder.github.io/posts/linux-is-not-stable/
1•crowfunder•2m ago•1 comments

How Easy It Is to Steal Your Data with a Chrome Extension

https://notnotp.com/notes/steal-your-data-with-a-chrome-extension/
1•enz•5m ago•0 comments

Claude Is Growing Tomatoes

https://autoncorp.com/biodome/
1•bpavuk•6m ago•0 comments

New Year's Fireworks Simulator in Your Terminal

https://github.com/willmcgugan/ny2026
1•willm•7m ago•0 comments

Show HN: I made islechat, like Slack but in the terminal over SSH

1•ashfn•7m ago•2 comments

Copenhagen Street Tree Density

https://cphtrees.netlify.app/
1•pppone•8m ago•0 comments

Show HN: Repair-JSON-stream – Fix broken JSON from LLM streaming (1.7x faster)

https://github.com/prxtenses/repair-json-stream
1•prxtenses•9m ago•0 comments

When Your Endpoints Play Russian Roulette and You're Holding the Gun

https://synapsflow.com/article/api-roulette-when-your-endpoints-play-russian-roulette-and-you-re-...
1•SynapsFlow•10m ago•1 comments

Curses, Vengeance, and Fishtails: The Cornish Mermaid in Perspective [pdf]

https://www.academia.edu/31865439/Curses_Vengeance_and_Fishtails_The_Cornish_Mermaid_in_Perspective
1•thunderbong•10m ago•0 comments

Customize Your Windows Within Sophia Script for Windows

https://github.com/farag2/Sophia-Script-for-Windows
1•farag2•12m ago•0 comments

The Story of OnlineOTP

https://jameelur.com/blog/online-otp-going-offline
1•WanderingSoul•14m ago•0 comments

When the line stops going up

https://www.coryzue.com/writing/the-line/
2•pdyc•14m ago•0 comments

Fixing My System76 Laptop in 20 Minutes or Less

https://danielmangum.com/posts/fix-system76-laptop-20-min/
1•hasheddan•16m ago•0 comments

Cheap solar is transforming lives and economies across Africa

https://www.nytimes.com/2025/12/30/climate/solar-south-africa-china.html
2•botanical•16m ago•1 comments

What Is a Memristor?

https://www.electricalvolt.com/what-is-a-memristor-principle-types-advantages-applications/
1•slicktux•17m ago•0 comments

Efficient method to capture CO2 from the atmosphere / Univ of Helsinki

https://www.helsinki.fi/en/news/innovations/efficient-method-capture-carbon-dioxide-atmosphere-de...
3•lrasinen•19m ago•0 comments

Ask HN: What makes you instantly downvote a post?

2•ClipNoteBook•19m ago•2 comments

How the AI 'bubble' compares to history

https://www.ft.com/content/41e9d03a-e5c1-4862-9836-b3c80b3f9be4
1•1vuio0pswjnm7•20m ago•1 comments

The famous '1984' ad was first shown in 1983

https://appleinsider.com/articles/25/12/31/how-and-why-the-famous-1984-ad-was-really-first-shown-...
1•LordGrey•20m ago•1 comments

AI Automation

1•jltackett•21m ago•0 comments

Why an Electron Doesn't Fall into a Proton but a Positron Pulls It All the Way?

https://pajuhaan.medium.com/why-an-electron-doesnt-fall-into-a-proton-but-a-positron-pulls-it-all...
1•pajuhaan•22m ago•1 comments

Freeing 118 GB of W&B experiment data from a broken binary format

https://far.in.net/free-wandb
1•matomatical•23m ago•0 comments

Benefits of Choosing Abp.io for Enterprise Software

https://www.faciletechnolab.com/blog/benefits-of-choosing-abpio-for-enterprise-software/
1•plakhlani2•25m ago•0 comments

AI Labs Are Solving the Power Problem

https://newsletter.semianalysis.com/p/how-ai-labs-are-solving-the-power
6•Symmetry•27m ago•1 comments

PNGine: Bundle WebGPU shaders into portable PNG files (~15 KB self-contained)

https://hugodaniel.com/posts/introducing-pngine/
1•hugodan•28m ago•0 comments

Conditions in the Intel 8087 floating-point chip's microcode

https://www.righto.com/2025/12/8087-microcode-conditions.html
1•colejohnson66•29m ago•0 comments

Show HN: Virtual Try-On Chrome extension to see how products look on you

https://www.tryaing.com
1•rokontech•29m ago•0 comments

Testing AirPods Live Translation in Tokyo

https://www.nytimes.com/2025/12/26/travel/airpods-live-translation-japan.html
2•etothet•31m ago•1 comments

When square pixels aren't square

https://alexwlchan.net/2025/square-pixels/
1•PaulHoule•33m ago•0 comments