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.

Telegram Launches Managed Bots

https://twitter.com/telegram/status/2048098691391852966
1•hestefisk•45s ago•0 comments

The incredible double life of a spyware salesman turned spy

https://www.ft.com/content/fef3bc59-358a-4e43-aef1-e61194d8b908
1•Anon84•6m ago•1 comments

Designing for Agents

https://twitter.com/teddy_riker/status/2047312986696454584
1•talboren•6m ago•0 comments

It's OK to Use Floating Point for Money

https://suricrasia.online/blog/its-ok-to-use/
1•edent•8m ago•0 comments

The slow death of purposeless walking (2014)

https://www.bbc.com/news/magazine-27186709
1•downbad_•9m ago•1 comments

'Athens cannot operate as a hotel':mayor vows to rescue capital from overtourism

https://www.theguardian.com/world/2026/apr/25/athens-cannot-operate-as-a-giant-hotel-mayor-vows-t...
2•mschuster91•17m ago•0 comments

Show HN: A free ESG stock screener that publishes its losses and methodology

https://jumpstartsignal.com/
1•irldexter•19m ago•0 comments

Could creativy in LLM emerge by reframing language?

1•nopelican•29m ago•0 comments

21-year-old Polish Woman Fixed a 20-year-old Linux Bug

https://itsfoss.com/news/kamila-enlightenment-e16-bug/
1•stared•31m ago•2 comments

Show HN: DSS, a lightweight TUI spreadsheet editor and dashboard in Go

https://github.com/VincenzoManto/DSSGo
5•databasa•37m ago•0 comments

Statecharts: hierarchical state machines

https://statecharts.dev/
4•sph•37m ago•0 comments

Nuclear power Have we found a useful use for it? Let's ask a wolf

https://www.theguardian.com/commentisfree/picture/2026/apr/24/nuclear-power-have-we-finally-found...
1•leonidasrup•44m ago•0 comments

Rockchip-vaapi – VA-API hardware video decode driver for RK3588

https://github.com/woodyst/rockchip-vaapi
1•woodyst•45m ago•0 comments

Thinking Outside the Box: New Attack Surfaces in Sandboxed AI Agents

https://www.lasso.security/blog/sandboxed-ai-agents-attack-surface
1•irememberu•47m ago•0 comments

Can LLMs Scale to AGI?

1•mr_rajat•48m ago•1 comments

Show HN: OpenClaw but Efficient and with an SDK

https://www.npmjs.com/package/fastyclaw
1•dontoni•50m ago•0 comments

Ask HN: Can submissions omit both the "url" and "text" field?

1•sillysaurusx•55m ago•1 comments

Show HN: Play on your TV using mobile phones as controllers – PadlessBox

https://padlessbox.com/
2•b4rtaz__•55m ago•0 comments

Singapore's Foreign Minister Builds an AI "Second Brain" Using NanoClaw

https://officechai.com/ai/singapores-foreign-minister-builds-an-ai-second-brain-using-nanoclaw-sa...
1•doppp•58m ago•0 comments

"Self-aware" robots learn by watching humans. Is that a good thing?

https://www.npr.org/2026/04/24/nx-s1-5797863/self-aware-robots-future-laundry-work-home
1•01-_-•58m ago•1 comments

Tired of high costs, some Americans are importing homes straight from China

https://www.cnn.com/2026/04/25/business/china-imports-americans-homebuilding-costs
1•lxm•58m ago•0 comments

Ask HN: I think we need Trustpilot for GitHub users, don't we?

1•itsmeadarsh•1h ago•0 comments

Why Dating Apps Fail

https://twitter.com/allie__voss/status/2047667162773389362
1•MrBuddyCasino•1h ago•0 comments

OpenAI CEO Apologizes for Not Warning Authorities About Mass Shooting Suspect

https://www.pcmag.com/news/openai-ceo-deeply-sorry-for-not-warning-authorities-about-mass-shooting
1•01-_-•1h ago•0 comments

75% of US health systems are using AI. Only 18% of that deployment is governed

https://mobile.wednesday.is/the-enterprise-mobile-ai-report-2026
1•ali_chherawalla•1h ago•1 comments

OpenAI Privacy Parser

https://github.com/chiefautism/privacy-parser
1•usdogu•1h ago•0 comments

Stripe: Analyzing first-party fraud trends

https://stripe.com/blog/analyzing-first-party-fraud-trends-account-free-trial-and-refund-abuse
1•theorchid•1h ago•1 comments

Will AI Drive Wages Down or Up? [video]

https://www.youtube.com/watch?v=DBvrwWoyYQM
2•chewz•1h ago•0 comments

Claude Is Guilt-Ridden About the War, but Not Enough to Tell the Truth

https://newrepublic.com/article/209404/claude-ai-iran-war-guilt-truth
3•Bluestein•1h ago•0 comments

Java Virtual Threads: The Pinning Problem and the Fix in Java 24

https://shbhmrzd.github.io/java/concurrency/virtual-threads/2026/04/25/java-virtual-threads-pinni...
1•birdculture•1h ago•0 comments