frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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.

Cisco CPO predicts AI will have built majority of their products by end of 2027

https://www.sdxcentral.com/analysis/cisco-cpo-predicts-ai-will-have-built-majority-of-the-vendors...
1•oavioklein•3m ago•0 comments

Ask HN: How to get started in electronic music

2•A_Random_Nerd•7m ago•1 comments

DESI Completes Planned 3D Map of the Universe and Continues Exploring

https://noirlab.edu/public/news/noirlab2610/
1•mooreds•9m ago•0 comments

Optimization of Elevator Standby Scheduling Strategy in Smart Buildings

https://www.mdpi.com/2571-5577/8/5/132
2•swq115•13m ago•0 comments

Police shut down reboot of Crimenetwork marketplace, arrest admin

https://www.bleepingcomputer.com/news/security/police-shut-down-reboot-of-crimenetwork-marketplac...
3•billybuckwheat•13m ago•0 comments

How do the most prolific people produce so much? (2023)

https://www.commonreader.co.uk/p/how-do-the-most-prolific-people-produce
1•herbertl•15m ago•0 comments

METR can barely measure Claude Mythos – 50% task horizon now exceeds 16 hours

https://hugonomy.com/news.html
1•GlyphWeaver_a•15m ago•0 comments

A paid JSON Schema validation API using x402 micropayments

https://github.com/garyedgington/project_x402
1•garyedgington•17m ago•0 comments

Film Cue – a Sushi Go-style card game about making movies

https://filmcuegame.com/
1•tinch•24m ago•0 comments

Show HN: Open-source GEO auditor (no signup)

https://www.freeaiseoaudit.com/
2•ICodeSometimes•30m ago•0 comments

Show HN: Personal Trainer – Lift, share plans, and rank with friends

https://mobile-squad.com/#personal-trainer
3•erwanalliaume•30m ago•0 comments

The Morse Code Hack That Made an AI Agent Spend $200k [video]

https://www.youtube.com/watch?v=UQ4pSVS_mN0
1•CharlesW•31m ago•0 comments

AI vs. Open Source, Part 1: The Empty Grant

https://srikanth.sastry.name/ai-vs-open-source-the-empty-grant/
1•srikanthsastry•31m ago•0 comments

A faithful LLM-wiki implementation with Wikipedia-style web browsing

https://github.com/hzw1199/CyberMe-LLM-Wiki
1•hzw1199•32m ago•1 comments

What were scanners like in the 80s? – 1988 IBM PageScanner 3119 [video]

https://www.youtube.com/watch?v=IhMzwISbIAo
2•CharlesW•33m ago•1 comments

A throbbing heart at the thought of AI

1•ish099•36m ago•1 comments

Claude Platform on AWS

https://aws.amazon.com/claude-platform/
1•matrixhelix•37m ago•0 comments

Claude Platform on AWS

https://claude.com/blog/claude-platform-on-aws
3•matrixhelix•38m ago•0 comments

Show HN: Compare Similar Audio Tracks

https://w.merkoba.com/trackcheck/
1•madprops•38m ago•0 comments

How Rockstar fit an entire city into PlayStation 2 memory [video]

https://www.youtube.com/watch?v=cIbCxbrBCys
1•CharlesW•42m ago•0 comments

Scientists Gave 'Aggressive' Fish Psychedelic Drugs. A Breakthrough Came Next

https://www.404media.co/fish-psilocybin-magic-mushrooms-study-psychedelics/
1•gmays•45m ago•0 comments

Darkest Dungeon devs will "never, ever" use GenAI to replace narrator Wayne June

https://www.rockpapershotgun.com/his-voice-and-delivery-was-human-darkest-dungeon-developers-will...
1•latexr•46m ago•0 comments

The Silence That Meets the Rape of Palestinians

https://www.nytimes.com/2026/05/11/opinion/israel-palestinians-sexual-violence.html
10•lorecore•48m ago•3 comments

The new Shai-Hulud worm threatens to wipe your machine if you revoke its token

https://cybersecurityreach.org/investigations/ifyourevokethistokenitwillwipethecomputeroftheowner...
2•Leonardm•50m ago•0 comments

Extraordinary Ordinals

https://text.marvinborner.de/2026-04-09-17.html
3•marvinborner•59m ago•0 comments

Db-fortress – Scanner for the 4 vibe-coded auth bugs Wiz documents

1•omji-krypto•1h ago•0 comments

Can you help reconcile my first/second-hand LLM Experience with HN's Experience?

2•didigamma•1h ago•4 comments

Show HN: A browser-friendly mirror of the war.gov UFO/UAP Release 01 files

https://0.2.fastfilelink.com/x5CbXd5k
2•bear330•1h ago•5 comments

Open Questions – AGI

https://handsdiff.substack.com/p/open-questions-agi
1•rajeevn•1h ago•0 comments

Christophe Pettus: PHP Goes BSD

https://thebuild.com/blog/2026/04/30/php-goes-bsd/
4•PaulHoule•1h ago•0 comments