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.

The Firmbyte Gap: Why the Most Valuable Connections Never Happen

https://bjro.dev/posts/the-firmbyte-gap/
1•rapnie•1m ago•0 comments

Why you're probably going to lose money on Polymarket

https://www.msn.com/en-us/money/investment/why-you-re-probably-going-to-lose-money-on-polymarket/...
1•Gaishan•4m ago•0 comments

Voting Before the Secret Ballot

https://www.historytoday.com/archive/feature/voting-secret-ballot
1•Petiver•6m ago•0 comments

Basic linear algebra algorithms (since C++26)

https://en.cppreference.com/cpp/numeric/linalg
1•tosh•7m ago•0 comments

ShinyHunters claims – 9k schools affected by Instructure Canvas data breach

https://edscoop.com/shinyhunters-claims-nearly-9000-schools-affected-by-canvas-data-breach/
1•Gaishan•7m ago•0 comments

Everyone gets faster writes: We turned off FPW's in Neon

https://neon.com/blog/turning-off-fpw-for-faster-writes
1•tosh•9m ago•0 comments

What Makes Axavive Different from Other Supplements?

1•DeclanGrimley•12m ago•0 comments

Does structured prompting change how LLMs reason, or just what they say?

https://doi.org/10.5281/zenodo.20116625
1•h_hasegawa•14m ago•0 comments

Democratizing AI Psychosis: Why Smart People Are Captured by AI Hype

https://perilous.tech/democratizing-ai-psychosis-why-smart-people-are-captured-by-ai-hype/
1•thoughtpeddler•17m ago•1 comments

Do you take after your dad's RNA?

https://knowablemagazine.org/content/article/living-world/2026/epigenetic-effects-of-sperm-on-off...
1•asplake•20m ago•0 comments

Typing Is Being Replaced by Whispering–and It's Way More Annoying

https://www.wsj.com/tech/typing-is-being-replaced-by-whisperingand-its-way-more-annoying-a804fee7
1•petethomas•22m ago•1 comments

Microsoft's African Data Center Falters on Payment Demands

https://www.bloomberg.com/news/articles/2026-05-10/microsoft-s-african-data-center-falters-on-pay...
1•1vuio0pswjnm7•22m ago•0 comments

Show HN: ChatbotX, an open-source alternative to ManyChat

https://github.com/ChatbotXIO/ChatbotX
1•hunterist•23m ago•0 comments

Study Finds iOS Users Have Shorter Relationships as Compared to Android Users

https://finance.yahoo.com/sectors/technology/articles/hanker-dating-study-finds-ios-185300885.html
3•iamkrazy•23m ago•1 comments

Chris Hohn's hedge fund slashes $8B Microsoft stake in warning over AI

https://www.ft.com/content/ac5d90a9-b010-4529-9616-706420920681
1•1vuio0pswjnm7•24m ago•0 comments

Clone Yourself into Agents

https://lorentz.app/blog-item.html?id=soulify-the-llm
1•baalimago•25m ago•0 comments

Miii – Claude Code-level terminal workflows offline, no API keys

https://www.npmjs.com/package/miii-cli
2•maruakshay•30m ago•0 comments

Social Cognition and Interpersonal Violence

https://www.pnas.org/doi/abs/10.1073/pnas.2519361123
1•neehao•32m ago•0 comments

Pi Slate – A Raspberry Pi5 handheld Linux cyberdeck with 5" 1920×720 touchscreen

https://www.cnx-software.com/2026/05/11/pi-slate-a-raspberry-pi-5-handheld-linux-cyberdeck-with-a...
1•anonymousiam•33m ago•1 comments

Microsoft's African data center falters on payment demands, Bloomberg reports

https://www.reuters.com/world/africa/microsofts-african-data-center-falters-payment-demands-bloom...
1•1vuio0pswjnm7•34m ago•0 comments

Why You Actually Want Machines Writing the Code for Your Next Flight

https://decodingvibes.com/blog/why-you-actually-want-machines-writing-the-code-for-your-next-flight/
1•altmanaltman•39m ago•0 comments

South Korea Exploring Using Hyundai Robots as Army Numbers Fall

https://www.bloomberg.com/news/articles/2026-05-11/south-korea-exploring-using-hyundai-robots-as-...
1•petethomas•43m ago•0 comments

Growling in a corner: Samuel Johnson's lost years

https://www.commonreader.co.uk/p/growling-in-a-corner-samuel-johnsons
1•pepys•45m ago•0 comments

Europe Is Losing Its Best Engineers – Not to Emigration, but to Management

https://andrulis.de/blog/20260429_management.html
1•taubek•47m ago•0 comments

Iran mulls taking control of all 7 cables passing through Strait of Hormuz

https://www.wionews.com/world/iran-to-take-full-control-of-all-7-undersea-internet-cables-passing...
5•jonah•49m ago•0 comments

The Trouble with Narrative History

https://thereader.mitpress.mit.edu/the-trouble-with-narrative-history/
2•Hooke•50m ago•0 comments

Geography Is Four-Dimensional

https://sive.rs/4d
1•Curiositry•51m ago•0 comments

Visual Generation Unlocks Human-Like Reasoning Through Multimodal World Models

https://arxiv.org/abs/2601.19834
2•felineflock•52m ago•0 comments

Blink – AI Assistant

https://blink-oi.vercel.app
1•Pascal1997•53m ago•0 comments

Neural Machine Perception

https://openstrate.com/
1•realitymatrixyz•55m ago•0 comments