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.

Transformer Golf – The Unrolled Transformer

https://github.com/mingusb/transformer-golf
1•brianjmingus•2m ago•0 comments

Starcloud hits $1.1B valuation to build space-based data centers

https://www.geekwire.com/2026/orbital-ai-seattle-area-startup-starcloud-hits-1-1b-valuation-to-bu...
1•bko•3m ago•0 comments

New light-powered chip could accelerate AI and quantum computing

https://www.sciencedaily.com/releases/2026/06/260601025343.htm
1•pcael•3m ago•0 comments

Ask HN: Is Everyone an Engineer Now?

1•piratesAndSons•4m ago•0 comments

S&P will not change its rules to get SpaceX in early

https://www.axios.com/2026/06/04/musk-spacex-ipo-sp-investors
2•boguscoder•6m ago•0 comments

South Korean Forums Will Need to Scan Every Images with AI Censorship Tools

https://discuss.privacyguides.net/t/south-korean-online-communities-will-need-to-scan-every-image...
1•Cider9986•8m ago•1 comments

The impact of linguistic features on CTR in Instagram ads

https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0338313
1•PaulHoule•8m ago•0 comments

Tilling the Garden: Use AI differently to make interesting and useful apps

https://mikecaulfield.substack.com/p/tilling-the-garden-a-different-way
1•lemming•9m ago•0 comments

Senior U.S. Officials Eye Government Shares in AI Giants

https://www.notus.org/technology/trump-ai-stake-openai
1•spenvo•11m ago•0 comments

What was your "Oh Shit" moment with GenAI?

1•andrehacker•11m ago•0 comments

China's solar majors charge into batteries as panel sales falter

https://www.reuters.com/business/energy/chinas-solar-majors-charge-into-batteries-panel-sales-fal...
1•JumpCrisscross•13m ago•0 comments

Flesh-eating screwworm confirmed in Texas calf as parasite crosses from Mexico

https://www.reuters.com/business/healthcare-pharmaceuticals/unconfirmed-us-case-flesh-eating-scre...
1•JumpCrisscross•14m ago•0 comments

SpaceX IPO Website

https://www.spacexipo.com
1•malshe•14m ago•0 comments

Microsoft to tighten human rights measures after inquiry into Israel deals

https://www.theguardian.com/technology/2026/jun/04/microsoft-to-tighten-human-rights-measures-aft...
1•lorecore•17m ago•0 comments

S&P Dow Jones Indices Consultation on Treatment of MegaCap Companies

https://press.spglobal.com/2026-06-04-S-P-Dow-Jones-Indices-Consultation-on-Treatment-of-MegaCap-...
1•pradn•18m ago•0 comments

ProlificTea

1•TheProfitKing•19m ago•0 comments

Silent Slide

https://www.silentslide.app
1•bicoastalai•20m ago•0 comments

Librecode (Yet Another Agent Harness)

https://github.com/omarluq/librecode
1•omarluq•21m ago•0 comments

Show HN: Papernews – self-hosted daily newspaper PDF for your reMarkable

https://github.com/marcj/papernews
2•bourbonproof•25m ago•0 comments

Kubelize – Free tool to manage multiple Kubernetes clusters

https://kubelize.me/
1•garymoon•26m ago•0 comments

Afar and Below: The Story of the Wyoming Trona Miners [video]

https://www.youtube.com/watch?v=JsYmw6FtSIA
1•Teever•27m ago•0 comments

Serving Transformers: Lessons from the Trenches – Stanford CS25 Transformers [video]

https://www.youtube.com/watch?v=ZUdIsRZhWXI
2•matt_d•29m ago•0 comments

Can you solve this hw prompt?

https://docs.google.com/document/d/1OMI3ioBeifmtClDXrmiXOe4WE4dYfJpPFVJxgPYpvX4/edit?tab=t.0
1•NYKidzzz•29m ago•1 comments

Using Ropes for Computation

https://wiki.xxiivv.com/site/knots_computing.html
2•cmod•30m ago•0 comments

Living in an Alive World

https://longreads.com/2026/06/02/jenny-odell-deep-listening-soft-eyes/
1•bookofjoe•31m ago•0 comments

No special treatment for SpaceX in the S&P 500 [pdf]

https://www.spglobal.com/spdji/en/documents/indexnews/announcements/20260604-1483731/1483731_spdj...
3•borski•31m ago•0 comments

Anticompetitive directors

https://www.columbialawreview.org/content/anticompetitive-directors/
1•hhs•32m ago•0 comments

Constrained Adaptive Rejection Sampling

https://arxiv.org/abs/2510.01902
1•matt_d•33m ago•0 comments

Foxconn and TSMC are running an 800-year-old operating system

https://twitter.com/josefchen/status/2060346552959303981
1•josefchen•33m ago•0 comments

Show HN: Skim any YouTube video. be happy

https://chromewebstore.google.com/detail/skim-get-to-the-point-fre/eenbaojdcmnbdlhkmambidocigepdobm
1•betterhealth12•35m ago•0 comments