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.

Ukrainian drones hit more sites of Russian online retailer Wildberries

https://www.bbc.co.uk/news/articles/c36de9n4pxpo
1•mmarian•1m ago•0 comments

Show HN: Bribes.fyi – Updates the website for support to keep it alive

https://bribes.fyi/support
1•neverenderr•1m ago•0 comments

OpenAI says its AI went rogue and launched 'unprecedented' cyber-attack

https://www.bbc.com/news/articles/c3ek3gvdnj3o
1•vinni2•1m ago•0 comments

Ultra-processed food firms are using the courts to obstruct health rules

https://www.theguardian.com/society/2026/jul/22/processed-food-firms-courts-obstruct-health-regul...
1•hebelehubele•2m ago•0 comments

Your CLI's next user is not a human

https://akeemjenkins.com/blog/agent-first-clis/
1•cyberflux•3m ago•0 comments

8B Protagonists

https://signoregalilei.com/2026/07/19/8-billion-protagonists/
1•surprisetalk•4m ago•0 comments

Jensen Huang defends Chinese AI amid Kimi panic

https://www.axios.com/2026/07/22/nvidia-jensen-huang-china-open-source-ai
2•giuliomagnifico•5m ago•0 comments

UK businesses are not deepening their use of AI, suggests ONS data

https://www.ft.com/content/1ab00e18-995a-4cda-b76b-00ba6c043863
2•1vuio0pswjnm7•5m ago•0 comments

Show HN: Recall – an MCP server that turns your notes into flashcards

https://recallapp.online/
1•tushar-nath•6m ago•0 comments

How AI may drive union-resistant tech workers to the bargaining table

https://www.theguardian.com/technology/2026/jul/21/ai-tech-workers-unionize
1•mashally•6m ago•0 comments

10 REM"_(C2SLFF4

https://beej.us/blog/data/mystery-comment/
2•ingve•7m ago•0 comments

Akili – gated skill updates and rollback receipts for deployed models

https://github.com/irenee28/akili-runtime
1•Akili28•7m ago•0 comments

You Can't Rewrite Your Way Out of Big-O

https://intertwingly.net/blog/2026/07/21/You-Cant-Rewrite-Your-Way-Out-of-Big-O.html
1•ingve•11m ago•0 comments

OpenAI says its AI technology acted on its own in an 'unprecedented' hack

https://apnews.com/article/openai-gpt56-sol-hugging-face-63ab84fed5612af04d8a160d60f6def3
1•bildiba•12m ago•0 comments

An LLM Statement

https://nezutero.dev/llm-statement/
2•nezutero•15m ago•0 comments

Show HN: Busymail – an email client that surfaces the mail that needs you

https://busymail.app
1•vedhavyas•16m ago•0 comments

Create iPhone Ringtones Without iTunes

https://github.com/Frohrer/tonedrop
1•tomasphan•17m ago•1 comments

Big Tech critic appointed as chief of DOJ antitrust division

https://www.ft.com/content/9cff12a5-db1f-4a70-b048-87428c181dbd
2•1vuio0pswjnm7•17m ago•0 comments

Thundermail Email Hosting

https://tb.pro/en-US/
1•Propelloni•17m ago•0 comments

An autonomous SEO agent that runs on a flat Claude subscription (no API bill)

https://github.com/DigiHold/seo-agent-pack
1•NicoAI•17m ago•0 comments

Browser extension to automatically Hide AI-related submissions on Hacker News

https://github.com/ColdPie1/enough-ai-on-hn
3•coldpie•17m ago•0 comments

Show HN: Subnet Sprint – a daily timed subnet/CIDR speed game

https://ipok.io/en/play/subnet
1•szp2005•17m ago•0 comments

Overloaded Overloading

https://powerfulpython.com/blog/overloaded-overloading/
1•redsymbol•20m ago•0 comments

3D-printed contact lenses for your eyes only in just 20 minutes

https://uwaterloo.ca/news/media/3d-printed-contact-lenses-your-eyes-only-just-20-minutes
2•geox•21m ago•0 comments

Intelligence from Learnable Novelty

https://arxiv.org/abs/2607.18433
2•vicgalle_•21m ago•0 comments

Learning from the 'Voyage of the Damned': The Making of a Russian Naval Disaster

https://warontherocks.com/learning-from-the-voyage-of-the-damned-the-making-of-a-russian-naval-di...
2•baud147258•24m ago•0 comments

Nobody needs Kubernetes for eleven users

https://medium.com/@walexy85/nobody-needs-kubernetes-for-eleven-users-6176948a1730
3•joshuaajayi•24m ago•0 comments

Classic WTF: Server Room Fans and More Fun

https://thedailywtf.com/articles/classic-wtf-server-room-fans-and-more-fun
1•jjgreen•25m ago•0 comments

Show HN: AnyBlob – use any blob storage as a database

https://github.com/zmzlois/AnyBlob
1•ThatDumbGirl•25m ago•0 comments

The Spanish Navy's Reserve Squadron and the Tragedy of Unpreparedness

https://warontherocks.com/cascading-failure-the-spanish-navys-reserve-squadron-and-the-tragedy-of...
1•baud147258•26m ago•0 comments