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.

Magi-2: A 480B Frontier Video Generation Model

https://sand.ai/blog/magi-2/
1•gmays•5m ago•0 comments

Verified Garbage: An experimental formally verified cryptography library

https://verified-garbage.dev/posts/announcing-verified-garbage/
1•mkeeter•6m ago•0 comments

Systemd 263-rc1 ships initial Rust code

https://www.phoronix.com/news/systemd-263-rc1
1•Skyfall106•8m ago•0 comments

OpenCode (Rune) desktop client

https://github.com/anomalyco/opencode-rune
1•qainsights•9m ago•0 comments

Just Pick the Smarter Model

https://www.seangoedecke.com/just-pick-the-smarter-model/
1•U1F984•12m ago•0 comments

Show HN: I made Horizontal News, a column-based Hacker News reader

https://hzn.jero.zone/
2•jer0me•15m ago•0 comments

Armed neighbor of school tests limits of Montana's lenient gun laws

https://www.washingtonpost.com/nation/2026/11/28/armed-man-patrolling-next-elementary-school-test...
1•mikhael•19m ago•0 comments

Newsavista (news aggregator) now deeply integrates with HN

https://newsavista.com/invite/ASAD68923E
3•cbeach•23m ago•2 comments

Lua as a Query Language

https://remy.wang/blog/lua-ql.html
3•remywang•24m ago•0 comments

Redact Docs: A Tunable, Local PII Scrubber

https://www.rickmanelius.com/p/redact-docs-a-tunable-local-pii-scrubber
1•mooreds•25m ago•0 comments

A World Without Youth: The Economics of a Shrinking World [video]

https://www.youtube.com/watch?v=BVtxv566UCQ
2•mooreds•26m ago•0 comments

The Camera Caps Kenyans Are Paid to Wear While Going About Daily Lives

https://www.tuko.co.ke/people/family/647605-nairobi-mysterious-camera-caps-kenyans-paid-wear-dail...
4•gnabgib•30m ago•0 comments

Hackers are exploiting Africa's digital identities

https://www.economist.com/middle-east-and-africa/2026/11/03/hackers-are-exploiting-africas-digita...
1•mooreds•33m ago•0 comments

ChatGPT plugin: Podcast Search and Transcription

https://chatgpt.com/plugins/plugin_asdk_app_6aecd9304b88819193ae95e7f9bcd92b
2•wenbin•34m ago•0 comments

Spyware posing as an Italian Interior Ministry app targeted asylum seekers

https://www.irpimedia.eu/en/spyware-posing-as-an-italian-interior-ministry-app-targeted-asylum-se...
1•DeepLogin•34m ago•0 comments

Patients sue surgeons over 'smart' knees implanted without consent

https://www.beckersspine.com/orthopedic/2-patients-sue-surgeons-over-smart-knees-implanted-withou...
5•ourmandave•35m ago•1 comments

Knight's Tour Chess Poster

https://chessposter.com
1•siglesias•35m ago•0 comments

Show HN: CircuitMill – web-based tool for PCB milling

https://circuitmill.com/en/
1•k1zmt•36m ago•0 comments

Authentication for Go applications

https://github.com/Plain-Org/plain-auth
1•NabilSince•37m ago•2 comments

"Self driving" Lidar domes now a status symbol in China, fakes for sale

https://carnewschina.com/2026/11/27/self-driving-lidar-domes-now-a-status-symbol-in-china-as-1-us...
4•edward•37m ago•0 comments

Prefill awareness: can LLMs tell when "their" message history has been modified?

https://www.alignmentforum.org/posts/jsFGuXDMxy5NZg9T2/prefill-awareness-can-llms-tell-when-their...
2•Aachen•39m ago•1 comments

Show HN: Agent HR Report – your coding agents file a complaint about you

https://github.com/loayabdalslam/HR-AGENT
1•loaiabdalslam•40m ago•0 comments

Life in Lists

https://mydecembers.com
1•polycycle•40m ago•0 comments

Ask HN: If you're not on Meta services, How do you share photos and updates?

1•Dathfionn•41m ago•2 comments

Notes on Bill Gates' "Internet Tidal Wave" Memo

https://dev.niceasthis.com/tablehub/read/?id=gates1995tidal
1•firasd•46m ago•1 comments

Show HN: GameFound – a catalogue of 375k games on Blazor Server and one VPS

https://game-found.com/
2•game-found•49m ago•0 comments

Florida Man Gets 47 Months for AI Streamer Impersonation Crypto Scam

https://www.justice.gov/usao-sdfl/pr/port-st-lucie-man-sentenced-47-months-prison-using-ai-impers...
2•gnabgib•51m ago•1 comments

TSMC's A14 1.4nm-class node is ready for chip design

https://www.tomshardware.com/tech-industry/semiconductors/tsmcs-a14-1-4nm-class-node-is-ready-for...
2•gmays•51m ago•0 comments

'Smart' Implants Are Driving Up Costs – Even When Patients Don't Ask for Them

https://kffhealthnews.org/health-industry/smart-joint-implants-knees-health-costs-patients-surpri...
1•dzdt•54m ago•0 comments

Government tech systems are failing – and Trump fired the tech experts

https://thehill.com/opinion/cybersecurity/6232948-gov-outages-staffing-crisis/
8•gnabgib•58m ago•0 comments