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: Hydrology and Biome Simulator

https://aperocky.com/projects/hydrosim/
1•Aperocky•15s ago•0 comments

Wells Fargo reportedly hit by outage, affecting customer access

https://twitter.com/InsiderWire/status/2128188693680722180
1•philip1209•30s ago•0 comments

Bayer CEO Anderson says AI will not revolutionize medicine overnight

https://www.reuters.com/world/bayer-ceo-anderson-says-ai-will-not-overnight-revolutionize-medicin...
1•tartoran•33s ago•0 comments

Three Kinds of Central, Revisited: How do records relate?

https://mkpr.dev/notes/three-kinds-of-central-revisited/
1•articul8info•1m ago•0 comments

Google Search to become personal knowledge agent in 2027

https://searchengineland.com/report-google-to-revamp-search-into-personal-knowledge-agent-in-2027...
1•not4uffin•2m ago•0 comments

Artificial Mathematics

https://proofsandprompts.com/2026/11/20/artificial-mathematics/
1•MoRevolution•3m ago•0 comments

Mr. Amodei, tear down this wall [video]

https://www.youtube.com/watch?v=f-D4266zN_U
1•droidjj•3m ago•0 comments

NoBlobs to reverse-engineer proprietary blobs, starting with SpacemiT K1/K3 SoCs

https://noblobs.github.io/
1•slavgoyim•3m ago•0 comments

Show HN: MecoFax – Fax over IP SIP web client written from scratch in Rust

https://github.com/HeyMeco/MecoFax
1•HeyMeco•4m ago•0 comments

Docs first, then code: how Watcher features avoid silent drift

https://devlog.apogeewatcher.com/docs-first-then-code-watcher-features-avoid-silent-drift
1•mgiannopoulos•5m ago•0 comments

Hello, Factory

https://chad.cm/posts/2026-12-2-hello-factory
1•carimura•6m ago•0 comments

TextCraft: Open-source, text-native RTS engine for LLMs

https://arxiv.org/abs/2611.41328
1•martincsweiss•7m ago•1 comments

Ask HN: Should kids today learn programming or jump to directing agents

2•ripvanwinkle•9m ago•1 comments

Show HN: Diffusion-interface – an agent skill for refining content iteratively

https://kikkupico.github.io/diffusion-interface/
1•kikkupico•9m ago•0 comments

For random numbers on the GPU, encrypt a counter

https://klauria.tech/for-random-numbers-on-the-gpu-encrypt-a-counter/
1•evakhoury•10m ago•0 comments

What to Make of the NSA Advisory

https://words.filippo.io/nsa-advisory/
1•jvdheyden•10m ago•0 comments

Show HN: OpenBridge (WIP) – Local Python Tool for AI Controls on TV and Watch

https://github.com/toskaman/openbridge
2•MSDOS10•11m ago•1 comments

HN Hiring Index v0.1

https://micjm.github.io/hn-hiring-index/
1•seizethecheese•11m ago•0 comments

Keeper Outage: Passwrd Mnger,App Login,Acct Access,Paswrd Vault, Ect

https://sundayguardianlive.com/trending/keeper-outage-today-is-keeper-down-in-the-us-users-report...
1•MadrasThorn•11m ago•0 comments

Early 20th Century US Highrises

https://highrises.hythacg.com
1•NaOH•11m ago•0 comments

Amazon's Trainium3SR, Trainium4, Graviton5, and Nitro v7 Explained

https://www.aboutamazon.com/news/aws/aws-trainium3sr-ai-inference-chip
1•gmays•11m ago•0 comments

Show HN: Habit-building game-challenge Spacer (iOS)

https://apps.apple.com/dk/app/spacer-habit-voyage/id6837902696
1•slowmonkey•12m ago•0 comments

How Boko Haram Uses AI

https://www.nytimes.com/2026/12/02/opinion/ai-terrorism-boko-haram.html
1•ryan_j_naughton•12m ago•0 comments

AI output estimated to be ~1 web every 15 days

https://www.sid.ai/research/llm-output-vs-human-text
1•maxrumpf•12m ago•0 comments

Find My Spotify Wrapped Twin

https://mywrappedtwin.vercel.app/
1•gbocs•13m ago•0 comments

How a C++ standard goes through ISO, stage by stage

https://train-it.eu/blog/how-a-cpp-standard-goes-through-iso/
1•ibobev•15m ago•0 comments

Manually Creating a ZFS Pool from Mismatched Drives

https://www.naturalborncoder.com/2024/07/manually-creating-a-zfs-pool-from-mismatched-drives/
1•todsacerdoti•17m ago•0 comments

Agent Enabled Marketplace

https://artificialbanking.app/
1•momoexpress•17m ago•0 comments

Ether: The AI operating system organizations run on

https://www.ether.dev/
1•wawhal•17m ago•0 comments

Some Thoughts on the Markdown Web

https://lmika.org/2026/11/30/some-thoughts-on-the-markdown.html
1•speckx•17m ago•0 comments