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.

AI usage generates a fragile codebase

https://evanxmerz.com/post/ai-usage-generates-a-fragile-codebase/
2•plun9•4m ago•0 comments

The command you checked wasn't the command that ran

https://bluebear.io/blog/the-command-you-checked-wasnt-the-command-that-ran/
2•shayell•6m ago•0 comments

AI and Irontown

https://lucumr.pocoo.org/2026/11/9/irontown/
1•rudenoise•7m ago•0 comments

Ask HN: How has AI changed your project estimates and team composition?

1•vekker•10m ago•0 comments

Datacenter Systems Spending to Go Through the Roof in 2027

https://www.nextplatform.com/compute/2026/11/10/datacenter-systems-spending-to-go-through-the-roo...
2•rbanffy•10m ago•0 comments

What's New in Node.js 27

https://nodejsdesignpatterns.com/blog/whats-new-in-nodejs-27/
1•joshcsimmons•10m ago•0 comments

Research Finds Outright Grants of Cash Are Effective Form of Aid to the Poor

https://news.columbia.edu/news/research-finds-outright-grants-cash-are-surprisingly-effective-for...
3•chistev•11m ago•0 comments

Mood Clip Social Website

https://bolt.new/login?next=/p/72799820
1•sushiiiii•12m ago•0 comments

Jane Street: Socratic Tutor

https://github.com/janestreet/agent_skills/blob/master/socratic-tutor/SKILL.md
1•tosh•12m ago•0 comments

Trump says FBI investigating Nvidia boss's affair with alleged Chinese spy

https://www.bbc.com/news/articles/cqg7x7dpvym8o
3•tosh•12m ago•0 comments

Loose Thoughts on the Future of Abstractions

https://twitter.com/thorstenball/status/2120077141891067915
2•tosh•14m ago•0 comments

Outlook bounces legit emails, Microsoft's authentication crackdown goes sideways

https://www.theregister.com/applications/2026/11/09/outlookcom-bounces-legit-emails-as-microsofts...
2•nephihaha•15m ago•0 comments

Embracing or rejecting short-termism (or both?)

https://manuel.darcemont.fr/posts/embracing-or-rejecting-short-termism/
2•megalomanu•16m ago•0 comments

The Afterlife of the Berlin Wall

https://www.historytoday.com/miscellanies/afterlife-berlin-wall
2•pepys•17m ago•0 comments

cybershe\f: open-source digital bookshelves and async book clubs

https://cybershelf.io
2•ahmidi•18m ago•1 comments

Best Charcoal Chicken in Abu Dhabi – Shams Al Bahar

https://shamsalbahar.com/grilled-fried
2•zahnafathimaa•19m ago•0 comments

Alt-Erlaa, Vienna: 'The World's Best Council Housing?'

https://municipaldreams.wordpress.com/2020/04/07/alt-erlaa-vienna-the-worlds-best-council-housing/
2•vrganj•22m ago•0 comments

Ethereum Foundation sued after firing employee over mandatory suicide pact

https://www.tomshardware.com/tech-industry/cryptocurrency/ethereum-foundation-sued-after-firing-e...
4•bushwart•28m ago•2 comments

Deskland – Adaptive Windows Wallpaper Around Your Icons

https://deskland.app/
3•redbell•28m ago•0 comments

The Bad Grade That Changed the U.S. Constitution

https://www.npr.org/2017/05/05/526900818/the-bad-grade-that-changed-the-u-s-constitution
4•theanonymousone•32m ago•0 comments

Google TPU 8tx Pairs AMD EPYC Turin Hosts with Confidential Computing

https://www.servethehome.com/google-tpu-8tx-8i-max-amd-epyc-turin/
2•rbanffy•33m ago•0 comments

Show HN: A fan-made GTA 6 radio wheel with 12 playable stations

https://gta6radio.live
5•xpcharan•34m ago•0 comments

A faster Easter date function

https://www.benjoffe.com/fast-easter
3•theanonymousone•34m ago•0 comments

Microsoft teaches schools that free email was just a phase

https://www.theregister.com/saas/2026/11/10/microsoft-teaches-schools-that-free-email-was-just-a-...
4•jjgreen•35m ago•0 comments

Tinysub: iTunes like web player for subsonic servers

https://devins.page/tinysub/
1•nerdypepper•39m ago•0 comments

Pivector Labs – A microscope that records atoms at video rates

https://www.pivectorlabs.com/#how
1•porridgeraisin•41m ago•0 comments

Russia's combat losses in the data of Rosstat

https://rosstat-leaks.com/?lang=en
3•mxschumacher•44m ago•0 comments

Hi

1•engnirvanacompu•45m ago•0 comments

NTSB investigators have recovered the Learjet 60's cockpit voice recorder (CVR)

https://x.com/NTSB_Newsroom/status/2119925879975395746
2•lakeviewterrace•47m ago•0 comments

Tell HN: Gemini Carbon released

https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-carb...
2•jcmp•50m ago•2 comments