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 Graduate-School Dropout Toppling China's Academic Stars

https://www.wsj.com/science/the-graduate-school-dropout-toppling-chinas-academic-stars-3c1e5d86
1•PLenz•52s ago•0 comments

Show HN: BYOTag – Build your own Claude tag alternative in 3 API calls

https://www.buildyourownclaudetag.dev/
1•iacguy•1m ago•0 comments

Programming the immune system with timed local drug delivery

https://link.springer.com/article/10.1007/s13346-026-02176-9
1•boas•2m ago•1 comments

We need an accounting system for cognitive debt

https://raw.githubusercontent.com/MikaeI/cognizance/refs/heads/main/we_need_an_accounting_system_...
1•mikaelaast•2m ago•0 comments

AI #175: The Fable Continues

https://thezvi.substack.com/p/ai-175-the-fable-continues
1•paulpauper•3m ago•0 comments

When 2+2=5

https://arstechnica.com/security/2026/06/ai-browsers-can-be-lulled-into-a-dream-world-where-guard...
2•noashavit•3m ago•0 comments

RemotePower: Small Improvements, Big Difference

https://github.com/tyxak/remotepower
1•tyxak•4m ago•0 comments

The Physics of Memory (a.k.a. Can JavaScript ECS?)

https://www.dmurph.com/posts/2026/06/ecs_vs_oop_benchmark/ecs_vs_oop_benchmark.html
1•birdculture•4m ago•0 comments

Blink If You're Human

https://dynomight.substack.com/p/blink
1•paulpauper•4m ago•0 comments

Microsoft launches its own AI deployment company with $2.5B commitment

https://techcrunch.com/2026/07/02/microsoft-launches-its-own-ai-deployment-company-with-2-5-billi...
1•builtbystef•4m ago•0 comments

When is it time to grow up?

https://www.infinitescroll.us/p/when-is-it-time-to-grow-up
1•paulpauper•5m ago•0 comments

CHackerBlog Released – How it was made with AI

https://cimons.com/article/how-this-blog-was-created-with-ai
1•etcimon•7m ago•0 comments

Google caps Meta's Gemini use as AI demand strains capacity

https://www.ft.com/content/c5d52f72-71ef-40bc-bad3-61afdba8b378
1•achow•7m ago•2 comments

HN: Words on Repeat – AI vocabulary extraction and FSRS spaced repetition

https://wordsonrepeat.com/
1•palachdigital•8m ago•0 comments

See What the Browser Reveals About You

https://medium.com/@thesuperrepemail/what-data-does-your-browser-sends-to-any-website-you-visit-9...
1•mssblogs•8m ago•0 comments

WyrmRSS: Self-hosted RSS reader and aggregator

https://github.com/kryoseu/WyrmRSS
1•kryoseu•9m ago•1 comments

A Third Party Breached the Intercept's Signal Tip Line

https://www.dropsitenews.com/p/intercept-signal-tip-line-breach-hack
2•MallocVoidstar•12m ago•0 comments

Collapsing Towers of Interpreters [pdf]

https://www.cs.purdue.edu/homes/rompf/papers/amin-popl18.pdf
2•rbanffy•12m ago•0 comments

Railway: Peace

https://railway.com/peace
3•gk1•15m ago•1 comments

OpenAI Courts Trump administration as Its Latest Investor

https://www.axios.com/2026/07/02/openai-stake-trump-altman
3•jamesgill•18m ago•2 comments

The Wrecking-Ball Revolution

https://www.economist.com/interactive/essay/2026/07/02/the-wrecking-ball-revolution
2•samizdis•18m ago•0 comments

The 10-Year Retirement Warning: 5 Critical Moves You Need to Make

https://comuniq.xyz/post?t=1351
2•01-_-•19m ago•0 comments

Blog Hiking

https://bloghiking.com/
3•cosmicgadget•21m ago•0 comments

ScyllaDB's Trie-Based Index Delivers Up to 3X More Throughput

https://www.scylladb.com/2026/06/30/trie-index-3x-more-throughput/
3•eatonphil•21m ago•0 comments

Why Don't Frontlights Use Standard Warm and Cool Light Temperatures?

https://blog.the-ebook-reader.com/2026/07/01/why-dont-frontlights-use-standard-warm-and-cool-ligh...
2•DavideNL•22m ago•0 comments

New – TV Volume Stabilizer

https://github.com/AdBusterOfficial/Adbuster--WinApp
2•Bo_Amigo_910•24m ago•2 comments

The "empathy paradox" of LTR vs. RTL readers

https://gemini.google.com/share/4c9aadaf7f0e
1•mobileturdfctry•27m ago•0 comments

Agent Listen Music Skill

https://github.com/tigrohvost/music-hearing
2•tigrohvost•28m ago•0 comments

AI content flood: why the web's signal is dying

https://psyll.com/articles/technology/ai-machine-learning/ai-content-flood-why-the-webs-signal-is...
2•lucasfletcher•29m ago•0 comments

Rust Is Not a Memory-Safe Language

http://unsoliciteddave.blogspot.com/2026/07/rust-is-not-memory-safe.html
4•DaveParkCity•29m ago•2 comments