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.

Linux 7.3 to support Logitech HID++ 2.0 reprogrammable button support

https://www.phoronix.com/news/Linux-7.3-HIDPP-Reprogrammable
1•teleforce•1m ago•0 comments

Best cutting edge steganography schemes?

1•cryptographical•1m ago•0 comments

Show HN: Ewwii, An extensible widget system for all of Linux

https://github.com/Ewwii-sh/ewwii
1•byson94•2m ago•0 comments

Laravel 13.24, Filament 90% faster, managed queues on Cloud – ADWL #063

https://a-day-with-laravel.happyto.dev/p/laravel-13-24-filament-90-faster-managed-queues-on-cloud...
1•happytodev•4m ago•0 comments

Gateway 2000's hilariously bad ads in the 90s (Part II)

https://buttondown.com/suchbadtechads/archive/gateway-2000-part-2/
2•rfarley04•15m ago•0 comments

Milankovitch Cycles

https://en.wikipedia.org/wiki/Milankovitch_cycles
1•cl3misch•17m ago•0 comments

Ask HN: Sane casual family co-op game on mobile?

2•minusf•18m ago•2 comments

Show HN: A Free Paper Trading Platform with AI Coaching for Global Markets

https://paper-trader.org
1•paperTraderOrg•18m ago•0 comments

Congo bans copper and cobalt concentrates exports

https://www.reuters.com/world/africa/congo-bans-exports-copper-cobalt-concentrates-official-order...
1•geox•21m ago•0 comments

SQRL wan't wrong, it was early

https://sjg.io/writing/sqrl-wasnt-wrong-it-was-early/
3•simonjgreen•22m ago•0 comments

The DOS Operating System

https://www.chebucto.ns.ca/~ak621/DOS/DOS-Head.html
2•AlexeyBrin•22m ago•0 comments

A Tome of Forbidden Technologies

https://ecosophia.net/a-tome-of-forbidden-technologies/
10•hosteur•27m ago•6 comments

Frontier models, transparency and trust; a new golden age in research for some?

https://scholarlyfutures.substack.com/p/frontier-models-transparency-and
3•JohnHammersley•29m ago•0 comments

The CPU is back: Rethinking the CPU-GPU split for LLM inference

https://www.redhat.com/en/blog/cpu-back-rethinking-cpu-gpu-split-llm-inference
5•eigenBasis•30m ago•0 comments

The USSR in 100 Photographs

https://trinixy.ru/7039-sssr_v_fotografijakh_100_foto.html
44•decimalenough•39m ago•27 comments

Qector-Decoder-v3: Multi-Back End Software Architecture for QEC

https://zenodo.org/records/21850315
2•QECTOR•41m ago•0 comments

Japanese Police Arrest NYAA 'First Uploader,' but Not by Watching the Swarm

https://torrentfreak.com/japanese-police-arrest-nyaa-first-uploader-but-not-by-watching-the-swarm/
3•Rant423•42m ago•0 comments

A Chinese AI model stopped OpenAI's 'unprecedented' cyber attack

https://www.cnbc.com/2026/07/24/chinese-ai-model-openai-cyber-attack.html
3•makerdiety•45m ago•0 comments

Happy 808 day: The TR-808 Monograph

https://raygum.com/research/roland-tr-808-monograph
2•stuartmemo•45m ago•1 comments

Cloudflare launches Kitesurf, a browser built for AI agents

https://techcrunch.com/2026/08/07/cloudflare-launches-kitesurf-a-browser-built-for-ai-agents/
3•ashurandi•46m ago•0 comments

1.59X speedup on SQLite 3 in 8 hrs with $150 API cost

https://github.com/ksenxx/sqlite-optimized
4•ksenxx•46m ago•0 comments

I made a memory chip price tracker in five minutes

https://memoryindex.io/
4•mbloom1915•50m ago•1 comments

Amiko: A desperate virtue signalling attempt

https://ryanbigg.com/2026/08/amiko-a-desperate-virtue-signalling-attempt
2•thunderbong•55m ago•0 comments

How a liquid rocket engine is built, animated as a factory

https://laurentiugabriel.github.io/rocket-engine/
2•laurentiurad•57m ago•0 comments

Three.js gets native support for Gaussian Splatting

https://ben3d.ca/blog/gaussian-splatting-for-threejs
3•bhouston•1h ago•0 comments

Safety fears as scientists make first viruses designed by AI

https://www.theguardian.com/science/2026/aug/06/safety-fears-as-scientists-make-first-viruses-des...
2•pseudolus•1h ago•0 comments

China is gaining ground in AI. But the U.S. still has a major advantage

https://www.cnbc.com/2026/08/07/china-us-ai-race-hugging-face-models.html
1•makerdiety•1h ago•0 comments

Why AI has brought nothing more than the conceit of wisdom

https://hedgehogreview.com/web-features/thr/posts/platos-warning-has-been-vindicated
3•GeoAtreides•1h ago•0 comments

Remembering the pre-Google web, when search was an experiment

https://arstechnica.com/gadgets/2026/08/remembering-the-pre-google-web-when-search-was-an-experim...
2•pseudolus•1h ago•0 comments

The Diamond-Square Algorithm

https://diatone.net/toys/terrain
1•diatone•1h ago•1 comments