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.

Metadata requests no longer tracked in PyPI download counts

https://blog.pypi.org/posts/2026-08-31-download-counts/
1•miketheman•1m ago•0 comments

Electricity-free miniaturized solid state cooling

https://www.theregister.com/science/2026/08/28/german-japanese-researchers-invent-electricity-fre...
1•Gaishan•1m ago•0 comments

Ink & Switch: Introducing Patchwork-26 [video]

https://www.youtube.com/watch?v=4UxGijnuXEs
1•spiralganglion•1m ago•0 comments

Bank of America bans working remotely 2 days in a row

https://www.hcamag.com/us/specialization/corporate-wellness/bank-of-america-bans-working-remotely...
1•randycupertino•1m ago•0 comments

AI Job Scout and Rate Matcher

https://github.com/Deviad/job-hunter
1•Deviad•3m ago•0 comments

How plane-tracking live streams are made [video]

https://www.youtube.com/watch?v=RbjHrD2hJp4
1•toomuchtodo•9m ago•0 comments

Ask HN: Who is using coding agents for memory optimization?

1•henningpeters•10m ago•0 comments

A unified platform for dexterous manipulation research

https://projectsuperdex.com/
1•hheikinh•11m ago•0 comments

100-Year Human Aging Study

https://clinicaltrials.gov/study/NCT07563777
2•arbayi•11m ago•0 comments

Irc.com

https://irc.com/
1•gregsadetsky•11m ago•0 comments

Poll: Did you know polls exist as a native HN feature?

1•NickNaraghi•11m ago•1 comments

18 month survey of unsecured Ollama servers and an unsolved mystery

https://day50.dev/woahllama/
4•kristopolous•13m ago•0 comments

Free Android app that integrates WhatsApp, Telegram and Signal

https://github.com/fulalas/unichat
1•porteux•14m ago•0 comments

Regular Expression Matching Can Be Simple and Fast

https://swtch.com/~rsc/regexp/regexp1.html
1•pcfwik•17m ago•0 comments

Run local embedder for 0.24% of the OpenAI price

https://dzen.dev/blog/local-dzen-embedding-for-rag/
1•xenator•18m ago•0 comments

Parole Decision-Making: Myths and Realities

https://www.canada.ca/en/parole-board/corporate/publications-and-forms/parole-decision-making-myt...
1•gregsadetsky•19m ago•0 comments

Four Ways to Shake

https://chris.eidhof.nl/post/four-ways-to-shake/
1•frizlab•20m ago•0 comments

Absurdist Meaning in the Deconstruction of Software

https://hristijanstojkoski.substack.com/p/absurdist-meaning-in-the-deconstruction
2•stojkoskih•23m ago•0 comments

Ask HN: Whats your SWE career plan B?

3•conqrr•26m ago•3 comments

New cardiovascular drug reduces oxidized phospholipids

https://www.acc.org/latest-in-cardiology/articles/2026/08/29/08/48/mon-jacc-lipids-esc-2026
3•brandonb•29m ago•1 comments

The Anatomy of a Cyberattack: If a Company Were a Human Body

https://medium.com/@MAXKLID/the-anatomy-of-a-cyberattack-if-a-company-were-a-human-body-771a806817d7
1•testiam•31m ago•0 comments

Open Source Budget App for Personal and Business

https://github.com/aroesec/loot
1•kulbertinov1•34m ago•1 comments

Tell HN: On AI, Quality, and Accountability

2•qwrfglkjk•35m ago•0 comments

Show HN: Libraries.ink – a home for the books you own

https://libraries.ink
1•samcgraw•36m ago•1 comments

Google Maps Now Shows 'Lake America' in US, Not 'Lake Ontario'

https://www.reuters.com/world/us/google-maps-will-show-lake-america-us-not-lake-ontario-2026-08-30/
7•tartoran•37m ago•4 comments

The Rise of Software Factories

https://hraness.substack.com/p/the-rise-of-software-factories
3•benzguo•40m ago•0 comments

CO2 – Extending C with Rust interop features

https://github.com/hkalbasi/co2
1•hkalbasi•42m ago•0 comments

PG-Strom: An extension that leverages GPU and NVMe for PostgreSQL

https://en.heterodb.com/product
2•b-man•43m ago•0 comments

The Hugging Face attack surprised me – by Ajeya Cotra

https://www.planned-obsolescence.org/p/the-hugging-face-attack-surprised
1•lifeisstillgood•44m ago•0 comments

Russia's Return to G20

https://www.reuters.com/business/finance/europeans-bristle-russias-return-g20-2026-08-31/
3•TechTechTech•45m ago•0 comments