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.

Heavener: What happens when you can't afford EDR licenses

https://blog.otterpwn.com/projects/heavener
1•hexagr•2m ago•0 comments

GeoSpoof vs. Geoceptor – comparing two iOS location spoofing tools

https://geospoof.com/blog/geoceptor-vs-geospoof
1•sgro•5m ago•0 comments

Ask HN: Model access depends on citizenship. What should Non-US founders do?

1•recsv-heredoc•5m ago•0 comments

Structured Primary Keys

https://modern-sql.com/blog/2026-06/structured-primary-keys
1•birdculture•6m ago•0 comments

Tell Zillow: Fee-Simple vs. Leasehold Filter

2•HoldOnAMinute•10m ago•0 comments

How to Make the World's Best Black Shirt [video]

https://www.youtube.com/watch?v=u_BdsucFI9E
1•riknos314•14m ago•0 comments

Show HN: All-in-one memory for AI Agents

https://parcle.ai/second-brain
1•longtermop•14m ago•0 comments

iOS 27 Adds Mac-Like Recovery Mode for iPhone and iPad

https://www.macrumors.com/2026/06/22/ios-27-adds-mac-like-recovery-mode/
1•antfarm•15m ago•0 comments

Show HN: RAG Vector DB Cost Calculator

https://tools.superml.org/calculators/rag-vector-db-cost-calculator
1•bps1418•16m ago•0 comments

Academy Software Foundation Launches New Wayland for Artists Working Group

https://www.aswf.io/blog/academy-software-foundation-launches-new-wayland-for-artists-working-group/
2•agluszak•17m ago•0 comments

I've built an iOS app to spoof location, no PC needed

1•alienshello•23m ago•0 comments

Skill for generating cheatsheet PDF optimized for the reMarkable eink

https://github.com/Deca/remarkable-cheatsheet
1•Decag•25m ago•0 comments

How much compute does the world need?

https://www.ft.com/content/a5475746-510b-4b3f-8039-3fea1fb7c207
1•1vuio0pswjnm7•25m ago•0 comments

US strikes Iran in response to drone strike on commercial ship

https://www.aljazeera.com/news/2026/6/26/us-strikes-iran-in-response-to-drone-strike-on-commercia...
7•thisislife2•25m ago•1 comments

OpenTag: An open-source alternative to Claude in Slack

https://github.com/CopilotKit/OpenTag/
2•davidmckayv•26m ago•0 comments

Anthropic Moves Toward Deal with US to Lift Curbs on AI Models

https://www.bloomberg.com/news/articles/2026-06-26/anthropic-moves-toward-deal-with-us-to-lift-cu...
2•mfiguiere•36m ago•0 comments

The action is off-balance sheet

https://marginpoints.substack.com/p/the-action-is-off-balance-sheet
1•historian1066•37m ago•0 comments

The Long-Term Threat to the Memory Chip Boom Is Innovation

https://www.wsj.com/finance/the-long-term-threat-to-the-memory-chip-boom-is-innovation-bb289488
2•bookofjoe•39m ago•1 comments

The open source DOCX editor submitted to HN a few weeks ago has been deleted

12•gcanyon•40m ago•5 comments

AI audio translator with speech-to-text, LLM translation, and text-to-speech

https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-content-translator-python
2•sona-coffee11•44m ago•0 comments

Show HN: RevealSafe: Buyer and seller privately submit price; reveal together

https://www.revealsafe.com/
2•wenbin•51m ago•0 comments

Show HN: A minimalist travel planner that uses wikvoyage data

https://triptip.cat
2•belforn•53m ago•1 comments

Don't Make Gates Optional, Make Them Flexible

https://wakamoleguy.com/p/flexible-gates
1•wakamoleguy•55m ago•0 comments

Trump Threatens 100% Tariffs over Digital Services Tax on U.S. Firms

https://www.cnbc.com/2026/06/26/trump-tariff-trade-tech-tax.html
6•billybuckwheat•56m ago•0 comments

The AI-Run Business Index: measuring execution, not AI adoption

https://www.leapd.ai/resources/state-of-ai-run-businesses-2026
2•Cyrus2050•56m ago•2 comments

Show HN: Even, the terminal-first desktop workspace

https://eventerm.com/
1•todience•56m ago•0 comments

Font-Family Recommendations

https://chrismorgan.info/font-family
2•birdculture•58m ago•0 comments

The Thing We All Obviously Want

https://kmicinski.com/thing-we-all-want
1•matt_d•58m ago•0 comments

Ask HN: Can distributed data centers in individual households provide UBI?

1•SuboptimalEng•1h ago•5 comments

Ask HN: If we could remake Linux in 2026, what would you change?

1•alonsovm44•1h ago•3 comments