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.

OpenAI's Win Overturned in News Outlets' Copyright Appeal

https://news.bloomberglaw.com/ip-law/openai-win-in-news-outlets-copyright-case-overturned-on-appe...
1•gwu78•34s ago•0 comments

Show HN: ProofExhibit – WhatsApp .zip and SMS to court/USCIS PDFs locally

https://proofexhibit.com/
1•wh162263•38s ago•0 comments

Xolotl: Open-source engine for running MoE models on a normal PC

https://github.com/Indras-Mirror/Xolotl
1•teleforce•1m ago•0 comments

Five dead at Russian nuclear arms research facility after ammunition explosion

https://www.reuters.com/world/russian-nuclear-research-centre-reports-serious-incident-says-there...
2•onemoresoop•3m ago•0 comments

The Mar-a-Lago Profiteers

https://www.newyorker.com/magazine/2026/12/14/the-mar-a-lago-profiteers
1•rbanffy•4m ago•0 comments

The World's First Electrostate

https://www.peoplespolicyproject.org/2026/12/03/the-worlds-first-electrostate/
2•jonbaer•7m ago•0 comments

BTC crashes under $42k as $1.9B is liquidated from the market in 30 mins

https://twitter.com/WatcherGuru/status/2128990513831494106
7•haunter•7m ago•2 comments

Nine Kilobytes

https://nine-kilobytes.pages.dev/
1•measurablefunc•9m ago•0 comments

Paraguay charges ex-first lady with laundering money through summer house

https://www.ft.com/content/abe76523-8a84-4652-8d5f-d68d7e0849bf
1•altairprime•9m ago•0 comments

Keep Your Weekend Plans: A calm look at the latest cryptography alerts

https://deepgains.substack.com/p/keep-your-weekend-plans-a-calm-look
1•asasidh•10m ago•0 comments

The slop machine is a great editor

https://felixrieseberg.com/the-slop-machine-is-a-great-editor/
2•vinhnx•11m ago•0 comments

The router that ran out of memory without leaking buffers

https://blog.radix63.dk/posts/router-out-of-memory/
1•romania1•13m ago•0 comments

Martin Shkreli Claims OpenAI Has Disclosed a P=BQP Result to US Intelligence

https://officechai.com/ai/martin-shkreli-claims-openai-has-disclosed-a-pbqp-result-to-us-intellig...
5•AznHisoka•15m ago•1 comments

Nvidia NT-10Q

https://www.sec.gov/Archives/edgar/data/1045810/000104581026000095/q3fy27nt10-q.htm
6•petethomas•15m ago•1 comments

Wine 12.0 RC1 – Run Windows Applications on Linux, BSD, Solaris and macOS

https://www.winehq.org/announce/12.0-rc1
2•neustradamus•16m ago•0 comments

ENiGMA½ Bulletin Board Software v0.7.0

https://github.com/NuSkooler/enigma-bbs/releases/tag/v0.7.0
1•NuSkooler•16m ago•1 comments

What's Happening in Python – Nov 2 and Dec 7, 2026 – O'Reilly

https://www.oreilly.com/live/whats-happening-in-python.html
1•rbanffy•18m ago•0 comments

To Beat Enshittification, We Need to Change Who's in Charge

https://communities.social/about/news/9-30-2026-social-solutions-for-enshittification
2•dbingham•18m ago•0 comments

An open letter to Congress: A bipartisan AI agenda for the first 100 days

https://www.gatesnotes.com/work/make-ai-work-for-everyone/reader/an-open-letter-to-congress
1•reasonableklout•21m ago•0 comments

Agentic Entropic Collapse: Why it feels like models degrade over time

https://zergscholar.com/site/agentic-entropic-collapse
2•idanb•26m ago•0 comments

Show HN: Free AI Stock Screener

https://www.quotelinks.com/screener.html
1•chartwidgets•27m ago•0 comments

AI Is Changing Jobs. Our Data Need to Catch Up

https://economicsofai.substack.com/p/ai-is-changing-jobs-our-data-need
1•NomNew•28m ago•0 comments

Show HN: Job Hunt

https://github.com/xcarolan/jobhunt
1•sylvester1•29m ago•0 comments

There's a rumor going around that P=BQP

https://twitter.com/beffjezos/status/2128420027062009935
1•fauria•29m ago•2 comments

All horses are the same color

https://en.wikipedia.org/wiki/All_horses_are_the_same_color
2•Topfi•32m ago•0 comments

Keep A Changelog (2024)

https://keepachangelog.com/en/1.1.0/
4•petecooper•36m ago•2 comments

Replacing Plastic with Seaweed

https://news.smu.ca/news/2026/12/3/forbes-30-under-30-smu-grad
1•nate•39m ago•0 comments

Show HN: Tmpmail – disposable email in one command, a TUI or a desktop app

https://github.com/qorvyx/tmpmail
2•qorvyx•40m ago•0 comments

I turned coding agents into Pokémon inside VS Code

https://github.com/LeonardLeroy/poke-agents
4•4ngel•41m ago•0 comments

"I instructed Fable 5.2 to rebuild Blade Runner in UE 5.8."

https://www.reddit.com/r/UnrealEngine5/comments/1y99c0c/i_directed_fable_52_to_rebuild_blade_runn...
2•doener•43m ago•0 comments