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.

Protecting the American Data Moat

https://www.micro1.ai/blog/protecting-the-american-data-moat
1•nlpnerd•1m ago•1 comments

A major step change in AI's offensive cyber capability

https://www.ncsc.gov.uk/blogs/major-step-change-in-ais-offensive-cyber-capability-demands-response
1•geox•3m ago•0 comments

Characterizing Latent Reasoning Dynamics in LLMs

https://arxiv.org/abs/2612.02425
1•E-Reverance•3m ago•0 comments

Where Skilled Talent Goes and Stays: The Best U.S. Metros for Attracting Talent

https://www.workcafe.com/blog/research-data/best-us-metros-for-attracting-talent/
1•hackawork•4m ago•0 comments

Running 1,000 Standalone SQLite Databases Inside SQL Server

https://sqlartist.github.io/posts/running-1000-standalone-sqlite-databases-inside-sql-server/
2•thunderbong•6m ago•0 comments

Experience the Magic of Ionospheric Propagation

https://rad950.org/
2•resters•6m ago•0 comments

Show HN: Biviu – AI list builder powered by Jev

https://biviu.com
2•ephx•7m ago•0 comments

Show HN: One of the smallest and easiest to maintain 11ty/Build Awesome starters

https://github.com/open-sveti/one-starter
1•anydigital•9m ago•1 comments

Hackers Breach the Brain of the U.S. Air Force Cloud

https://spintcom.substack.com/p/hackers-breach-the-brain-of-the-us
2•thunderbong•12m ago•0 comments

The core anti-Pangram constituency is phony writers

https://www.theargumentmag.com/p/the-core-anti-pangram-constituency
1•JoshTriplett•14m ago•0 comments

Show HN: VisualCI – Visual regression and snapshot testing for AI agents

https://visualci.com
2•nathan_f77•15m ago•0 comments

Free and open-source C++ DirectUI interface library for Windows

https://github.com/duilib/duilib
1•zerr•17m ago•0 comments

The Laravel You Know, Written in Rust [video]

https://www.youtube.com/watch?v=9znOFW6Bvg4
1•Imustaskforhelp•19m ago•0 comments

Not Slop: Haskell in the Age of AI

https://discourse.haskell.org/t/well-typed-blog-not-slop-haskell-in-the-age-of-ai/15237
2•romes•20m ago•0 comments

Do Hard Times Cause Crime?: The Lessons of History

https://lsupress.org/do-hard-times-cause-crime-the-lessons-of-history/
1•barry-cotter•21m ago•0 comments

Nvidia Fleet to Combat Smuggling and Implement Remote Cloud Access Protections

https://nvidianews.nvidia.com/news/nvidia-announces-expanded-national-security-and-export-control...
1•rzerowan•24m ago•0 comments

Introducing Laravel Rust

https://laravel.com/blog/introducing-laravel-for-rust
2•resurge•25m ago•0 comments

Jitter: Making Things Better with Randomness

https://brooker.co.za/blog/2015/03/21/backoff.html
2•hiohio•28m ago•2 comments

Phones Banned, Chinese Students Turn to Paper Short Dramas

https://www.sixthtone.com/news/1019331
3•wmchen•28m ago•0 comments

Surf95 ▸ Surf the Old Web

https://surf95.com/
2•kurtis_reed•30m ago•0 comments

Cerebras and Nvidia Collaborate to Accelerate Agentic Inference

https://nvidianews.nvidia.com/news/cerebras-and-nvidia-collaborate-to-accelerate-agentic-inference
2•gmays•33m ago•0 comments

Warren Buffett's Son Howard Buffett Became Ukraine's Largest Private Donor

https://www.forbes.com/sites/forbesinternational/2026/11/21/how-warren-buffetts-son-howard-buffet...
1•axiologist•35m ago•1 comments

Protect the AI We Love. Preserve Our Freedom to Choose

https://drive.google.com/file/d/1yyFrJiewV5rYIUA9pqwlbOST9m06USsw/view?usp=drivesdk
1•Roger-Evelyn•35m ago•0 comments

The Drawn Maps · Habibi Code

https://www.habibicode.org/thedrawnmaps
5•n_plus_1_acc•39m ago•1 comments

CoW B+ Trees are Fun

https://nubskr.com/2026/11/29/nubSQL/
2•signa11•39m ago•0 comments

CrimeWatch MCP

https://github.com/LordMoMA/crimewatch-mcp
1•lordmoma•39m ago•0 comments

How I made a RISC-V CPU in Minecraft Bedrock

https://www.youtube.com/watch?v=sP3tFTvJkNQ
1•sashiono•41m ago•0 comments

German company sets its sights on super heavy rocket after historic launch

https://arstechnica.com/space/2026/12/germanys-isar-aerospace-unveils-plan-for-europes-first-supe...
4•Tomte•45m ago•0 comments

Engels' Pause

https://en.wikipedia.org/wiki/Engels%27_pause
2•nreece•46m ago•0 comments

Show HN: MCP Station – daily checks of every remote server in the MCP Registry

https://mcpstation.net/
1•mcpstation•51m ago•0 comments