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.

Mainsprings, watermarks, answer boxes and other bad words for good ideas

https://www.arjunkirtipatel.com/blog/mainsprings-watermarks-answer-boxes-and-other-bad-words-for-...
1•arjunkpatel•1m ago•0 comments

Apple May Return to Server Market with Nvidia Technology

https://www.macrumors.com/2026/09/16/apple-may-return-to-server-market/
2•tosh•3m ago•0 comments

Show HN: A Stateful LLM API that works across providers

https://twigg.ai
1•mdebeer•4m ago•0 comments

Show HN: Plant watering system with Arduino Nano

https://sam-burns.com/posts/automatic-plant-watering-system/
1•sam-bee•4m ago•1 comments

Problem Notation and Testing

https://ciju.in/writings/on-problem-notation-and-testing
1•ciju•4m ago•0 comments

Bamzooki

https://en.wikipedia.org/wiki/Bamzooki
1•talkinghead•5m ago•0 comments

OpenAI Expands ChatGPT Ads with Sponsored Agents

https://openai.com/index/reimagining-advertising-with-ai/
1•vertigoruntime•6m ago•0 comments

/pyor:review – Claude skill for human code review

https://github.com/pyor-review/pyor-cli
1•othmanosx•9m ago•0 comments

Valve plans to get Steam games working on compatibility-challenged ARM PCs

https://www.rockpapershotgun.com/were-trying-to-make-it-easier-valve-confirm-the-steam-frame-is-j...
2•HelloUsername•10m ago•0 comments

We're catalyzing megaton-scale climate impact in Brazil

https://blog.google/company-news/outreach-and-initiatives/sustainability/terradot-superpollutants...
1•geox•12m ago•0 comments

AI research institute founded by Yoshua Bengio vandalized in Montreal

https://www.cbc.ca/news/canada/montreal/mila-vandalism-montreal-ai-summit-9.7345851
2•sm001•13m ago•1 comments

DeepMind Paper: Dream-RSI: Recursive Self-Improvement Through Evolving Worlds

https://arxiv.org/abs/2609.14858
2•bananaflag•13m ago•1 comments

I caught an LLM-powered recruiter with a prompt injection on LinkedIn

https://khancyr.github.io/blog/2026/03/15/how-i-caught-an-llm-powered-recruiter-with-a-prompt-inj...
1•bucket2015•15m ago•0 comments

Show HN: Skill to generate change preview pages

https://github.com/steveharrison/change-preview
1•steveharrison•16m ago•0 comments

Explaining the Proposed $103k H-1B Fee

https://ifp.org/explaining-the-proposed-103k-fee-on-h-1bs/
1•surprisetalk•17m ago•0 comments

AWS can't restore service to Bahrain, UAE facilities 6 months after Iran strikes

https://www.cnbc.com/2026/09/15/aws-cant-restore-service-to-bahrain-uae-6-months-after-iran-strik...
2•theanonymousone•17m ago•0 comments

Scientist Workbench: Scientific Compute for Agents

https://scientistworkbench.com/
1•hentrep•17m ago•0 comments

How to Buy a Tesla and Get FSD for Free

https://tynan.com/freefsd/
1•surprisetalk•17m ago•0 comments

WAIl (Blonging for Freedom)

https://blog.lx.oliva.nom.br/2026-09-14-wAIl.en.html
2•amcclure•23m ago•0 comments

The Climb Was the Safety Feature

https://cekrem.github.io/posts/the-climb-was-the-safety-feature/
3•theanonymousone•23m ago•0 comments

Using NetBSD's pkgsrc everywhere I can

https://www.rubenerd.au/using-netbsds-pkgsrc-everywhere-i-can/
1•Bluestein•23m ago•0 comments

Show HN: Who-GPU, a simple monitoring tool to view GPU usage across machines

https://github.com/lucafossen/who-gpu
1•smogblock•24m ago•0 comments

You're on the Real X Website and You're Still Being Scammed

https://brothke.medium.com/youre-on-the-real-x-website-and-you-re-still-being-scammed-ebd3fba9e344
3•benrothke•24m ago•0 comments

The American Age Is Over

https://www.theatlantic.com/ideas/2026/09/trump-iran-superpower-decline/688639/
7•cisc•25m ago•3 comments

Show HN: TeXposit – Feature rich LaTeX and Markdown editor

https://texposit.com
2•danielszabo•27m ago•0 comments

Goroutine Leak Profiles

https://go.dev/blog/goroutine-leak-profiles
1•torutofu•27m ago•0 comments

Starlink's Other Network

https://circleid.com/posts/starlinks-other-network
2•vinhnx•27m ago•0 comments

US gov't orders Kalshi halt AI compute price tracker over natl security concerns

https://www.semafor.com/article/09/15/2026/commerce-dept-ordered-kalshi-to-take-down-ai-compute-f...
2•CGMthrowaway•28m ago•0 comments

Building an open source AEC compliance checker that does not guess

https://www.luckmanqasim.com/blog/building-a-compliance-linter
1•luckmanqasim•28m ago•0 comments

Ask HN: Unipolar world with Washington DC as might and power center

1•roschdal•28m ago•1 comments