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 Economics Behind the Spurs

https://bycig.substack.com/p/the-economics-behind-the-spurs
1•paulpauper•2m ago•0 comments

Has AI Killed How-To Nonfiction?

https://tim.blog/2026/06/12/has-ai-already-killed-nonfiction/
1•paulpauper•3m ago•0 comments

Sometimes it is hard to solve for the equilibrium

https://marginalrevolution.com/marginalrevolution/2026/06/sometimes-it-is-hard-to-solve-for-the-e...
1•paulpauper•3m ago•0 comments

'The traveler' book review: An enlightening voyage

https://www.wsj.com/arts-culture/books/the-traveler-review-an-enlightening-voyage-e9754ecb
1•hhs•5m ago•0 comments

Coronavirus and Credibility (2020)

https://paulgraham.com/cred.html
1•downbad_•5m ago•0 comments

White House's export limits on Anthropic linked to concerns about Chinese access

https://www.semafor.com/article/06/13/2026/white-house-move-to-limit-anthropic-linked-to-concerns...
3•shscs911•11m ago•1 comments

Getting Creative with Perlin Noise Fields

https://sighack.com/post/getting-creative-with-perlin-noise-fields
2•0x000xca0xfe•15m ago•0 comments

Ancient genome duplications laid the foundations of complex brains

https://www.ox.ac.uk/news/2026-06-09-ancient-genome-duplications-laid-the-foundations-of-complex-...
1•hhs•16m ago•0 comments

The 27 Platform Releases – June 2026

https://developer.apple.com/documentation/Updates
1•Austin_Conlon•16m ago•0 comments

Four by Three

https://www.hankgreen.com/fourbythree
1•_tk_•20m ago•0 comments

New research reveals how brains update their predictions

https://source.washu.edu/2026/06/new-research-reveals-how-brains-update-their-predictions/
1•hhs•21m ago•0 comments

LazyOwn RedTeam Framework

https://github.com/grisuno/LazyOwn
1•grisun0•24m ago•1 comments

Derbyshire Police officer accused of using AI to 'create evidence'

https://www.bbc.com/news/articles/cy8wppwdxl6o
4•healsdata•27m ago•0 comments

Hans Schulz – The father of the VEF Minox lens?

https://moments-of-now.com/hans-schulz-the-father-of-the-vef-minox-riga-lens/
1•throwaway81523•27m ago•0 comments

Wirth's Law

https://en.wikipedia.org/wiki/Wirth%27s_law
1•RinTohsaka•35m ago•0 comments

Designing Software for Software Factories

https://blog.sshh.io/p/designing-software-for-software-factories
1•sshh12•36m ago•0 comments

The Ruby JRuby Was Built to Run

https://intertwingly.net/blog/2026/06/11/The-Ruby-JRuby-Was-Built-to-Run.html
1•mooreds•39m ago•0 comments

Rails: The Sharp Parts. Lock Is Not a Mutex

https://baweaver.com/writing/2026/06/05/rails-sharp-parts-lock-is-not-a-mutex/
1•mooreds•39m ago•0 comments

Timeline of HN

https://news.ycombinator.com/threads?id=ChrisArchitect
5•razor-thin•40m ago•0 comments

LLM Token Price Index

https://tokenpriceindex.com
2•zurtri•42m ago•1 comments

Building a Functional Lego Typewriter [video]

https://www.youtube.com/watch?v=ZIWTSkCVxjk
1•vinnyglennon•42m ago•0 comments

Battery recycling boom exposes schoolchildren to lead

https://www.ft.com/content/19beeed4-8c99-4de3-a163-9301210634ad
1•petethomas•44m ago•0 comments

VTubeMe

https://vtubeme.com
1•alekcac•46m ago•1 comments

Show HN: Pebble, an open-source alternative to Minecraft: Java Edition

https://github.com/thebriangao/pebble
1•briangao•48m ago•1 comments

Is the Twenty-First Century a Creative Void?

https://yalereview.org/article/audrey-wollen-david-marx-blank-space
1•tintinnabula•49m ago•0 comments

Show HN: How to prevent spam and disposable signups

https://emailverify.se/
1•the_plug•49m ago•1 comments

Amazon security research reportedly led to the White House's Anthropic Fable ban

https://www.theverge.com/ai-artificial-intelligence/949601/amazon-anthropic-fablemythos-governmen...
2•kikibobo69•49m ago•0 comments

W.H. Auden and James Schuyler in life and literature

https://hedgehogreview.com/web-features/thr/posts/companions-on-parnassus
2•Caiero•55m ago•0 comments

Bubbles.town – posts aggregated from 5007 independent, personal blogs

https://bubbles.town/
2•Curiositry•57m ago•0 comments

Rio 3.5 Open 397B – from Rio de Janeiro's city government

https://huggingface.co/prefeitura-rio/Rio-3.5-Open-397B
3•mcyc•1h ago•2 comments