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.

Copatch- The shared workspace for teams building with AI coding agents

https://copatch.ai/
1•malrokhayes•58s ago•0 comments

Radar – (Signal clone) Chats and sats in one place

https://radar.chat/
1•janandonly•2m ago•0 comments

Show HN: Get an email when your favorite actor/director releases something new

https://www.premierepal.com/
1•samteeeee•5m ago•0 comments

AgentTrace: A Structured Logging Framework for Agent System Observability

https://arxiv.org/abs/2602.10133
1•ankitg12•6m ago•0 comments

Malloy semantic modeling lang gets 'Credible' backing to build out AI context

https://venturebeat.com/data/57-of-enterprises-traced-a-wrong-ai-answer-to-missing-business-conte...
1•richij•6m ago•0 comments

GCC steering committee announces AI policy

https://lwn.net/Articles/1086041/
2•arto•6m ago•0 comments

Are We Stuck with Lean?

https://mathoverflow.net/questions/513742/are-we-stuck-with-lean
1•jjgreen•7m ago•0 comments

"Oopsies " FreeBSD Devs Say There's Still GPL in the Kernel

https://fossforce.com/2026/07/oopsies-freebsd-devs-say-theres-still-gpl-in-the-kernel/
2•richij•9m ago•1 comments

Pokémon Red and Blue Mod Turns the Game Boy Games into a Gorgeous 3D Diorama

https://kotaku.com/pokemon-red-blue-recompilation-project-voxel-3d-mod-2000720281
3•throwaway270925•11m ago•0 comments

Show HN: Invisible color – Daily logical puzzle

https://www.invisible-color.xyz/
1•wrongful1520•17m ago•0 comments

Amazon finds cases of AI causing runaway spending on tech projects

https://www.ft.com/content/77baac40-d803-4084-94f3-a133653072cf
1•adrianhon•18m ago•1 comments

Nscale to Buy Anyscale for $1.65B

https://www.bloomberg.com/news/articles/2026-07-30/nscale-to-buy-ai-software-startup-anyscale-for...
1•marc__1•18m ago•0 comments

I made a game where you build a CPU from logic gates

https://select.supply/game/chipbuilder
1•laurentiurad•19m ago•1 comments

67% of Americans worry leaders pressuring officials to alter election results

https://news.gallup.com/poll/712955/election-concerns-run-high-ahead-2026-midterms.aspx
1•giuliomagnifico•19m ago•0 comments

The First Chatbot's Multiple Personalities

https://spectrum.ieee.org/eliza-chatbot-source-code
1•sohkamyung•21m ago•0 comments

ChatGPT, Roblox to Fall Under Strictest EU Rules for Platforms

https://www.bloomberg.com/news/articles/2026-07-29/chatgpt-roblox-to-fall-under-strictest-eu-rule...
7•ch_sm•22m ago•0 comments

Lean 4 Bug Found Incidentally by AI, "Proving" Collatz

https://twitter.com/gro_tsen/status/2082483878480977959
1•jryan49•22m ago•0 comments

Audio8 TTS Preview 0.6B: multilingual TTS model with zero-shot voice cloning

https://huggingface.co/Audio8/Audio8-TTS-Preview-0.6b
1•nateb2022•23m ago•0 comments

You can't solve computer use by ignoring the interface

https://steelmanlabs.com/blog/computer-use-is-far-from-solved
7•mpavlov•23m ago•0 comments

Cameron's World

https://www.cameronsworld.net
1•adityaathalye•26m ago•0 comments

Binary is the best way to count [video] (2023)

https://www.youtube.com/watch?v=rDDaEVcwIJM
1•basilikum•27m ago•0 comments

Were this summer's heatwaves caused by El Niño, or something more terrifying?

https://www.irishtimes.com/opinion/2026/07/28/eamon-ryan-were-this-summers-heatwaves-caused-by-el...
1•simmerup•28m ago•0 comments

Gates Heir's Shopping App Claimed Sales It Didn't Drive

https://www.bloomberg.com/news/articles/2026-07-09/gates-heir-s-shopping-app-took-credit-for-sale...
2•mgh2•28m ago•2 comments

3D Pinball for Windows (1995)

https://98.js.org/programs/pinball/space-cadet.html
2•mushstory•29m ago•0 comments

'My life's screwed': Korean investors stress out after AI bubble bursts

https://www.ft.com/content/23f388eb-e8ab-4fb1-b1ca-8e04eb4561a1
6•scrlk•30m ago•1 comments

Email Storm

https://en.wikipedia.org/wiki/Email_storm
1•thinkingemote•32m ago•0 comments

Best Python Frameworks for 2026

https://duckframework.com/blog/6-best-python-frameworks-for-2026-and-the-one-most-lists-get-wrong
1•digreatbrian•33m ago•0 comments

Sarvam Code

https://www.sarvam.ai/products/coding-agents
1•pixxxel•35m ago•0 comments

Design and simulate 16×2 or 20×4 Arduino displays in seconds

https://www.pockeng.com/tools/lcd.html
1•levario•35m ago•0 comments

My 3 SaaS are evaporating. RIP indie hacking (2018-2026)

https://twitter.com/gherget/status/2082784434726592780
2•gaborme•41m ago•1 comments