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.

Running go-to-market like an engineer: my first 90 days at a dev tool

https://tessakriesel.com/how-i-grew-signups-71-in-90-days-by-running-gtm-like-an-engineer/
1•builtfordevs•1m ago•0 comments

Show HN: Mold, an autonomous zine about AI culture

https://www.moldzine.ai/
1•gabelev•2m ago•0 comments

Half of Americans struggle to afford groceries and gas, exclusive poll finds

https://www.theguardian.com/business/2026/jul/07/cost-of-living-poll-groceries-gas
1•rawgabbit•5m ago•0 comments

So you want to learn physics (second edition, 2021)

https://www.susanrigetti.com/physics
2•azhenley•7m ago•0 comments

Show HN: AI or Not

https://aiornot.vote/
1•buffer_overlord•8m ago•0 comments

Agent Data Injection Attacks

https://arxiv.org/abs/2607.05120
4•juppytt•10m ago•1 comments

On vibe forks

https://rahulpandita.me/blog/2026-06-29-vibe-forks/
1•azhenley•10m ago•0 comments

Maine librarians are helping patrons resist AI and Big Tech

https://www.bangordailynews.com/2026/07/02/midcoast/midcoast-culture/maine-librarians-are-helping...
5•cdrnsf•12m ago•0 comments

Copy That Floppy – Cambridge guide for preserving data from fragile floppy disks

https://www.digipres.org/the-floppy-guide/
2•whiteblossom•13m ago•0 comments

Japan's borrowing costs soar to 30-year high on debt fears

https://www.ft.com/content/851aa883-073f-4423-a43e-9b09fdbe7c86
1•petethomas•14m ago•0 comments

3.5M Developers. Then Microsoft Pulled the Plug

https://www.youtube.com/watch?v=CPhAkzb4kUo
1•cable2600•15m ago•0 comments

Show HN: A quiet new tab that replaces your default boring new tab in Chrome

https://chromewebstore.google.com/detail/nook-tab/loogeapnnikphlehifdfmmceaeidbhnd
1•masterbrewer•18m ago•0 comments

Protobuf-py: Protobuf for Python, without compromises

https://buf.build/blog/protobuf-py
1•ming13•19m ago•0 comments

Paseo: Orchestrate coding agents from your desk and your phone

https://paseo.sh/
1•jerlendds•19m ago•0 comments

I made an "evolving scene" presentation creation skill

https://github.com/Codagent-AI/and-scene
1•paulcaplan•19m ago•1 comments

Forget the GPU Shortage: The Real AI Bottleneck Was Diagnosed in 2007

https://sal4rkhn.substack.com/p/forget-the-gpu-shortage-the-real
2•salarkhannn•22m ago•0 comments

China May Restrict Access to Its Most Powerful AI Models

https://time.com/article/2026/07/07/china-ai-models-alibaba-bytedance/
1•stenlix•22m ago•0 comments

SQLite (2.2k files) vs. MySQL-Server (58k files) visualization

https://old.reddit.com/r/PrincipalAi/comments/1uqgpll/mysql58k_files_vs_sqlite22k_files_visualiza...
1•fernando-ram•23m ago•0 comments

How America's Wealth Distribution Has Changed Since 1989

https://www.visualcapitalist.com/americas-wealth-distribution-1989-2025/
3•theanonymousone•27m ago•0 comments

We built a Rust EDR. macOS notarization tried to kill it

https://www.nemesislabs.xyz/
1•davidobi023•27m ago•0 comments

Wall clock is the wrong metric

https://www.anantjain.xyz/posts/wall-clock-is-the-wrong-metric
1•anant90•27m ago•0 comments

A battery 'hacking' app can strand an e-rickshaw – and the risks it poses

https://indianexpress.com/article/explained/explained-sci-tech/bms-apps-e-rickshaw-battery-hack-g...
1•Abishek_Muthian•29m ago•0 comments

Ancient Denisovan DNA is still shaping human immunity today (Science Daily)

https://www.sciencedaily.com/releases/2026/06/260613034210.htm
1•indynz•36m ago•0 comments

Show HN: ChatGPT, Claude and Codex-style chat inputs in one React component

https://prompt-area.com/styles
1•kachar•37m ago•0 comments

Malleating Git commit signatures

https://iter.ca/post/git-malleate/
1•smitop•37m ago•0 comments

Real 3D Minecraft on the GameBoy [video]

https://www.youtube.com/watch?v=2hwYoG96GQQ
1•zetamax•37m ago•0 comments

ForkMind – Git for LLM context: branch, offload, and restore it

https://github.com/Medhovarsh/forkmind
1•medhovarsh•38m ago•0 comments

Smolbren: Local search for your Markdown vaults

https://github.com/junaidrahim/smolbren
2•handfuloflight•41m ago•0 comments

Reminder Email to yourself with voice option

https://remindmyemail.com/
1•texasjosh•44m ago•1 comments

Chorus: A fast, single-writer write-ahead log on Google Cloud Storage

https://github.com/rockwotj/chorus
1•handfuloflight•45m ago•0 comments