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: Control a 3D avatar with English instead of buttons

https://programasweights.com/avatar
3•cloudyclouds•1m ago•0 comments

Everyone Has Something

https://seangeiger.substack.com/p/everyone-has-something
1•benjaminmaccini•2m ago•0 comments

The Pain of Caring for a Parent Who Abused You

https://www.nytimes.com/2026/06/15/magazine/elder-care-parent-abuse.html
1•gmays•3m ago•0 comments

Show HN: https://bill.today –> use a local folder to do your billing

https://bill.today
1•PhilKunz•4m ago•0 comments

How LLMs Work

https://arpitbhayani.me/blogs/how-llms-work/
1•devx711_123•5m ago•0 comments

AI Warfare Is at the Point of No Return. What Now?

https://www.wsj.com/world/ai-warfare-ukraine-russia-anthropic-29945df9
1•JumpCrisscross•5m ago•0 comments

Ask HN: Can a "smart diff" modernize code for app B after doing it for app A?

1•amichail•6m ago•0 comments

One AI, two AI, red AI, blue AI

https://soniafpearson.substack.com/p/one-ai-two-ai-red-ai-blue-ai
1•paulpauper•7m ago•0 comments

New Air Force One

https://www.af.mil/News/Article-Display/Article/4522274/vc-25b-bridge-aircraft-arrives-at-joint-b...
1•bear_with_me•7m ago•0 comments

Liberalism in the Age of Weaponized Interdependence

https://www.liberalism.org/p/liberalism-in-the-age-of-weaponized-interdependence
1•paulpauper•7m ago•0 comments

Show HN: slash-agent – Native LLM copilot for your terminal

https://github.com/akatzmann/slash-agent
1•akatzmann•7m ago•0 comments

Colorado's Funeral Mistake

https://marginalrevolution.com/marginalrevolution/2026/06/colorados-funeral-mistake.html
1•paulpauper•7m ago•0 comments

Introducing ChatGPT (2022)

https://openai.com/index/chatgpt/
1•pr337h4m•8m ago•0 comments

Coding a Brick Tower [video]

https://www.youtube.com/watch?v=DAMiS2PGTEE
1•tobr•8m ago•0 comments

Stem cells banish autoimmune disease for 15 years

https://www.nature.com/articles/d41586-026-01925-7
1•Brajeshwar•10m ago•0 comments

What Happens to Platform Teams?

https://curlewis.co.nz/posts/what-happens-to-platform-teams/
1•gpi•11m ago•0 comments

I Ditched Traditional Linux for NixOS

https://chrisdell.info/why-i-ditched-traditional-linux-for-nixos/
1•speckx•12m ago•0 comments

Amazon drops Sam Altman movie after announcing OpenAI partnership

https://www.the-independent.com/arts-entertainment/films/news/sam-altman-biopic-amazon-openai-dea...
3•theanonymousone•12m ago•0 comments

PreFlight – Not Another AI code review agent

https://medium.com/@jaspreetsingh_35555/code-review-used-to-work-then-the-agents-arrived-34b1572d...
1•jsingh2525•12m ago•0 comments

Show HN: Terminal UI for WG and OVPN with real time telemetry and leak guarding

https://github.com/Harry-kp/vortix
1•harrykp•12m ago•0 comments

Indiefediactivitymastoweb

https://www.gordonmclean.co.uk/2026/06/18/on-the-indiefediactivitymastoweb/
1•snowgoon•13m ago•0 comments

Russian Spam and Profanities Are Now Plaguing the Arch Linux AUR

https://www.phoronix.com/news/Arch-Linux-AUR-Russian-Spam
2•2OEH8eoCRo0•13m ago•0 comments

'We created a monster': companies rein in AI usage as costs strain budgets

https://www.ft.com/content/1d37cc08-e0aa-45a4-a45d-4ad282529314
3•fandorin•18m ago•0 comments

Continental Baths

https://en.wikipedia.org/wiki/Continental_Baths
1•davedx•18m ago•0 comments

AI Slop Cannons

https://www.augmentedswe.com/p/ai-slop-cannons-and-their-consequences
2•wordsaboutcode•19m ago•1 comments

Eater, the Verge and SB Nation Sold to Penske Media

https://www.hollywoodreporter.com/business/business-news/eater-verge-sbnation-sold-penske-media-1...
4•speckx•22m ago•0 comments

Show HN: Jumpjet – a WASM runtime for game developers

https://jumpjet.dev
1•lwansbrough•22m ago•0 comments

A terminal Markdown editor that links like Obsidian – editxr

https://editxr.org/blog/obsidian-in-the-terminal/
1•mromanuk•24m ago•0 comments

Illegal excavation reveals grand Roman villa with elaborate mosaics

https://www.cnn.com/2026/06/19/science/roman-villa-mosaics-illegal-dig-scli-intl
2•1659447091•27m ago•0 comments

The Rise of Single-Node Processing: Challenging the Distributed-First Mindset

https://www.pracdata.io/p/the-rise-of-single-node-processing
1•b-man•27m ago•0 comments