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•9mo ago

Comments

zoezoezoezoe•9mo 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•9mo 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: Pingaroo – a tiny native macOS menu bar app for network stats

https://github.com/mallochio/pingaroo
2•mallochio•1m ago•0 comments

Ask HN: Are you using Clawdbot? What are your use cases?

1•amrrs•1m ago•0 comments

Davos 2026: Special Address by Mark Carney, Prime Minister of Canada

https://www.weforum.org/stories/2026/01/davos-2026-special-address-by-mark-carney-prime-minister-...
2•lemming•2m ago•0 comments

Sloponomics: Who wins and loses in the AI-content flood?

https://www.economist.com/business/2025/10/16/sloponomics-who-wins-and-loses-in-the-ai-content-flood
1•paulpauper•5m ago•0 comments

Show HN: AI agent to create PRs from Slack

1•owendarko•5m ago•0 comments

What Happened to X? [video]

https://www.youtube.com/watch?v=6TTE8g4ouBk
2•Kapura•6m ago•0 comments

The Unreasonable Effectiveness of Failure

https://benoitessiambre.com/fail.html
1•BenoitEssiambre•6m ago•0 comments

GitLab patch release 18.8.2 released

https://about.gitlab.com/releases/2026/01/21/patch-release-gitlab-18-8-2-released/
1•based2•9m ago•0 comments

Trump administration unlawfully suspended EV charger program, U.S. judge rules

https://www.cnbc.com/2026/01/24/us-judge-trump-admin-unlawfully-suspended-ev-charger-program.html
4•donsupreme•9m ago•0 comments

Syntux: JSON to UI for Websites

https://www.getsyntux.com/
3•TheDever•9m ago•0 comments

Show HN: I made an app that blurs my screen when I slouch

https://tomjohnell.com/posturr-a-macos-app-that-blurs-your-screen-when-you-slouch/
1•tjohnell•9m ago•0 comments

Show HN: Kontra, a data quality validator that avoids unnecessary full scans

https://github.com/Saevarl/Kontra
2•saevarl•11m ago•0 comments

Sally Mann Says 'Film Is So Expensive' and Has Started Shooting Digital

https://petapixel.com/2026/01/20/sally-mann-says-film-is-so-expensive-and-has-started-shooting-di...
2•PaulHoule•12m ago•0 comments

Homebrew is great on Linux (2023)

https://www.ypsidanger.com/homebrew-is-great-on-linux/
1•shaicoleman•13m ago•0 comments

Chinese scientists shrink semiconductor chip into fibre as thin as human hair

https://www.scmp.com/news/china/science/article/3341025/chinese-scientists-shrink-semiconductor-c...
1•based2•13m ago•0 comments

Msty – privacy-first AI studio

https://msty.ai/
1•tillulen•15m ago•0 comments

Female dogs evaluate levels of competence in humans

https://www.sciencedirect.com/science/article/abs/pii/S037663572200170X
1•binning•16m ago•0 comments

Adrian Kosmaczewski – Being a Developer After 40 [video]

https://www.youtube.com/watch?v=GQx_beRMHVg
1•summarity•16m ago•0 comments

Headless browser automation CLI for AI agents. (Rust)

https://agent-browser.dev/
1•franze•18m ago•0 comments

Java – Integrity by Design Through Ensuring Illegal States Are Unrepresentable

https://javajanitorjim.substack.com/p/java-janitor-jim-integrity-by-design
2•jimofl•19m ago•1 comments

How to Speak Davosian – For Beginners

https://www.swissinfo.ch/eng/foreign-affairs/how-to-speak-davosian-for-beginners/90798049
3•cainxinth•22m ago•1 comments

Clawdbot Bought Me a Car

https://aaronstuyvenberg.com/posts/clawd-bought-a-car
2•sathyabhat•23m ago•0 comments

Show HN: MonoSuite – Minimal productivity tools I built for my ADHD brain

https://monosuite.app/
2•georgedelair•23m ago•0 comments

Jürgen Habermas Social theorist – critical theory and pragmatism

https://en.wikipedia.org/wiki/J%C3%BCrgen_Habermas
1•based2•23m ago•0 comments

Vertical Aerospace wants to 'democratize' urban air travel with Valo air taxi

https://finance.yahoo.com/news/vertical-aerospace-wants-to-democratize-urban-air-travel-with-its-...
2•erickhill•24m ago•0 comments

How to audit medical bills against CPT codes and the No Surprises Act

https://suretyinsights.com/blog/eob-vs-bill-how-to-spot-medical-billing-errors
3•insuranceguru•25m ago•0 comments

How ad business broke tech

https://zenprivacy.net/blog/how-ad-business-broke-tech/
1•anfragment•25m ago•0 comments

ChatGPT's Favicon Is Missing from Google Search

https://growtika.com/blog/chatgpt-favicon-missing
1•Growtika•26m ago•0 comments

Apple turning to Intel for future iPhone chips, analyst reaffirms

https://9to5mac.com/2026/01/23/apple-turning-to-intel-for-future-iphone-chips-analyst-reaffirms/
7•jerhewet•27m ago•1 comments

Robotic Heart Surgery in Practice [video]

https://www.youtube.com/watch?v=g4Qypk2F0p8
3•Lwrless•27m ago•0 comments