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.

Constellation Draw

https://neal.fun/constellation-draw/
1•webninja•4m ago•0 comments

Signs Your S3 May Be Slowing Down Your SoC

https://scanner.dev/blog/7-signs-your-s3-may-be-slowing-down-your-soc
1•flw_0311•7m ago•0 comments

Software engineering may no longer be a lifetime career

https://www.seangoedecke.com/software-engineering-may-no-longer-be-a-lifetime-career/
2•webninja•9m ago•1 comments

The Full-Cycle Agentic Experience

https://normalphd.substack.com/p/the-full-cycle-agentic-experience
1•dooku0721•11m ago•0 comments

Ask HN: Views on abilities of large cos to disrupt supply

1•sourcegrift•12m ago•1 comments

The Brink of Global Recession [audio]

https://www.theatlantic.com/podcasts/2026/04/david-frum-show-adam-posen-global-recession/686900/
1•BiraIgnacio•13m ago•0 comments

Global energy shock tests limits of oil reserves

https://mondediplo.com/2026/05/02energy
1•JumpCrisscross•16m ago•0 comments

Palantir: Why its political manifesto is causing a stir

https://www.dw.com/en/palantir-why-its-political-manifesto-is-causing-a-stir/a-76895480
2•trhway•18m ago•0 comments

Musk vs. Altman: The CEO on Trial

https://precognewsnow.substack.com/p/musk-v-altman-the-ceo-on-trial
2•0xPetra•19m ago•1 comments

Cloudflare launches feature flags with "Flagship"

https://blog.cloudflare.com/flagship/
1•sgammon•21m ago•0 comments

Is there any proof that scrolling ruins our attention span? [video]

https://www.bbc.com/reel/video/p0nfykf2/watch
3•jethronethro•21m ago•0 comments

Ask HN: What Makes AI a Bubble?

2•atleastoptimal•24m ago•3 comments

Tell HN: Site Is Trash Now

6•AndyKelley•30m ago•2 comments

China's DeepSeek prices new V4 AI model at 97% below OpenAI's GPT-5.5

https://www.scmp.com/tech/tech-trends/article/3351595/chinas-deepseek-prices-new-v4-ai-model-97-b...
3•akyuu•30m ago•0 comments

Steam Controller: Official Overview and Quick Start Guide [video]

https://www.youtube.com/watch?v=a55UIaiTE-A
2•LandenLove•33m ago•0 comments

Tracking the history of the now-deceased OpenAI Microsoft AGI clause

https://simonwillison.net/2026/Apr/27/now-deceased-agi-clause/
2•yakkomajuri•34m ago•0 comments

What is physical AI?

https://www.ibm.com/think/topics/physical-ai
1•teleforce•35m ago•0 comments

What's new in pip 26.1 – lockfiles and dependency cooldowns

https://ichard26.github.io/blog/2026/04/whats-new-in-pip-26.1/
1•sashk•36m ago•0 comments

Larry Ellison's Wealth Differs from Other Tech Billionaires

https://www.wsj.com/finance/larry-ellison-net-worth-wealth-5571ca5d
3•JumpCrisscross•40m ago•0 comments

New Integrated by Design FreeBSD Book

https://vivianvoss.net/blog/integrated-by-design-launch
16•vermaden•42m ago•0 comments

Ukraine's drone commander has Russian oil, troops and morale in his sights

https://www.bbc.com/news/articles/c1d9wvd2e4ro
27•tkgally•47m ago•6 comments

The NYC Law on Metal Gates That Nearly Everyone Forgot About

https://www.nytimes.com/2026/04/24/nyregion/metal-gates-city-council-law.html
2•JumpCrisscross•49m ago•0 comments

Reddit no longer allowing mobile users to browse on web

https://old.reddit.com/r/help/comments/1sudaup/reddit_no_longer_letting_me_browse_on_my_phone/
4•darth_avocado•50m ago•2 comments

Show HN: I build an automation that back my Claude chat to a ticketing system

1•xnslx•52m ago•0 comments

Free paycheck calculator for all 50 US states

https://takehometool.com/
1•ahcstudio•52m ago•0 comments

Show HN : Tickword – Chain the words. Dont let the clock catch you

https://tickword.com/en
1•Jekooo•54m ago•3 comments

Intuitive Understanding of PCA

https://ai.ragv.in/posts/intuitive-understanding-of-pca/
1•kn81198•57m ago•0 comments

Why on-chain options are still thin (and a liquidity model that fixes it)

https://rohanrathod.ai/writing/on-chain-options-liquidity
1•ro_lend•59m ago•0 comments

Late pregnancy is pretty bizarre

https://viverricious.substack.com/p/late-pregnancy-is-pretty-bizarre
1•eatitraw•59m ago•0 comments

Predicting the Future (2001) - Strategic Uncertainty 25 years later[pdf]

https://library.rumsfeld.com/doclib/sp/2382/2001-04-12%20To%20George%20W%20Bush%20et%20al%20re%20...
2•pollorollo•1h ago•0 comments