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.

The Pelican Collection – Simonw Pelican Bicycle Gallery (2024-2026)

https://pelican-model-gallery.alienfluid.chatgpt.site/
1•dv35z•52s ago•0 comments

Hot Chips 2026: Irrational Recap

https://irrationalanalysis.substack.com/p/hot-chips-2026-irrational-recap
1•akshayt•9m ago•0 comments

CobaltC Programming Language Specification

https://strawberry9.github.io/the-wrong-memory/Appendix_06.html
1•VolatileRegiste•9m ago•0 comments

Celebrating Kazakhstan's first wild-born Przewalski's horse in 200 years

https://www.fauna-flora.org/news/celebrating-kazakhstans-first-wild-born-przewalskis-horse-in-200...
3•thunderbong•15m ago•1 comments

MCP server for 340k SVG icons

https://github.com/LeulAria/Aria-Icons
3•leularia•21m ago•0 comments

Our Suggestion Box

https://medium.com/luminasticity/our-suggestion-box-247d754ae1ad
1•bryanrasmussen•21m ago•0 comments

Show HN: Slock – A one-bit messenger inside your capslock key

https://github.com/jonaraphael/slock
2•jonaraphael•27m ago•2 comments

Archival Resource Keys (ARKs) serve as persistent identifiers

https://arks.org/
1•Tomte•28m ago•0 comments

Reimagining projections for the interactive maps era (2021)

https://www.mapbox.com/blog/adaptive-projections
3•gherkinnn•34m ago•1 comments

Site Is Closed on Sundays

https://v7.robweychert.com/
5•edent•37m ago•0 comments

I built an interactive networking lab for learning network engineering

https://net-forge-kappa.vercel.app/
2•OmarAfnan•38m ago•0 comments

An advanced attacker is targeting Salesforce and ServiceNow instances worldwide

https://www.reco.ai/blog/city-forum-campaign-salesforce-servicenow
3•daretograsp•41m ago•0 comments

Show HN: Public message board for limited systems

https://anystation.net/
2•jonahss•45m ago•0 comments

Switzerland's invisible skyline: why Zug towers over the rest

https://prospex.ch/blog/switzerlands-invisible-skyline-companies-by-building/
1•theanonymousone•53m ago•0 comments

A Figma clone built by GPT-6 Astra

https://wieslawsoltes.github.io/Vellum/
5•aghuang•57m ago•5 comments

Ask HN: Do you route only certain websites through a VPN?

1•dennysora-main•59m ago•1 comments

The Structured Vacuum: Thinking about Nothing [pdf]

https://rafelski.com/~johann/Books/StructVacuumE.pdf
3•rramadass•1h ago•0 comments

Revealing a Hidden Class of Task-in-Prompt Adversarial Attacks on LLMs

https://aclanthology.org/2025.acl-long.334/
1•aghuang•1h ago•0 comments

Show HN: Rust and Box2D browser physics game – build destructive machines

https://v-yanakiev.itch.io/machina
2•v-yanakiev•1h ago•0 comments

MyNoise – Custom Soundscapes for Focus, Relaxation and Sleep

https://mynoise.net/index.php
1•pan69•1h ago•0 comments

interpretation to AI agents

https://ag3497120.github.io/call-me-vera/
1•pakupaku•1h ago•0 comments

Robot writes in languages it has never seen before

https://www.wired.com/story/robot-writing/
3•euanming•1h ago•0 comments

The biggest problem in buying AI compute is credit

https://twitter.com/gpugene/status/2096427973893411312
1•MrBuddyCasino•1h ago•0 comments

Anthropic IPO launch shifts toward mid-October

https://www.cnbc.com/2026/09/05/anthropic-ipo-launch-shifts-toward-mid-october-reuters.html
3•aghuang•1h ago•0 comments

Show HN: Assist (Voice Screenshot)

https://assistapp.dev
1•abhishekucs•1h ago•1 comments

TR-106

https://en.wikipedia.org/wiki/TR-106
2•num42•1h ago•0 comments

LA District Bans Most A.I. For Students

https://www.nytimes.com/2026/09/03/us/lausd-schools-ban-ai-artificial-intelligence.html
3•narenst•1h ago•1 comments

Greenland forces Trump's US oil firm to delay drilling

https://www.theguardian.com/world/2026/aug/12/trump-greenland-oil
8•Alien1Being•1h ago•0 comments

Consciousness, creativity andunderstanding not obstacles to machine intelligence

https://link.springer.com/article/10.1007/s11229-026-05655-1
4•klaustro•1h ago•0 comments

'Huge Breakthrough' in the Math of Imbalance

https://www.quantamagazine.org/huge-breakthrough-in-the-math-of-imbalance-20260821/
2•diazc•1h ago•0 comments