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.

OS X hack to use your Mouse and Trackpad together with two different screens

https://github.com/vepkenez/DualCursor
1•damon_c•1m ago•1 comments

Show HN: A Background Agent to Fix Breaking Changes in Dependency Updates

https://www.arnaudrenaud.com/articles/fix-deps-breaking-changes-with-background-agent/
1•frrdinand•1m ago•0 comments

jQuery 4.1.0 and 3.8.0 Released

https://blog.jquery.com/2026/11/17/jquery-4-1-0-and-3-8-0-released-passing-the-torch/
1•timmywil•2m ago•0 comments

Deepfakes and Executive Impersonation (Hacker Halted ATL)

https://inteledge360.com/publications/deepfakes-executive-impersonation
1•elcazador•2m ago•0 comments

Jensen Huang Daughter: Hot-Headed Nepo Baby Insulted Staff, Led 12 Execs to Quit

https://www.ibtimes.sg/madison-huang-jensen-huangs-daughter-was-nvidias-hot-headed-nepo-baby-who-...
1•randycupertino•2m ago•0 comments

Show HN: Professor Euler – Offline math desk, 300-function CAS, workbooks

https://euler.dawei7.com
1•dawei7•3m ago•0 comments

Show HN: Skif – An ultra fast alternative to Knip, Sherif and Syncpack

https://github.com/polylint/skif
1•nhirschfeld•4m ago•0 comments

SpaceX Debt for AI Chips to Hit Market as Soon as This Week

https://www.bloomberg.com/news/articles/2026-11-17/spacex-debt-for-ai-chips-to-hit-market-as-soon...
1•petethomas•5m ago•0 comments

Show HN: Whiz.pub – An AI-native blogging platform, free and donation-supported

https://whiz.pub
1•xprilion•6m ago•0 comments

Apple faces French trial over alleged planned obsolescence of iPhones

https://us.afpnews.com/article/?apple-faces-french-trial-over-alleged-planned-obsolescence-of-iph...
2•sdeframond•6m ago•0 comments

Find Yourself in GTA VI

https://pew.studio
1•fatadel•7m ago•0 comments

Airbyte Is Down

https://status.airbyte.com
1•kaveet•8m ago•0 comments

Allow John Mulaney to explain the solution to all your eldercare needs

https://slate.com/culture/2026/11/snl-sister-skit-john-mulaney-elder-care-musical.html
1•mooreds•9m ago•0 comments

Unofficial Tangled CLI

https://tangled.org/aly.codes/tg
1•jcbhmr•9m ago•0 comments

Java Valhalla: Use of == on value types

https://humanoid-readable.claude-martin.ch/2026/11/17/value-types/
1•theanonymousone•10m ago•0 comments

Show HN: A self-hosted, open-source database IDE in the browser

https://github.com/libredb/libredb-studio
1•abdullahk0634•10m ago•0 comments

Hacking Forums Forumnox

https://forumnox.com/
1•Jokerr•11m ago•0 comments

Automatic Checking of Compiler Correctness with E-Graphs

https://stng.substack.com/p/automatic-checking-of-compiler-correctness
1•g0xA52A2A•12m ago•0 comments

The Golden Age of Jazz Cartoon Soundtracks (Part 1)

https://www.honest-broker.com/p/the-golden-age-of-jazz-cartoon-soundtracks
2•paulpauper•13m ago•0 comments

Israel Is Attacking Wikipedia

https://techforpalestine.org/wikipedia-report-2026
27•pauldelany•13m ago•2 comments

Psychiatry's Syphilis Problem

https://freddiedeboer.substack.com/p/psychiatrys-syphilis-problem
1•paulpauper•13m ago•0 comments

Tyler Cowen: How Much Is a CEO Worth? Ask Nvidia

https://www.thefp.com/p/tyler-cowen-how-much-is-a-ceo-worth-jensen-huang-nvidia
1•paulpauper•14m ago•0 comments

Israel vs. Wikipedia

https://techforpalestine.org/wikipedia-report
47•srvo•15m ago•1 comments

Coworkers started a sign language class to communicate with deaf employee

https://coloradosun.com/2026/11/16/longmont-city-workers-sign-language-class-deaf-employee/
2•mooreds•15m ago•0 comments

EU targets subscription traps, addictive design and hidden fees with new rules

https://www.euronews.com/2026/11/11/eu-targets-subscription-traps-addictive-design-and-hidden-fee...
5•nonethewiser•16m ago•1 comments

What systemd.time(7) leaves out

https://www.allddd.onl/blog/what-systemd-time-leaves-out/
1•allddd•17m ago•0 comments

Alldokus – logic puzzles graded by the reasoning they need, not the clues

https://alldokus.com/en
2•bcledev•17m ago•0 comments

Upside can now make a million pounds of chicken and year (Lab grown meat)

https://techcrunch.com/2026/11/17/upside-foods-can-now-make-one-million-pounds-of-chicken-each-ye...
2•internet-390•18m ago•0 comments

How the Internet's Predecessor ARPANET Changed the World

https://www.nytimes.com/interactive/2026/11/16/magazine/arpanet-internet-computers-network.html
2•ChrisArchitect•18m ago•1 comments

GPT-6.2 Astra and Sol deliver most of the AA Cost per Task Pareto frontier

https://artificialanalysis.ai/articles/openai-has-the-2-model-in-the-intelligence-index-with-the-...
2•theanonymousone•19m ago•0 comments