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.

The Age of Technology Companies

https://shxxxjin.substack.com/p/the-age-of-technology-companies
1•brainer•5m ago•0 comments

docs: Add AI Section to CONTRIBUTING.md

https://github.com/thelounge/thelounge/pull/5130/files
1•MaxLeiter•5m ago•0 comments

LLMs Can Infer Political Alignment from Online Conversations

https://arxiv.org/abs/2603.11253
1•Anon84•6m ago•0 comments

Technical Deep Dive into the Entropy Issue

https://blog.coinkite.com/entropy-technical-backgrounder/
1•janandonly•6m ago•1 comments

Kimi K3 found a new lower bound for the minimal superpermutation problem

https://levkropp.github.io/superperm/
2•biglevvo•7m ago•0 comments

Official ModRetro M64 Deep Dive: Console, Controller, Games [video]

https://www.youtube.com/watch?v=9gOJUEcKYRk
1•nomilk•7m ago•1 comments

Open Hardware and Free Software: Teufel Mynd, a Case Study

https://fsfe.org/news/2026/news-20260629-01.html
1•smartmic•11m ago•0 comments

Drones offer alternative to balloons for weather research

https://www.theguardian.com/news/2026/jul/31/weatherwatch-drone-base-station-offers-alternative-w...
1•arnejenssen•11m ago•0 comments

Fetch Needs Error Codes

http://www.jasnell.me/posts/fetch-needs-error-codes
1•meysamazad•11m ago•0 comments

Reviewing finished tasks from last week in org-agenda and Emacs

https://ashishpanigrahi.com/blog/done-items-org-agenda/
1•meysamazad•13m ago•0 comments

List of Style Guides

https://en.wikipedia.org/wiki/List_of_style_guides
1•dredmorbius•13m ago•1 comments

Show HN: Rad – A New Relational Database

https://www.radengine.dev/
1•Southclaws•19m ago•0 comments

A Scriptable 3D Graph Visualization

https://verticesandedges.net/?nburl=./examples/Cube.ipynb
1•countgraph•22m ago•0 comments

Enterprise cloud infrastructure uptake shows no sign of slowing

https://www.theregister.com/off-prem/2026/08/01/enterprise-cloud-infrastructure-uptake-shows-no-s...
2•magoghm•23m ago•0 comments

How to Prompt Any LLM?

https://blog.sparsh.dev/how-to-prompt-llms/
1•sparshrestha•25m ago•2 comments

BitChat: When the government bans the app, but not the network

https://ownyourdatamp.substack.com/p/bitchat-when-the-government-bans
2•marcoparisi•25m ago•0 comments

What is distributed Key Generation (DKG)?

https://stoffelmpc.com/stoffel-blog/what-is-distributed-key-generation-(dkg)
1•badcryptobitch•28m ago•0 comments

Show HN: WordJS – Open-source CMS where plugins run in OS sandboxes

https://github.com/jaimemartinez/wordjs
1•jaimedmartinezh•32m ago•0 comments

Startup Game

1•FDX2018•34m ago•0 comments

A Surveillance Treaty in Disguise: Canada Signs UN Cybercrime Convention

https://www.michaelgeist.ca/2026/07/a-surveillance-treaty-in-disguise-the-trouble-with-canadas-qu...
37•iamnothere•35m ago•2 comments

The World First AI Agentic Radio, for vibe coders, good vibes only

https://www.twitch.tv/myimaginationai
1•myimaginationai•37m ago•1 comments

Codex reimplemented in 8k lines of C++, <1MB binary

https://github.com/paoloanzn/microcodex
2•paoloanzn•41m ago•0 comments

Show HN: CSP Validator and Generator

https://dmarcguard.io/tools/csp-validator/
1•meysamazad•44m ago•0 comments

China's tech advances are causing chaos from Silicon Valley to the White House

https://www.theguardian.com/technology/2026/aug/01/china-silicon-valley-white-house
5•beardyw•44m ago•1 comments

Ask HN: Can AI breakthroughs in mathematics help non-mathematicians feel better?

1•amichail•46m ago•1 comments

The Art of 64-bit Assembly

https://nostarch.com/art-64-bit-assembly-v2
3•0x54MUR41•46m ago•0 comments

Cradle. Animated Web Companions

https://cradlestudio.vercel.app/
1•maranga•47m ago•1 comments

Beauty in My Backyard

https://worksinprogress.co/issue/beauty-in-my-backyard/
1•jger15•48m ago•0 comments

Grok: Imagine Video 1.5

https://twitter.com/grok/status/2083353607370416632
2•tosh•54m ago•0 comments

The Collatz conjecture was false [video]

https://www.youtube.com/watch?v=RnfFC_LowtU
2•ykonstant•55m ago•1 comments