frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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: We rebuilt the archived Kubernetes Dashboard in React 19 and Go

https://kubernetes-dashboard.com/
1•isms-core-adm•54s ago•0 comments

The Original 1965 Gatorade Recipe

https://eatshistory.com/the-original-1965-gatorade-recipe-we-made-the-drink-that-started-a-billio...
1•cratermoon•2m ago•1 comments

Automating FPGA-Based Network Switches with Protocol Adaptive Customization

https://arxiv.org/abs/2604.21881
1•PaulHoule•5m ago•0 comments

SQLite Code of Ethics

https://sqlite.org/codeofethics.html
2•zdgeier•6m ago•0 comments

Project Wycheproof tests crypto libraries against known attacks

https://github.com/C2SP/wycheproof
1•PaulHoule•11m ago•0 comments

Show HN: AirScore – Daily air-quality emails tailored to household conditions

https://getairscore.com
1•JHARDIMAN•11m ago•1 comments

Show HN: Claude-pee: use Claude -p without the programmatic usage credit pool

https://github.com/sbhattap/claude-pee/tree/main
2•subarnab•15m ago•0 comments

Microbial Dark Matter and the Search for Life on Earth

https://mceglowski.substack.com/p/microbial-dark-matter-and-the-search
1•idlewords•16m ago•0 comments

Mystery Microsoft bug leaker keeps the zero-days coming

https://www.theregister.com/security/2026/05/13/disgruntled-researcher-releases-two-more-microsof...
4•e12e•18m ago•0 comments

Show HN: Grabbit: Search secondhand marketplaces in one place

https://grabbit.app
1•RedMustard•20m ago•0 comments

Short-Term Dietary Intervention Alters Physiological Profiles Relevant to Ageing

https://onlinelibrary.wiley.com/doi/10.1111/acel.70507
3•bookofjoe•22m ago•0 comments

Claude -p headless mode cannot use Max limits, will fall under API plan

4•forgingahead•23m ago•2 comments

Israeli Tech Exposes Users of Musk's Starlink Satellite-Based Internet

https://www.haaretz.com/israel-news/security-aviation/2026-05-12/ty-article-magazine/.premium/sta...
4•bhouston•24m ago•0 comments

Show HN: Abliteration – made-to-order training data for classifiers and evals

https://abliteration.ai/use-cases/synthetic-data
1•thomadev0•25m ago•1 comments

I spent months fighting VS Code webviews, so I built a universal protocol

https://oxp.sh/
1•aldgar•30m ago•0 comments

Scorched Earth 2000 is back

http://www.scorch2000.com/web/
4•meshko•31m ago•2 comments

PSF Welcomes Hudson River Trading (HRT) as a Visionary Sponsor

https://pyfound.blogspot.com/2026/05/psf-welcomes-hudson-river-trading-hrt.html
1•lumpa•32m ago•0 comments

126 Chrome extensions collected WhatsApp data through undisclosed servers

https://malext.io/reports/WaSteal/
1•p_stuart82•34m ago•0 comments

Trump's Disappearing China Hawks

https://www.politico.com/news/2026/05/13/trump-disappearing-china-hawks-00919051
2•petethomas•34m ago•0 comments

Taking Control of the SQLite WAL

https://philipotoole.com/taking-control-of-the-sqlite-wal/
1•otoolep•35m ago•0 comments

What Is Code?

https://martinfowler.com/articles/what-is-code.html
2•nahimn•40m ago•0 comments

Toyota built a $10B private utopia–what's going on in there?

https://arstechnica.com/cars/2026/05/inside-toyotas-10b-private-utopia-big-ideas-few-people-camer...
1•PaulHoule•41m ago•0 comments

Who Trusts Sam Altman?

https://techcrunch.com/2026/05/13/who-trusts-sam-altman/
31•evo_9•42m ago•20 comments

Fame! A Misunderstanding: A new translation of Albert Camus's complete notebooks

https://lareviewofbooks.org/article/albert-camus-complete-notebooks-ryan-bloom-existentialism-abs...
1•Caiero•42m ago•0 comments

Anthropic carves all non-interactive use out of monthly subscriptions

https://venturebeat.com/technology/anthropic-reinstates-openclaw-and-third-party-agent-usage-on-c...
4•larryrubin•42m ago•1 comments

Use whatever brace style you prefer. But not this. Don't do this

https://twitter.com/akramcodez/status/2054099010571645430
1•stalfosknight•43m ago•0 comments

The Other Half of AI Safety

https://personalaisafety.com/p/the-other-half-of-ai-safety
21•sofiaqt•45m ago•8 comments

Proton's password manager passes audit by top security firm – Proton

https://proton.me/business/blog/proton-pass-audit-2026
4•abdelhousni•46m ago•1 comments

Nature's Harmonic Simultaneous 4-Day Time Cube

https://www.timecube.net
2•neko_ranger•48m ago•0 comments

End-to-end encrypted RCS messaging begins rolling out today in beta

https://www.apple.com/newsroom/2026/05/end-to-end-encrypted-rcs-messaging-begins-rolling-out-toda...
3•e12e•58m ago•1 comments