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: Gerber 3D – view, compare and fab-check PCB files in the browser

https://wespeakenglish.github.io/VisualGerber/
1•pinelab•48s ago•0 comments

The Last Boring Slide

https://claude.ai/artifact/Cy2d8Vn63CnzCtonA1LSah
1•diginova•6m ago•0 comments

DocScanner: PDF Scanner and OCR – AI Document Scanner and PDF Editor

https://play.google.com/store/apps/details?id=com.jakaria.docscanner&hl=en_US
2•mdshaown707•8m ago•1 comments

Zelenskyy says Russia will attack Ukranian power grids

https://apnews.com/article/russia-ukraine-war-zelenskyy-power-122f7f187eea20d4d2b659692b4c4f1e
3•illidan1000•8m ago•0 comments

The Math Behind Counter-Strike Surfing

https://healeycodes.com/the-math-behind-counter-strike-surfing
2•v3gas•9m ago•0 comments

A Deterministic Subexponential-Time Algorithm for the Discrete Logarithm Problem

https://eprint.iacr.org/2026/3020
3•decompwlj•9m ago•0 comments

Electronics makers set up memory 'war rooms' amid worst DRAM shortage in history

https://www.tomshardware.com/pc-components/dram/electronics-manufacturers-set-up-memory-war-rooms...
2•milali•11m ago•0 comments

Datensparsamkeit (2013)

https://martinfowler.com/bliki/Datensparsamkeit.html
4•berlam•15m ago•0 comments

Users reporting multiple UK banking apps down

https://downdetector.co.uk/status/lloyds-bank/
2•drayfield•15m ago•1 comments

One-way and two-way doors

https://www.theengineeringmanager.com/growth/one-way-and-two-way-doors/
1•LaSombra•20m ago•0 comments

Cross-Layer Characterization and AI-Assisted Diagnosis of C-to-Rust Performance

https://arxiv.org/html/2611.33490v1
1•lucamark•20m ago•0 comments

Scientists Used Seabirds to Track Hidden Ships

https://www.404media.co/the-birds-are-listening-scientists-used-seabirds-to-track-hidden-ships/
5•Danhale93•22m ago•0 comments

People are pretending not to understand the immigration debate

https://thecritic.co.uk/people-are-pretending-not-to-understand-the-immigration-debate/
1•barry-cotter•24m ago•0 comments

Bypassing the Grid: How Data Center Developers Build Their Own Power Plants

https://cleanview.co/reports/behind-the-meter-data-centers/full-report
1•JulieZhao00•27m ago•0 comments

Inflation Hits Highest Since May as Energy Prices Surge

https://finance.yahoo.com/economy/articles/inflation-hits-highest-since-may-123148009.html
2•ArizonaGal•28m ago•0 comments

Ask HN: Is Claude Code nerfing AI and agent-harness projects?

2•martibravo•28m ago•1 comments

British social security system techies yank services following 'cyber incident'

https://www.theregister.com/security/2026/11/27/british-social-security-system-techies-yank-servi...
3•jjgreen•30m ago•0 comments

Show HN: Lelvo – Open-source, end-to-end encrypted photo backup with no servers

https://github.com/shahil-kv/Lelvo
1•shahileee•32m ago•0 comments

How to run your whole system locally and catch integration bugs

https://www.lo1.dev/blog/bugs-between-services/
1•fr3shw3b•32m ago•1 comments

PDF Buddy: PDF Converter and AI

https://play.google.com/store/apps/details?id=com.pdfbuddy&hl=en_US
1•digitalcrafters•33m ago•0 comments

Clawdcursor, a desktop agent that runs UI tasks in the background

https://clawdcursor.com
1•AmDab•34m ago•0 comments

Show HN: Hacker News Movies

https://hackerfilms.pages.dev
1•nullandvoid•35m ago•0 comments

75% of Rockstar's workers have voted against a union deal

https://www.videogameschronicle.com/news/75-of-rockstars-workers-have-voted-against-unionizing/
4•madihaa•35m ago•0 comments

Browse Gopher with Nothing but Unix

https://en.andros.dev/blog/500fbcb7/browse-gopher-with-nothing-but-unix/
3•andros•35m ago•0 comments

Agent Builders 2026 Survey

https://docs.google.com/forms/d/e/1FAIpQLScTj21VCfGqYmfXMrn9C4fcMDXpxM1KKCK2AmfQ0Hn76j6Enw/viewfo...
1•vickyonit•35m ago•0 comments

Stopping a Running Alignment Evaluation

https://openai.com/safety-alignment/misalignment-reports/stopping-a-running-alignment-evaluation/
1•anatolii1309•37m ago•0 comments

PyPkgScore – Automated 0-1000 security and governance audits for PyPI packages

https://pypkgscore.com/
1•jeanpmodev•37m ago•0 comments

Jupyter security updates: reports flood, etc.

https://blog.jupyter.org/posts/2026/jupyter-security-council-updates/
1•yannpellegrini•39m ago•0 comments

Is Creating Custom WebServer Hard?

https://tomj.pro/is-creating-webserver-simple/
1•TomJpro•39m ago•0 comments

The darker side of being a doctor

https://drericlevi.pages.dev/the-darker-side-of-being-doctor/
4•face2sunny•42m ago•2 comments