frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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.

Corporate America Is Minting Money–and Not Just in Tech and Finance

https://www.wsj.com/business/earnings/corporate-america-is-minting-moneyand-not-just-in-tech-and-...
1•JumpCrisscross•1m ago•0 comments

Ketamine, psychedelics, GHB: is the US falling out of love with cocaine?

https://www.theguardian.com/us-news/2026/apr/21/cocaine-ketamine-psychedelics-ghb
1•JumpCrisscross•1m ago•0 comments

Chatting with myself about AI

https://2earth.github.io/website/20260426.html
1•2earth•3m ago•1 comments

Ask HN: Is anyone building/selling VT220-type terminals?

1•vrypan•3m ago•1 comments

Taiwan's stock market surpasses the UK's, thanks to AI

https://www.tomshardware.com/tech-industry/taiwan-stock-market-overtakes-the-uk
1•giuliomagnifico•3m ago•0 comments

TopCarPlay Wireless CarPlay

https://www.facebook.com/TopCarPlayWirelessCarPlay.Get
1•jerrycazer•3m ago•0 comments

China blocks Meta's acquisition of AI startup Manus

https://www.cnbc.com/2026/04/27/meta-manus-china-blocks-acquisition-ai-startup.html
1•yakkomajuri•4m ago•0 comments

LFM2.5-VL-450M: Structured Visual Intelligence, Edge to Cloud

https://www.liquid.ai/blog/lfm2-5-vl-450m
1•exploraz•5m ago•0 comments

Choo Choo Words: Spell words to make train tracks, stop the train from crashing

https://choochoowords.chyuang.com/
1•yongyongyong•6m ago•0 comments

Show HN: Webhook API – inbound email –> webhook

https://www.echovalue.dev/webhook-api/
1•emiliano•7m ago•0 comments

Show HN: A terminal spreadsheet editor with Vim keybindings

https://github.com/garritfra/cell
1•garritfra•8m ago•0 comments

Carbon nanotube wiring gets closer to competing with copper

https://arstechnica.com/science/2026/04/researchers-get-carbon-nanotube-wiring-to-conduct-more-li...
2•rbanffy•9m ago•0 comments

Gatekeeping: A Partial History of Cold Fusion

https://arxiv.org/abs/2601.09996
1•derrida•9m ago•0 comments

Show HN: I built a reference site for the recurring hard problems in software

https://thehardparts.dev/
1•ludovicianul•12m ago•0 comments

Show HN: Slerp.audio – VDJ with WebGL2 and real-time DSP

https://slerp.audio/
1•poshmosh•13m ago•0 comments

Show HN: TermToMD past in choppy terminal output get clean Markdown

https://termtomd.com/
1•dbuckman•16m ago•0 comments

Gallium oxide electronics withstand extreme cold

https://discovery.kaust.edu.sa/en/article/26858/gallium-oxide-electronics-withstand-extreme-cold/
1•giuliomagnifico•16m ago•0 comments

In which Lisp generates music

https://abhirag.com/fennel-pattrns-renoise
2•abhirag•17m ago•1 comments

Entire NSF science advisory board fired by Trump administration

https://www.nature.com/articles/d41586-026-01361-7
1•beardyw•19m ago•0 comments

Isaac-Flath/Agentkb

https://github.com/isaac-flath/agentkb
1•ankitg12•19m ago•0 comments

Kinetic Displays

https://theartistbreakfast.com/
1•dsalzman•19m ago•0 comments

OpenVPN 2.7 security audit: 18 findings, one critical bug

https://srlabs.de/blog/openvpn-audit
1•MaKey•22m ago•0 comments

"48 agents thinking in one window"

https://www.threads.com/@zane___chen/post/DXndj0NAWgC
1•zane__chen•22m ago•0 comments

Carl Sagan on Military Spending and Climate Change [video]

https://www.youtube.com/watch?v=4C6co5qXEE4
1•thelastgallon•23m ago•0 comments

Electricity Provider Comparison Tool

https://elemetric.comtom.engineering/
1•comtom•26m ago•0 comments

PAuth – Precise Task-Scoped Authorization for Agents

https://arxiv.org/abs/2603.17170
1•reshabh•27m ago•0 comments

Qdrant Cluster Dashboard – Chrome Extension

https://chromewebstore.google.com/detail/qdrant-cluster-dashboard/fjhpmielkipfghonlmpjogabpfompahp
1•kulekci•27m ago•0 comments

Robinhood mass phishing incident – April 2026

https://www.reddit.com/r/RobinhoodApp/s/0c2qJaAJbW
2•yesimahuman•28m ago•0 comments

Can you tap a marathon faster than Sabastian Sawe?

https://boredzebra.com/tapathon/
1•pompomsheep•30m ago•0 comments

GeoMQTT 0.3.0

https://github.com/openfantasymap/geomqtt
1•ingmmo•31m ago•0 comments