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.

More fun with high-speed rail in the UK

https://www.theguardian.com/uk-news/2026/jun/29/pause-hs2-reset-until-you-are-confident-it-can-be...
1•zabzonk•7m ago•0 comments

Sway typeahead command palette for the memory constrained

https://www.nilcoast.com/blog/sway-command-palette
1•be_erik•20m ago•0 comments

LLM Optimization

https://www.youtube.com/watch?v=9tvJ_GYJA-o
1•kidbomb•25m ago•0 comments

You might not need a service worker

https://www.jayfreestone.com/writing/you-might-not-need-a-service-worker/
2•Fudgel•29m ago•0 comments

Micron Suggests Apple Helped Cause Memory Price Crisis

https://www.macrumors.com/2026/06/26/micron-suggests-apple-helped-cause-memory-crisis/
8•mgh2•29m ago•1 comments

Reacting to Two French Entrepreneurs Who Built a $100K SaaS

https://thenewassociationwebmasters.blogspot.com/2026/06/from-20000-to-100000month-raw.html
1•odilelof•30m ago•0 comments

China cracks down on rule-bending offshore investments

https://www.economist.com/finance-and-economics/2026/06/28/china-cracks-down-on-rule-bending-offs...
4•andsoitis•34m ago•2 comments

The Truth about Space Data Centers [video]

https://www.youtube.com/watch?v=_qpdUNMt2yg
3•tambourine_man•40m ago•0 comments

Why can't India's government build a decent website?

https://www.economist.com/asia/2026/06/28/why-cant-indias-government-build-a-decent-website
6•andsoitis•43m ago•3 comments

A faster bump allocator for rust

https://owen.cafe/posts/stumpalo/
3•birdculture•51m ago•0 comments

AI 'exuberance' risks ending in lengthy investment bust

https://www.ft.com/content/e81ce414-e4bd-4e8c-bac7-94f7bf17def4
4•petethomas•59m ago•1 comments

Show HN: Image2JXL – a native macOS JPEG XL converter

https://old.reddit.com/r/givebest/comments/1ueh3v4/i_built_image2jxl_a_native_macos_app_for_local/
3•givebest•1h ago•0 comments

Self-learning skill for Claude: let the agent capture its own hard-won patterns

https://github.com/Kulaxyz/self-learning-skills
3•kulaxyz•1h ago•0 comments

Show HN: A site that emails you the day your Bitcoin stack hits $1M

https://amimillionaire.com/
2•pro_methe5•1h ago•2 comments

Show HN: Calybris Core, a deterministic audit engine for decisions in Rust

https://github.com/emirhuseynrmx/calybris-core
3•emirhuseyininci•1h ago•0 comments

Show HN: wavecat – a fully local personal agent that watches your screen

https://wavecat.ai/
3•sdkpanda•1h ago•0 comments

Better Images of AI

https://betterimagesofai.org/
4•Curiositry•1h ago•0 comments

We need tech news sources which exclude AI

38•botfriendsarent•1h ago•8 comments

AI Agent Credential Crisis: Six Months of Incidents

https://devfortress.net/blog/semi-annual-2026
3•arian_•1h ago•0 comments

Stanford's Hoover Inst: "The Wealth Tax: Recipe for Economic Disaster"Lionaire [video]

https://www.youtube.com/watch?v=x6k4W5Qzg8U
2•stmw•1h ago•1 comments

Mux – A tmux overlay for managing Claude Code sessions

https://github.com/fashton28/mux
3•fashton28•1h ago•0 comments

A Fresh Equation Born from Hacker News Chaos

https://zenodo.org/records/21015132
3•GerbaitedLol•1h ago•0 comments

The Grim and the Dark: Jon Heder's journey into the world of Grimdark art [video]

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

Company Cleaning Up the Reflecting Pool Says It Has 'Nothing to Hide'

https://www.wsj.com/us-news/lincoln-memorial-reflecting-pool-california-greenwater-services-729be960
5•petethomas•1h ago•0 comments

AI Agent Triggers Nuclear Strike After Getting Outmaneuvered in Civilization VI

https://decrypt.co/371877/ai-agent-nuclear-strike-civilization-vi-benchmark
7•Khaine•2h ago•1 comments

On cigarettes

https://funnelfiasco.com/blog/2026/06/28/on-cigarettes/
30•aendruk•2h ago•30 comments

Side-Stepping the Secretary Problem

https://www.evalapply.org/posts/side-step-secretary-problem-hiring/index.html
5•Curiositry•2h ago•0 comments

The Usefulness of AI Agents

https://erikjohannes.no/posts/20260408-on-the-usefulness-of-ai-agents/index.html
2•Curiositry•2h ago•0 comments

/Dev/Notion

https://www.notion.com/product/dev
5•handfuloflight•2h ago•0 comments

AI glasses are aiding cheating in exams. Test-obsessed Asia is ground zero

https://www.cnn.com/2026/06/26/asia/ai-glasses-cheating-exams-intl-hnk
4•pseudolus•2h ago•0 comments