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.

I wrote about how we used Conway's Law to fix legacy architecture

https://one2n.io/blog/fixing-legacy-architectures-with-conways-law
1•chinmay185•3m ago•1 comments

"Worthless Idiot, Donkey Head": Parodies of Pedantry on the Renaissance Stage

https://publicdomainreview.org/essay/parodies-of-pedantry/
1•lermontov•5m ago•0 comments

Formally Verifying AI-Generated GPU Kernels

https://gimletlabs.ai/blog/formally-verifying-ai-generated-kernels
1•matt_d•6m ago•0 comments

Why is music so much easier for AI than code?

1•htlemur_bobby•6m ago•0 comments

Florida's OpenAI lawsuit moves to federal court, gets assigned to Aileen Cannon

https://www.politico.com/news/2026/07/08/floridas-openai-lawsuit-federal-court-aileen-cannon-0099...
1•1vuio0pswjnm7•16m ago•0 comments

Controlling the Human Body via EMS

https://github.com/danielkaijzer/Human-Operator
1•kaonwarb•16m ago•0 comments

Ask HN: Multiple MCP Native Tools?

1•edifil•17m ago•0 comments

NEO's Hands – An API to the Physical World

https://www.1x.tech/discover/neos-hands
1•dsr12•19m ago•0 comments

Sheaf theory: from deep geometry to deep learning (2025)

https://arxiv.org/abs/2502.15476
1•measurablefunc•21m ago•0 comments

Clamshell style cyberdeck built around the Raspberry Pi Compute Module 5

https://github.com/sb-ocr/cmdeck
1•tortilla•23m ago•0 comments

OpenAI unveils long-awaited "super app" as rivalry with Anthropic intensifies

https://www.reuters.com/business/openai-launches-chatgpt-work-2026-07-09/
1•adithyaharish•27m ago•0 comments

Migrating Code by Proof: From F# to Python

https://www.logosresearch.ai/news/migrating-code-by-proof/
1•peterkelly•27m ago•0 comments

Paranoid LLMs

https://whyjay.vercel.app/thoughts/paranoid-llms/
1•juggy69•28m ago•0 comments

Show HN: R3 – A Local Code Review Tool for You and Your AI Agent

https://github.com/hyperlogue/r3
1•rickye26•31m ago•0 comments

What Happened to Commodore? Why the Amiga Disappeared

https://www.youtube.com/watch?v=IXitMm7aeV8
2•cable2600•32m ago•0 comments

Earliest example of right-handedness found in Australian fossils

https://www.cnn.com/2026/07/09/science/earliest-animal-right-handedness-spriggina-floundersi
1•Tomte•33m ago•0 comments

Data Science Weekly – Issue 659

https://datascienceweekly.substack.com/p/data-science-weekly-issue-659
1•sebg•38m ago•0 comments

Brave Bat Roadmap 4.0

https://brave.com/blog/bat-roadmap-4-0/
1•twapi•43m ago•0 comments

The most, and least, liveable cities in 2026

https://www.economist.com/graphic-detail/2026/07/06/the-worlds-most-and-least-liveable-cities-in-...
2•andsoitis•45m ago•1 comments

Can you run every line of code in Super Mario Bros.?

https://www.youtube.com/watch?v=o0gOALTvkcc
1•badc0ffee•46m ago•0 comments

Show HN: AppleWalls – free 4K wallpapers for Apple devices

https://www.applewalls.com/en
1•fenggit•49m ago•0 comments

InternNav – Navigation Toolbox

https://github.com/InternRobotics/InternNav
1•rickcarlino•50m ago•0 comments

Audar-ASR-V1:Arabic-first speech recognition foundation models with open weights

1•AudarAI•53m ago•1 comments

LKML-reader: a Rust-based interactive reader for Linux Kernel Mailing Lists

https://github.com/RinHizakura/lkml-reader
1•RinHizakura•54m ago•0 comments

Class action suit over deepfake child sexual abuse material expands

https://text.npr.org/nx-s1-5885052
2•1659447091•57m ago•0 comments

Show HN: I made the Chrome Dino Game editable by your AI prompts

https://vibedino.com
1•johnnyapple•58m ago•0 comments

The Oral History of the Dinosaur Input Device (DID)

https://vfxblog.com/dinosaurinputdevice/
1•fabiensanglard•1h ago•0 comments

Graphic Data Processing – 1965 IBM System/360 Computer Lecture and Demonstration [video]

https://www.youtube.com/watch?v=Y0FY3CDCw1o
1•besserwisser•1h ago•0 comments

Pressurizing a Chicken Coop to Clean it [video]

https://www.youtube.com/watch?v=jYspl74j5eM
1•oftenwrong•1h ago•0 comments

Verla: Free AI Humanizer&assignment helper

https://verla.io
1•kaitsai•1h ago•0 comments