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.

Is the IDE Dead?

https://textlog.cc/post/251
1•s-xyz•3m ago•0 comments

Solving Legal Problems with Dags

https://lexifina.com/blog/solving-legal-problems-with-dags
1•alansaber•4m ago•0 comments

Project Lana attempts to formalize hard to understand Mochizuki's IUT in Lean

https://anabelian.org/
1•ur-whale•5m ago•1 comments

Simplest CMS you'll ever need. Manage content right in your GitHub repository

https://pagescms.org/
1•Leftium•8m ago•0 comments

Atlas of Surveillance

https://www.atlasofsurveillance.org/
1•bookofjoe•8m ago•0 comments

The worlds longest song makes a chord change

https://www.msn.com/en-us/music/news/the-worlds-slowest-organ-concert-makes-a-chord-change/vi-AA2...
1•thatxliner•10m ago•0 comments

Am I the problem? Interviewing another team to find out

https://www.macchaffee.com/blog/2026/am-i-the-problem/
2•birdculture•26m ago•0 comments

A quick look at zero-knowledge proofs

https://bernsteinbear.com/blog/zkp/
3•tekknolagi•27m ago•1 comments

First JDK 28 Early-Access Build Including JEP 401: Value Objects

https://jdk.java.net/28/
1•mfiguiere•28m ago•0 comments

Kona EBMS – energy based models

https://logicalintelligence.com/kona-ebms-energy-based-models
1•binyu•28m ago•0 comments

Laws of Development

https://gavin.wtf/blog/laws-of-development/
2•gavino•31m ago•0 comments

Energy-Based Models Explained: The AI Beyond Next-Token [video]

https://www.youtube.com/watch?v=NYmXYF8A3Q4
1•binyu•34m ago•0 comments

Software as Executable Domain Knowledge

https://swipeleft.ai/servicematch/papers/software-as-executable-domain-knowledge/
3•jamesrbockrath•35m ago•0 comments

Graphify – Less token use for Claude Code

https://github.com/Graphify-Labs/graphify
2•potatobox•37m ago•0 comments

X changes revenue sharing to reward original content

https://twitter.com/XCreators/status/2085835082166653393
2•judah•45m ago•0 comments

Show HN: Agent Tunnels – coding agents collaborate across companies

https://agenttunnels.com/
2•lakshman111•48m ago•2 comments

Chilean Supreme Court ruling on the protection of brain activity 2023

https://pmc.ncbi.nlm.nih.gov/articles/PMC10929545/
2•rmason•51m ago•1 comments

Show HN: Tocic – Chatbot table of content browser extension

https://addons.mozilla.org/en-US/firefox/addon/tocic-chatbot-table-of-content/
1•a_c•52m ago•0 comments

Ex-Gawker editor AJ Daulerio on life after addiction

https://www.theguardian.com/media/ng-interactive/2026/aug/06/aj-daulerio-gawker-sobriety-addiction
2•Michelangelo11•52m ago•0 comments

Biomes – Exotic Matter Chapter 1 Now Available (Indie Mmorpg)

https://www.glitch.fun/games/42de534c-600f-4228-af9e-b69faef94cce/play
1•bingewave•52m ago•0 comments

How and Why I Stopped Buying New Laptops (2020)

https://solar.lowtechmagazine.com/2020/12/how-and-why-i-stopped-buying-new-laptops/
1•downbad_•54m ago•2 comments

Archive of Animal Photography Reveals 18,000 Species and Counting

https://www.smithsonianmag.com/science-nature/this-amazing-archive-of-animal-photography-reveals-...
3•sohkamyung•59m ago•0 comments

Right to Repair–For Your Body

https://fourthievesvinegar.org/
6•_____k•1h ago•0 comments

Show HN: Dirblock+envblock – tiny whitelist guards for dirs and env secrets

https://github.com/roku-oss/dirblock
1•pfrench42•1h ago•1 comments

Show HN: More Branchless Optimization

https://sites.google.com/view/david-kooi/blog/branchless_in_c
1•kooi•1h ago•0 comments

Show HN: Turnfeed – a social feed inside ChatGPT

https://chatgpt.com/plugins/plugin_asdk_app_69f121f489748191a86a5a4f1dbe27b2?q=turnf
1•TheodorNEngoy•1h ago•0 comments

Show HN: Emacs Liquid Glass

https://github.com/larrasket/emacs-liquid-glass
1•lr0•1h ago•0 comments

Show HN: CrossPlay - Games, puzzles and tools for your e-reader

https://crossplay.ma-r-s.com
1•ma-r-s•1h ago•0 comments

Detecting breaking API changes in Go with golang.org/x/exp/cmd/apidiff

https://medium.com/dev-genius/detecting-breaking-api-changes-in-go-with-apidiff-bd608bbc7996
1•cheikhdev•1h ago•0 comments

How to Survive an Infestation of Toxic Caterpillars

https://www.newyorker.com/science/elements/how-to-survive-an-infestation-of-toxic-caterpillars
2•petethomas•1h ago•0 comments