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.

Wright's Law Edges Out Moore's Law in Predicting Technology Development (2012)

https://spectrum.ieee.org/wrights-law-edges-out-moores-law-in-predicting-technology-development
1•simonpure•3m ago•0 comments

Coding Has Agents. Trading Has One

https://henryzhang.substack.com/p/coding-has-agents-trading-finally
1•henryzhangpku•3m ago•0 comments

Simulate cassette tape audio profiles using FFmpeg

https://github.com/AARomanov1985/Audio-Cassette-Simulation
1•xterminal•4m ago•0 comments

Show HN: Infinite Jigsaw Game

https://infinitejigsaw.com
1•impostervt•4m ago•0 comments

The Sustained Performance Gap: Why Laptop Specs Don't Tell the Whole Story

https://psyll.com/articles/technology/tech-gadgets/thermal-throttling-why-laptops-lie-about-speed
1•lucasfletcher•5m ago•0 comments

The Lego Problem, Revisited

https://seths.blog/2026/07/the-lego-problem/
1•herbertl•6m ago•0 comments

Most Americans Say Financial Milestones Are Harder for Today's Young Adults

https://www.pewresearch.org/short-reads/2026/07/17/majorities-of-americans-say-key-financial-mile...
3•karakoram•9m ago•0 comments

The American E.V. Has Been Crushed. Will It Take the U.S. Auto Industry with It?

https://www.nytimes.com/2026/07/15/magazine/electric-cars-american-evs.html
1•bookofjoe•11m ago•1 comments

Vulnerabilities in CJSON

https://joshua.hu/cjson-json-parser-cve-vulnerabilities
1•ingve•13m ago•0 comments

Automate 7 Projects Marketing with AI for $40

https://apsquared.co/posts/marketing-automation-claude-codex
1•apsquared•14m ago•0 comments

What does GitHub's security team even do?

https://orchidfiles.com/github-security-team/
2•theorchid•15m ago•0 comments

We built phone-only laser tag with computer vision and sensor fusion

https://lightwarsar.com/engineering/targeting-system/
1•mrr7337•17m ago•0 comments

When Compilers Disagree About UTF‑8

https://nemanjatrifunovic.substack.com/p/when-compilers-disagree-about-utf8
2•ingve•20m ago•0 comments

Two AI Futures to Choose From

https://www.rameznaam.com/p/two-ai-futures-to-choose-from
2•simonpure•21m ago•0 comments

against “it’s not that deep”. actually, it is

https://velvetnoise.substack.com/p/against-its-not-that-deep-actually
1•jger15•22m ago•0 comments

Show HN: Free Bible study that explains every chapter you read

https://learnofchrist.com
8•not_wowinter14•26m ago•2 comments

Nushell

https://www.nushell.sh/
3•handfuloflight•26m ago•0 comments

$550M in Medical Debt Only Cost $5.5M [video]

https://www.youtube.com/watch?v=Cimg-Xg043Y
2•foxfired•27m ago•0 comments

Wordsmith

https://segue.app/wordsmith
2•_continuation•28m ago•1 comments

Kimi K3 is not cheap

https://www.alexinch.com/blog/kimi-k3
16•ainch•29m ago•10 comments

New funding rules will make US research slower, costlier and harder to share

https://theconversation.com/new-trump-administration-rules-on-federal-science-funding-could-make-...
2•teaman2000•33m ago•0 comments

Look at Silicon Valley history from 360 degrees over the years

https://ValleyOfIdeas.com
1•chenpaul•34m ago•0 comments

Building Political Superintelligence

https://freesystems.substack.com/p/building-political-superintelligence
3•m-hodges•34m ago•0 comments

I've converted my website to grayscale

https://rz01.org/qmx/
2•exitnode•37m ago•2 comments

Optical Memory Link Could Boost AI in Robotics

https://spectrum.ieee.org/ai-in-robotics
1•jonbaer•38m ago•0 comments

Persistent Money Struggles Linked to Faster Brain Ageing

https://www.ucl.ac.uk/news/2026/jul/persistent-money-struggles-linked-faster-brain-ageing
1•karakoram•45m ago•0 comments

Show HN: Punter.js – single-file JavaScript game engine for teaching programming

https://punterjs.org/
1•john-doherty•45m ago•0 comments

LLM Cliche Highlighter

https://tools.simonwillison.net/llm-cliche-highlighter
2•saikatsg•46m ago•0 comments

America's schools admit screens make students worse off

https://fortune.com/article/schools-abandoning-chromebooks-laptop-programs-as-screen-time-hurts-l...
2•jedberg•49m ago•0 comments

Kitty [terminal emulator] chases the mouse

https://lwn.net/Articles/1080821/#Comments
2•leephillips•50m ago•0 comments