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.

The Most Famous AI Writing Tic Is Also the Most Mysterious

https://www.theatlantic.com/technology/2026/07/ai-chatbot-writing-tic-negative-parallelism/687892/
1•tekdude•26s ago•0 comments

Apple's M6, M7 and M8 Chips Show How AI Is Reshaping the Company

https://www.bloomberg.com/news/newsletters/2026-07-12/apple-s-chip-plans-m6-m7-pro-m7-max-m7-ultr...
1•newusertoday•1m ago•0 comments

Against Usefulness

https://www.motivenotes.ai/p/against-usefulness
1•supo•3m ago•0 comments

Soulless – List of AI Artists Hiding on Spotify

https://soullessmusic.com/
1•ChrisArchitect•3m ago•0 comments

Show HN: Block dangerous Git and shell commands from being executed by agents

https://github.com/Dicklesworthstone/destructive_command_guard
1•adithyaharish•4m ago•0 comments

Dictation and Meeting App Sends to Apple Notes – Free and Local Models

https://voice.baselinemakes.com/
1•stevenhubertron•4m ago•1 comments

W11 Copilot tells you what's slowing down your PC, while using 1GB RAM itself

https://www.windowslatest.com/2026/07/12/windows-11-copilot-ai-can-now-tell-you-whats-slowing-dow...
1•speckx•4m ago•0 comments

Programming thought experiment: stuck in a room with a PC without an OS

https://old.reddit.com/r/programming/comments/9x15g/comment/c0ewj2c/
1•Tomte•7m ago•0 comments

AI-Powered Multi Tenant Platform

https://svoxx.com/int/en
1•kilincarslan•11m ago•0 comments

Rustnet: Per-process network monitoring with deep packet inspectio

https://github.com/domcyrus/rustnet
1•thunderbong•12m ago•0 comments

Claude Fable 5 access extended through July 19

https://xcancel.com/claudeai/status/2076351399999557669#m
4•Topfi•13m ago•1 comments

Show HN: Free AI travel destination search across Asia

https://asianexpats.com
1•developeron29•15m ago•0 comments

Restarting Germany's Reactors: Viability and Outlook [pdf]

https://www.radiantenergygroup.com/_files/ugd/ae75b7_bc5db590cf5a4ac6a4a0d6812a58ada6.pdf
1•throw0101d•18m ago•2 comments

The Four "Ions", or How to Provision CIAM Users (2023)

https://ciamweekly.substack.com/p/the-four-ions-or-how-to-provision
1•mooreds•18m ago•0 comments

Local-first image annotation–try it in the browser, no signup, nothing uploaded

https://thevision.works/demo
2•Wiseye•21m ago•0 comments

Show HN: SayItDev LLM and Speech capabilities with 0 dependencies and no models

https://github.com/innovatorved/sayitdev
3•innovatorved•21m ago•0 comments

Welcome to the Era of the Forever Layoff

https://www.businessinsider.com/why-tech-companies-keep-doing-layoffs-ai-2026-7
8•pseudolus•25m ago•0 comments

China-made CXMT memory now supports faster speeds on MSI's AMD motherboards

https://www.tomshardware.com/pc-components/ddr5/china-made-cxmt-memory-now-supports-faster-speeds...
2•binyu•26m ago•0 comments

In defense of not understanding your codebase

https://www.seangoedecke.com/in-defense-of-not-understanding-your-codebase/
2•saikatsg•30m ago•2 comments

GuardianDB: High-performance, local-first decentralized database built on Rust

https://www.willsearch.com.br/guardian-db/
2•wmaslonek•31m ago•0 comments

An orbiting disco ball gave Einstein's theory its most precise test yet

https://arstechnica.com/science/2026/07/an-orbiting-disco-ball-gave-einsteins-theory-its-most-pre...
4•Logans_Run•32m ago•0 comments

Whats the Hardest Challenges in AI?

2•debpalash•33m ago•0 comments

Fable extended until 19 July

https://twitter.com/claudeai/status/2076351399999557669
21•protoman3000•35m ago•7 comments

Like a cheat code for your car: We investigate ECU tuning

https://arstechnica.com/cars/2026/07/like-a-cheat-code-for-your-car-we-investigate-ecu-tuning/
2•pseudolus•36m ago•0 comments

Migrating a production AI agent to GPT-5.6: 2.2x faster, 27% cheaper

https://ploy.ai/blog/migrating-a-production-ai-agent-to-gpt-5-6
3•brryant•37m ago•0 comments

Cursor and VSCode Code review flow for GitLab (for now)

https://github.com/LuyandaLia/reviewflow
2•Luyanda•38m ago•1 comments

Knowledge-based verification: is it state-of-the-art?

https://workshop.vennfactory.com/p/knowledge-based-verification-is-it
2•mooreds•38m ago•0 comments

How Ukraine Built a War Fighting State

https://www.austinvernon.site/blog/ukrainewar.html
10•delichon•39m ago•1 comments

The Unintended Consequences of Genetic Tests

https://www.theatlantic.com/ideas/2026/07/genetic-testing-children-diseases/687869/
2•bookofjoe•39m ago•1 comments

NameThat: A visual dictionary of UI elements

https://namethatui.com
1•DantesKite•39m ago•0 comments