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.

State Chart XML (Scxml): State Machine Notation for Control Abstraction

https://www.w3.org/TR/scxml/
1•andsoitis•4m ago•0 comments

Show HN: Charity-compliance – is this Canadian charity ready to file its T3010?

https://github.com/jasveerai88/charity-compliance
1•SinghularityAI•5m ago•0 comments

Massage Spa in Brampton – Rated.ltd

https://rated.ltd/business/brampton/massage-spa
1•erezdomb•9m ago•0 comments

Show HN: Image Squeeze – compress images to a target size, no upload

https://tools.stellartechlabs.xyz/
1•IsotopeTrace•12m ago•1 comments

A History of Rock Music in 500 Songs

https://500songs.com/
1•bookofjoe•13m ago•0 comments

Show HN: Witnis – blast radius that follows inheritance where grep stops

https://github.com/L00PLeGeNd/Witnis
2•loopisme•13m ago•0 comments

Compress images to a KB or MB limit in the browser

https://imgfitkb.com/
1•xianye•15m ago•0 comments

Defending Privacy in the Digital Age: Reflections for Data Privacy Day 2026

https://www.hks.harvard.edu/centers/carr-ryan/our-work/carr-ryan-commentary/defending-privacy-dig...
2•nullink•16m ago•1 comments

NeverSharp: TypeScript compiler in C#, benchmarked against Go and Rust

https://github.com/AndreKfm/NeverSharp
1•andrekaufmann•17m ago•0 comments

Marketing Agency in Toronto – Rated.ltd

https://rated.ltd/business/toronto/marketing-agency
1•erezdomb•19m ago•0 comments

Relocation of Cape Town baboons to sanctuary ignites heated protests

https://www.theguardian.com/world/2026/nov/16/cape-town-baboons-relocation-protests
2•prmph•19m ago•0 comments

How does a Grand Piano work? – Part 2 (2018) [video]

https://www.youtube.com/watch?v=6effL4ATZVo
1•susam•21m ago•0 comments

Global fossil CO2 emissions are projected to fall 0.4% in 2026

https://www.kadoa.com/energy-prices/insights/fossil-co2-2026
1•hubraumhugo•23m ago•0 comments

The movement against data centers has gone global

https://www.npr.org/2026/11/12/nx-s1-6000601/its-not-just-the-u-s-the-movement-against-data-cente...
3•geox•24m ago•0 comments

The Case for Why AI Can Never Replace Conscious Beings

https://ishadeodhar.substack.com/p/the-case-for-why-ai-can-never-replace
1•theanonymousone•29m ago•1 comments

One more code city attempt

https://repo-city.meta-uber-engineer.dev/?repo=rails%2Frails
1•bobishh•29m ago•0 comments

P6 Micro-Ops: Decode, Flags, Control Flow, and Macro Aliasing

https://nand2mario.github.io/posts/2026/p6_basics/
1•faragon•30m ago•0 comments

Honey, We Have Claude at Home

https://yudhanjaya.com/docs/experiments/local-llms-experiments/
1•theanonymousone•31m ago•0 comments

Suchir Balaji November 21, 1998 – November 26, 2024

https://en.wikipedia.org/wiki/Suchir_Balaji
2•eth0up•32m ago•0 comments

Show HN: Oyma – Local-first notes with meeting transcription

https://www.getoyma.com/
1•kimmarqly•33m ago•0 comments

The Pentagon Needs More Patriot Missiles. It's Running into a Rayon Problem

https://www.wsj.com/world/europe/patriot-missile-rayon-problem-3f39dc98
3•JumpCrisscross•34m ago•2 comments

Stop It. Just Stop It

https://www.science.org/content/blog-post/stop-it-just-stop-it
4•shlip•35m ago•0 comments

The LMAX Architecture – 100K TPS at Less than 1ms Latency (2011)

https://martinfowler.com/articles/lmax.html?t=1319912579
2•zenincognito•36m ago•0 comments

Liberal license for ancient Unix sources (2002)

http://www.lemis.com/grog/UNIX/
1•doener•39m ago•0 comments

DevTap – A developer profile you share by tapping an NFC card

https://devtap.app
1•aravindkumarv•39m ago•0 comments

Tiny WebGPU prototype to Rust game on eight platforms in two months

https://saltedcaramelgames.com/blog/loot-hole-rust-threejs-wgpu/
1•VoxelBoy•44m ago•0 comments

ITRS, OSM, and Trailmaps.app

https://nuxx.net/blog/2026/11/22/itrs-osm-and-trailmaps-app/
2•c0nsumer•44m ago•0 comments

ZeroBurn – Cut coding-agent token burn 98% with 0-token MCP and local Ollama

https://github.com/thoufeeque22/zeroburn
2•thoufeeque22•45m ago•0 comments

Show HN: Umbera-core – hybrid X25519 and ML-KEM sealed sender in Rust

https://github.com/UmberaAPP/UMBERA
1•VaheALEX•45m ago•0 comments

How Hong Kong is using AI alerts and a tank to cut flood risks during storms

https://2tinteractive.com/watch/episodes/5739/
1•LebToki•47m ago•0 comments