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.

Which goal should our free AI Business Advisor cover next?

https://www.aiuniverse.app
1•osterado•6m ago•0 comments

Power of Nix but it's YAML (macOS and Linux)

https://namios.dev/
9•jktyjvhubb•8m ago•0 comments

Duolingo is facing a lawsuit from investors who say AI made the app worse

https://www.fastcompany.com/91652528/duolingo-ai-push-made-app-worse-tanked-stock-lawsuit-says
2•gwu78•8m ago•0 comments

FileMayor – AI file organiser with plan-first and full undo

https://www.filemayor.com/
1•Chevza•10m ago•0 comments

ASCII Validation from 2.5 to 114 GB/s with SIMD

https://modulovalue.com/blog/vectorizing-ascii-decoding/
1•theanonymousone•13m ago•0 comments

The GömböC: The object that shouldn't exist

https://plus.maths.org/gomboc-object-barely-exists
1•vismit2000•16m ago•0 comments

I'm Done Playing with My Python

https://grandimam.net/posts/i-m-done-playing-with-my-python/
2•grandimam•17m ago•1 comments

Hospitals, schools and power plants to be banned from paying ransomware in UK

https://www.bbc.co.uk/news/articles/c804wv23dk5yo
1•BerislavLopac•18m ago•0 comments

Show HN: Mead, a free, open-source Homebrew GUI for macOS

https://getmead.app/
1•dakilloth•18m ago•0 comments

China's Tianwen-2 probe conducts first asteroid sampling operation

https://www.globaltimes.cn/page/202612/1375665.shtml
1•unkeen•21m ago•0 comments

Un-Oh Bad Gateway

https://openresty.org/en/
1•dgan•21m ago•0 comments

Tiling the Plane with Pentagons

https://plus.maths.org/trouble-five
1•vismit2000•21m ago•0 comments

I realized that Mitos looks like an appealing successor to Helix

https://ergaster.org/thoughts/mitos-helix-successor/
1•birdculture•25m ago•0 comments

Amazon Ergo 1.1T Moe Model Running on the 8x Nvidia GB10 Cluster

https://www.servethehome.com/amazon-ergo-1-1t-moe-model-running-on-the-8x-nvidia-gb10-cluster/
2•giuliomagnifico•29m ago•0 comments

Ask HN: What do we do now, cryptography-wise?

1•tetris11•31m ago•0 comments

Gnomon

https://en.wikipedia.org/wiki/Gnomon
2•tosh•33m ago•0 comments

Camera Obscura

https://en.wikipedia.org/wiki/Camera_obscura
1•tosh•33m ago•0 comments

UK Company Gives Hope for an Open Source GPS Watch

https://itsfoss.com/news/una-gps-watch-builders/
1•giuliomagnifico•34m ago•0 comments

Show HN: Roundtable-agent – Claude Code chairs the AI apps on my Android phone

https://github.com/bluelikeness/roundtable-agent
1•bluelikeness•51m ago•0 comments

Xiomi HyperOS 4 UI now makes use of Rust and Flutter

https://shiftdelete.net/en/xiaomi-hyperos-4-arrives-next-month-with-major-performance-boosts
1•pjmlp•51m ago•0 comments

Show HN: Laravel-go-tenancy – Configurable multitenancy for Laravel Go

https://martinshaw.github.io/laravel-go-tenancy/
1•deux-titres•52m ago•1 comments

My second-hand 5G router came with a Tailscale backdoor named after me

https://blog.euhe.eu/posts/second-hand-router-backdoor/
35•siguiriya•55m ago•16 comments

Attention Costs $100k

https://tornikeo.com/your-attention-costs-100k/
71•tornikeo•57m ago•21 comments

Helpful, Honest, and Harmless Robots

https://alignment.anthropic.com/2026/hhh-robots/
2•geox•59m ago•0 comments

A Graph Description Language with Spatial Semantics

https://blog.brownplt.org/2026/12/03/spytial-gdl.html
2•matt_d•1h ago•0 comments

Whenere: Seeking intrepid play testers – by Neal Stephenson

https://nealstephenson.substack.com/p/whenere-seeking-intrepid-play-testers
1•joecobb•1h ago•0 comments

Bear Trap

https://www.cnn.com/2026/12/05/europe/ukraine-russia-operation-bear-trap-intl
2•znnajdla•1h ago•0 comments

Scaling Proactive Compute: When Agents Anticipate the Task

https://proactive-compute.stanford.edu/
2•matt_d•1h ago•0 comments

Reverse engineered MS Word with pixel perfect rendering

https://f-office.org/
2•hosolmaz•1h ago•0 comments

A Dead Telescope May Have Spotted a Hotly Debated Planet

https://www.nytimes.com/2026/12/04/science/gaia-data-proxima-c.html
3•saikatsg•1h ago•0 comments