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.

Show HN: ClipTunes, string together trimmed YouTube video clips

https://cliptunes.app
1•jhedlund•26s ago•0 comments

Building for composable agentic services: nameIntel x402 via MCP

https://nameintel.io/
1•dudemanAtl•1m ago•1 comments

Sony Deletes a Bunch More Movies from the Accounts of People Who 'Bought' Them

https://www.techdirt.com/2026/07/15/sony-deletes-a-bunch-more-movies-from-the-accounts-of-people-...
1•nekusar•2m ago•0 comments

Never Been More Back

1•security1011015•4m ago•0 comments

Winners and losers in the coming AI margin collapse

https://martinalderson.com/posts/the-upcoming-ai-margin-collapse-part-2-winners-and-losers/
1•martinald•4m ago•0 comments

British Steel taken into public ownership to protect 'vital' UK supply

https://www.bbc.com/news/articles/c5y680w62wno
2•clarionbell•10m ago•0 comments

The Act and the Outcome of Creation

https://www.ssp.sh/blog/on-creation/
2•zazuke•10m ago•0 comments

SpaceX stock erases all its gains and slides below IPO price in intraday trading

https://www.latimes.com/business/story/2026-07-16/spacex-stock-erases-gains-slides-below-ipo-pric...
2•1vuio0pswjnm7•13m ago•0 comments

Regularer Expressions

https://furia.com/page.cgi?type=log&id=523
3•surprisetalk•15m ago•0 comments

The LLM Critics Are Right. I Use LLMs Anyway

https://www.theocharis.dev/blog/llm-critics-are-right-i-use-llms-anyway/
3•JeremyTheo•16m ago•0 comments

Let's Build PlanetScale from Scratch: Infrastructure

https://onatm.dev/2026/07/16/homescale-part-1/
2•onatm•17m ago•0 comments

Physicists create first room-temperature quantum material

https://phys.org/news/2026-07-physicists-room-temperature-quantum-material.html
2•smurda•17m ago•0 comments

Google and Epic give up fighting – third-party Android app stores are coming

https://www.theverge.com/policy/965792/google-epic-withdraw-injunction-third-party-app-stores-com...
2•pmontra•18m ago•0 comments

Apple sues OpenAI after ex-engineer allegedly used bug to steal trade secrets

https://arstechnica.com/tech-policy/2026/07/apple-sues-openai-after-ex-engineer-allegedly-used-bu...
2•rickdeckard•19m ago•1 comments

Brussels prepares fresh Google fines as Big Tech enforcement increases

https://www.ft.com/content/c5a880f1-aa6a-4336-b499-3ab95cf37857
2•1vuio0pswjnm7•20m ago•0 comments

Lessons from CISA's Cyber Incident

https://www.cisa.gov/news-events/news/lessons-cisas-cyber-incident
1•salmon•21m ago•0 comments

SpaceX sell-off wipes $1T from Elon Musk's rocket group

https://www.ft.com/content/94959f40-1874-4ece-b629-b18f43aa3ede
1•1vuio0pswjnm7•21m ago•0 comments

Show HN: Rackp – a protocol for deriving fault when AI agents cause incidents

https://github.com/rackp-io/rackp
1•rackp•22m ago•0 comments

Things you didn't know about indexes

https://jon.chrt.dev/2026/04/15/things-you-didnt-know-about-indexes.html
1•theanonymousone•24m ago•0 comments

Drake Anthony Recreates the Mechanical Bulb First Seen in 1675 – TechEBlog

https://www.techeblog.com/drake-anthony-styropyro-mechanical-bulb-barometric-light/
2•rbanffy•25m ago•0 comments

UK investigates TikTok over child safety measures

https://www.politico.eu/article/ofcom-investigates-tiktok-over-child-safety-measures/
1•giuliomagnifico•27m ago•0 comments

I learned to stop worrying and love ARINC 424

https://birdhalfbaked.com/how-i-learned-to-stop-worrying-and-love-arinc-424
1•CorvusCrypto•29m ago•1 comments

Chinese AI startup Moonshot to launch model challenging Anthropic's lead

https://www.ft.com/content/c6ecd8ce-c441-4d7c-aea6-fae3e28fb6ff
3•merksittich•29m ago•1 comments

The Full Stack of Society: Can You Make a Whole Society Wealthier?

https://radicalcontributions.substack.com/p/the-full-stack-of-society-can-you-make-a-whole-societ...
1•baud147258•29m ago•0 comments

Escalation Theory: Compliance, Violence, and Overachievement in Society

https://radicalcontributions.substack.com/p/escalation-theory-compliance-violence-and-overachieve...
1•baud147258•29m ago•0 comments

Show HN: I Built an Accent Changer App

https://accentchanger.com/
1•wbemaker•29m ago•0 comments

Do you put rules or examples in your LLM context?

https://blog.getcassis.com/derivation-distance/
4•aloys_hn•33m ago•0 comments

Engineer made built in memory, loop detection and audits mandatory for agents

https://github.com/RyjoxTechnologies/Octopoda-OS
1•JosephjackJR•33m ago•1 comments

Help me be accountable with my time

1•atomiomi•34m ago•0 comments

Spotify reportedly removed over 75M AI-slop songs from its platform

https://www.neowin.net/news/spotify-reportedly-removed-over-75-million-ai-slop-songs-from-its-pla...
1•jenic_•35m ago•1 comments