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.

A New Chapter at Twitch

https://blog.twitch.tv/en/2026/12/03/a-new-chapter-at-twitch/
1•lrae•2m ago•0 comments

Show HN: Kapoof – Black holes and burning paper for closing Mac windows

https://kapoof.app/
1•pugdogdev•3m ago•0 comments

Get notified when an outage happens

https://pushout.app/@outages
2•vasanthv•4m ago•1 comments

Show HN: PosKVM – Open SSH and VNC from the same device card

https://apps.apple.com/us/app/poskvm-remote-desktop-vnc/id6823037350
1•aribada•5m ago•0 comments

Zellij manages terminal workspaces with style

https://lwn.net/Articles/1106913/
2•signa11•6m ago•0 comments

What I learned as a hired consultant to autodidact physicists (2016)

https://aeon.co/ideas/what-i-learned-as-a-hired-consultant-for-autodidact-physicists
1•zenincognito•8m ago•1 comments

Host internal apps on a private machine with auth and permissions handled

https://innabase.com
1•johnyeocx•9m ago•0 comments

Remy – Fast, Free, Local Dictation with Cleanup

https://github.com/brysonjl/remy
1•bloff•10m ago•1 comments

Show HN: [ccbuild] A C++ build system where your build scripts are C++

https://github.com/aniket-ray/ccbuild
1•aniketray•10m ago•0 comments

Bhopal Disaster

https://en.wikipedia.org/wiki/Bhopal_disaster
5•gostsamo•11m ago•0 comments

Honeypots that hack the hacking agent back

https://github.com/NebuSec/ArtexPot
2•_____k•11m ago•0 comments

Climate change could make your daily cup of coffee cheaper, but taste less good

https://www.frontiersin.org/news/2026/12/02/frontiers-plant-science-climate-change-coffee-cheaper
1•DeepLogin•11m ago•0 comments

The unlikely policemen of Wall Street's new money machine

https://www.ft.com/content/4d20786d-bfb1-44fc-9b18-14f26e454ad6
1•petethomas•11m ago•0 comments

I'm Paying for Polish

https://blintzbase.com/posts/polish/
1•blintz•12m ago•0 comments

One APE became 268M, and ApeChain is now switched off

https://blog.everstrike.io/one-ape-became-268-million-and-apechain-is-now-switched-off-2/
1•gertnygaard•12m ago•0 comments

Autoresearch Is Goodhart on Autopilot

https://chiefofautism.com/blog/autoresearch-loops/
1•0x0ffh_local•14m ago•0 comments

Keyrings and TextOrca: a diversity-preserving, distortion-free watermark

https://mistral.ai/news/keyrings-textorca-watermark/
2•programLyrique•18m ago•0 comments

Amazon, Anthropic, Google and Others Urge Encryption Updates over AI Concerns

https://www.nytimes.com/2026/12/03/us/cybersecurity-encryption-ai-nsa.html
3•alwillis•20m ago•0 comments

Looking Back on the 2026 Midterms

https://www.anthropic.com/research/2026-midterms
2•kagaherk•22m ago•0 comments

Show HN: Say My Name – talk to your terminal, you still press Enter

https://github.com/Capybara-Consulting/say-my-name
1•CapybaraConsult•23m ago•0 comments

Be brief. Be brilliant. Be gone. – by Yue Zhao

https://www.lennysnewsletter.com/p/be-brief-be-brilliant-be-gone
1•yuezhao•23m ago•0 comments

Request for help: maintainer capacity and a path forward for go-witness #847

https://github.com/in-toto/go-witness/issues/847
1•colek42•24m ago•0 comments

Chasing Creatures in the Embedding Space

https://alpa84.github.io/chasing_creatures_in_the_embedding_space.html
2•alePan•25m ago•1 comments

AI Doesn't Mean What You Think It Does

https://cameronmpalmer.com/blog/ai-doesnt-mean-what-you-think-it-does/
1•cameronmpalmer•27m ago•0 comments

China proposes rules to stop people falling in love with humanoid robots

https://www.independent.co.uk/asia/china/china-rules-people-love-humanoid-robots-b3096103.html
7•extasetoi12•28m ago•1 comments

Show HN: I built an adventure game that teaches you chess

https://chess67.com/promised-pawn
2•k2xl•28m ago•0 comments

Diagnosis Pending: What's a Medical Breakthrough If EU Patients Can't Access It?

https://newsletter.mindthegap-tech.eu/p/ep-1-diagnosis-pending-what-is-a
1•arichardlaurent•29m ago•0 comments

He Lost Everything Betting on Sports – Except for VIP Perks at DraftKings

https://www.propublica.org/article/sports-betting-draftkings-fanduel-addiction-profile
3•pseudolus•29m ago•0 comments

Multiple LLM systems exhibit robust semantic collapse

https://www.nature.com/articles/s42256-026-01345-2.epdf?sharing_token=nBFNfCHNvC7ujFXYDMGwX9RgN0j...
2•rsoto2•32m ago•3 comments

Mistral to release crash prediction AI model

https://www.wsj.com/tech/ai/mistral-targets-automotive-sector-with-new-ai-crash-prediction-model-...
2•groar•32m ago•0 comments