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.

Show HN: Free OCR Cost Calculator – Estimate multi-provider LLM token costs

https://ocrbench.app/blog/llm-ocr-cost-calculator/
1•gustutu•5m ago•0 comments

GDPR: France imposes 27x more in fines per resident than Spain

https://www.legiscope.com/blog/europe-data-protection-fines-per-capita.html
1•Thiebaut•7m ago•1 comments

New NanoGPT speedrun record with ANVIL II

https://hyperstition.cc/training-nanogpt-in-39-9-seconds
1•yclicc•11m ago•0 comments

PicasaPy: Complete rewrite of the Picasa photo editor based on Python

https://github.com/sanchomuzax/PicasaPy
1•edward•11m ago•0 comments

We Took over ChatGPT Accounts

https://www.parameter.ai/labs/we-found-a-gap-at-openai
3•armcat•13m ago•1 comments

Zone Rouge

https://en.wikipedia.org/wiki/Zone_rouge
1•Bluestein•15m ago•0 comments

Where They Stand – Nonpartisan Guide to Every House and Senate Race

https://wheretheystand.vote
1•zaidbourini•17m ago•0 comments

Lemmings TS

https://twitter.com/PaulOBrien/status/2116205572236198305
1•hackerbeat•19m ago•0 comments

Molly(Signal fork) has not been updated since 3 months and is vulnerable

https://piefed.world/post/1503394
1•DeepLogin•20m ago•0 comments

Serbia just elected the world's brainiest parliament

https://www.science.org/content/article/serbia-just-elected-world-s-brainiest-parliament
44•input_sh•22m ago•10 comments

Defending the patch gap against automated attackers

https://blog.mozilla.org/en/firefox/privacy-security/defending-patch-gap/
2•joshcsimmons•22m ago•0 comments

First patient undergoes pioneering stem-cell treatment for Parkinson's

https://medicalxpress.com/news/2026-10-patient-stem-cell-treatment-parkinson.html
2•geox•23m ago•0 comments

The Great Hewlett-Packard

https://www.hpmemoryproject.org/timeline/giovanni_becattini/giovanni_becattini_memoir.htm
2•hggh•24m ago•0 comments

Estimate and track the environmental footprint of GenAI models at inference

https://ecologits.ai/latest/
1•mkesper•24m ago•0 comments

Chasing the Karpathy Peak (and Falling Off Slop Cliff)

https://thomasjiralerspong.substack.com/p/chasing-the-karpathy-peak
2•netfortius•29m ago•0 comments

EU and Canada forge 'alliance for the future' at Montreal summit

https://dpa-international.com/politics/urn:newsml:dpa.com:20090101:261030-930-920326/
1•vrganj•29m ago•0 comments

One-minute frequency disturbances from synchronization in power systems

https://www.nature.com/articles/s41560-026-02144-0
1•croes•29m ago•0 comments

Neuroscientists reveal method to train people to have lucid dreams

https://www.livescience.com/health/neuroscience/neuroscientists-reveal-method-to-train-people-to-...
3•giuliomagnifico•31m ago•0 comments

Bombturbation

https://en.wikipedia.org/wiki/Bombturbation
1•networked•34m ago•0 comments

Intel leaker reveals Moon Lake chip as a likely replacement for N-series SoCs

https://www.tomshardware.com/pc-components/cpus/intel-leaker-reveals-moon-lake-chip-as-a-likely-r...
1•dingi•36m ago•0 comments

Last Glacial Maximum Refugia (Wikipedia)

https://en.wikipedia.org/wiki/Last_Glacial_Maximum_refugia
1•heresie-dabord•36m ago•0 comments

How ten thousand years of climatic stability made civilization possible

https://blue-continuum.com/the-gift-of-time
1•dnetesn•40m ago•0 comments

Show HN: Imza – plan and review focused coding agent

https://github.com/umutsevdi/imza
1•umutsevdi•45m ago•0 comments

The supercomputer powering Greece's AI ambitions

https://www.ekathimerini.com/economy/1319798/inside-the-supercomputer-powering-greeces-ai-ambitions/
3•greekanalyst•46m ago•0 comments

Bootstrap: Triaging Open Source with Agents

https://blog.getbootstrap.com/2026/10/15/triaging-bootstrap-with-claude-agents/
1•conradfr•48m ago•0 comments

Show HN: JJ Suna AI – Open 5B Flow-Matching DiT for 48 KHz Music Synthesis

https://suna.jjcoders.com/
1•johanjomet•48m ago•0 comments

Show HN: I rebuilt my old canvas 3D library as a small WebGL 2 library – phoria2

https://kevs3d.co.uk/phoria2/
1•kevs3d•54m ago•0 comments

Ask HN: Does anybody also miss the status for the 5h-limit in Claude?

2•theGeatZhopa•54m ago•1 comments

Requests for Startups

https://www.ycombinator.com/rfs
2•olalonde•1h ago•0 comments

Show HN: BondScovery – Fixed income analytics and bond screener

https://bondscovery.com/
1•db8282•1h ago•1 comments