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.

Page Transitions are now easy: CSS View Transitions

https://www.irrlicht3d.org/index.php?t=1629
1•irrlichthn•1m ago•0 comments

Microsoft's Agent Framework PyPI package compromised to steal credentials

https://www.bleepingcomputer.com/news/security/microsofts-agent-framework-pypi-package-compromise...
1•akyuu•2m ago•0 comments

If you can't explain something in simple terms, you don't understand it (2017)

https://kottke.org/17/06/if-you-cant-explain-something-in-simple-terms-you-dont-understand-it
1•sammatilda•2m ago•0 comments

Exploring the question of whether submarines can swim – by Danielle Boccelli

https://medium.com/@danielle.boccelli/exploring-the-question-of-whether-submarines-can-swim-35876...
1•rbanffy•2m ago•0 comments

Show HN: Reaktiv Workbook – A spreadsheet where every cell is Python

https://workbook.bui.app/
1•buibuibui•3m ago•0 comments

Signal Is Serious About Protecting Your Privacy

https://signal.org/blog/protecting-your-privacy/
1•dotcoma•3m ago•0 comments

AI incidents of 2026: Rogue agents, stolen keys, and other familiar stories

https://www.aikido.dev/blog/ai-incidents-root-causes-patterns
1•chillax•3m ago•0 comments

A real Linux kernel, compiled to WebAssembly

https://github.com/pithings/unkernel
1•nnx•3m ago•0 comments

Energy Wins Driving Optical Computing AI

https://spectrum.ieee.org/optical-computing-ai
1•rbanffy•4m ago•0 comments

Ask HN: Did books that went viral on HN publish their manuscript?

1•illidan1000•4m ago•0 comments

Hy4 System Card [pdf]

https://hy.tencent.ai/Hy4_system_card.pdf
1•dvaplima•5m ago•0 comments

Characterizing the Ecosystem of Open-Source Uncensored Large Language Models

https://dl.acm.org/doi/epdf/10.1145/3777912.3839799
1•Betelbuddy•8m ago•0 comments

Singularity Clock

https://www.singularityclock.ai/
1•iamanatom•8m ago•0 comments

CVEs in Plain English

https://tldrcve.com/
2•chillax•9m ago•0 comments

Maintainers don't need more AI bug reports. They need fixes

https://github.blog/open-source/maintainers/maintainers-dont-need-more-ai-bug-reports-they-need-f...
1•Betelbuddy•9m ago•0 comments

Google critical cross-tenant file access in BigQuery Studio and Colab Enterprise

https://docs.cloud.google.com/support/bulletins
1•Betelbuddy•10m ago•0 comments

Britain must not rely on foreign AI, says former military intelligence chief

https://uk.news.yahoo.com/britain-must-not-rely-foreign-180000606.html
2•nephihaha•11m ago•0 comments

Show HN: PlanCity – I find new housing developments across Europe every day

https://plancity.ai/discover/en
1•walterschnitzel•11m ago•0 comments

GTA VI: Who Governs a Global Virtual World?

https://www.eventbrite.co.uk/e/gta-vi-who-governs-a-global-virtual-world-tickets-2005073126697
1•james_in_the_uk•11m ago•1 comments

OWASP Top:2025

https://top10.owasp.org/2025/
1•Bluestein•13m ago•0 comments

Dave Patterson: How to Earn a Bad Obituary

https://www.laude.org/updates/how-to-earn-a-bad-obituary
2•bem94•13m ago•0 comments

Ken St. Andre, author of the second ever roleplaying game, has died

https://www.wargamer.com/tunnels-and-trolls/ken-st-andre-obituary
1•Michelangelo11•14m ago•0 comments

Hutter Prize

https://en.wikipedia.org/wiki/Hutter_Prize
3•doener•18m ago•0 comments

Ask HN: How do you identify video samples that were mistakenly deleted?

1•sarra01•18m ago•1 comments

Infinite scroll and autoplay are fuelling a global problem

https://www.scimex.org/newsfeed/internet-related-addictions-are-a-global-health-threat-experts-argue
3•DeepLogin•21m ago•0 comments

The Great Oxidation Event

https://en.wikipedia.org/wiki/Great_Oxidation_Event
1•simonebrunozzi•21m ago•0 comments

Veterans of the 2008 Crash Protest Anthropic's IPO

https://www.motherjones.com/politics/2026/11/anthropic-ipo-nasdaq-protest/
2•dabinat•23m ago•0 comments

We made GTA 6, world's biggest game – we should have working conditions to match

https://www.theguardian.com/commentisfree/2026/nov/18/gta-6-grand-theft-auto-vi-rockstar-employee...
6•vrganj•26m ago•0 comments

Show HN: MacVisor TPM – Virtual TPM Under Apple's Virtualization.framework

https://github.com/macvisor/macvisor-tpm
2•rohityadavcloud•26m ago•0 comments

Agent memory benchmarks need more than an overall score

https://x.com/AgentMemoryL/
3•SndOfViento•28m ago•0 comments