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.

July 6th: International Kissing Day

https://en.wikipedia.org/wiki/International_Kissing_Day
1•Bender•1m ago•0 comments

Britain should consider regulating AI models, FCA official says

https://www.reuters.com/legal/litigation/britain-should-consider-regulating-ai-models-fca-officia...
1•adithyaharish•1m ago•0 comments

The Importance of Questioning When Coding with AI

https://jakub.jankiewicz.org/blog/questioning-ai/
1•jcubic•3m ago•0 comments

Kill the Plastic AI Portrait

https://realistic-shot-deploy-eight.vercel.app/
1•withoutshape•6m ago•1 comments

How We're Keeping Reddit Real and Safe in the AI Era

https://redditinc.com/news/how-were-keeping-reddit-real-and-safe-in-the-ai-era
1•soheilpro•7m ago•0 comments

Our Own Little Golden Era

https://thesecondbutton.com/our-own-little-golden-era/
1•SuperUserDone•10m ago•1 comments

Save Thousands of Dollars: Smpte Standards Are Free

https://vimegs.com/save-thousands-of-dollars-on-information-directly-from-the-source-smpte-makes-...
1•LukasMarek•10m ago•0 comments

How Will AI Impact the Labor Market?

https://www.goldmansachs.com/insights/goldman-sachs-exchanges/how-will-ai-impact-the-labor-market
1•vismit2000•11m ago•0 comments

An interactive visualization of a HTTP request through its ~200ms life

https://200ms.thenodebook.com
1•isht_0x37•11m ago•0 comments

Mid-tier factory knives vs. cheap imports

https://www.paragon-knives.com/
1•bgzlsxaz•15m ago•0 comments

Ask HN: What internal tools/SASS replacements are you building?

1•kostarelo•17m ago•0 comments

Why is there smoke from the boiler room? – Botanical Garden using Home Assistant

https://vooijs.eu/posts/why-is-there-smoke-from-the-boiler-room/
1•Baardappel•17m ago•0 comments

Coding Agents as Teammates in Issues, Pull Requests, and CI

https://onedev.io/blogs/33
3•timplant•18m ago•1 comments

Owarix, version of 8000 year old game for the Vic20. (3k: v20,c64,c16,zx,PC)

https://orac81.itch.io/owarix
1•orac81•19m ago•0 comments

TikTok Viral Score – deterministic scoring engine, no login required

https://github.com/NaiaLorente/GoViral-Tiktok
1•naialorente•19m ago•0 comments

If Terraform is so great, why isn't anyone using it anymore?

https://medium.com/@sebkow/if-terraform-is-so-great-why-isnt-anyone-using-it-anymore-1b79b2159272
2•sebkow•19m ago•2 comments

Probably the best AI detector tool is ready

https://aidetector.my/en
2•GemsGame•21m ago•0 comments

I built Who Goes? app to make game nights feel fun again

https://apps.apple.com/in/app/who-goes-party-games/id6777402559
2•shubham_iosdev•24m ago•1 comments

Eight – Interactive fiction made with AI

https://huggingface.co/spaces/alvations/hallway8
2•alvations•25m ago•0 comments

The Parts Based Programming Kernel

https://programmingsimplicity.substack.com/p/the-parts-based-programming-kernel
3•surprisetalk•27m ago•0 comments

Reasons to be optimistic about America's future

https://www.washingtonpost.com/opinions/interactive/2026/07/03/25-reasons-be-optimistic-about-ame...
2•baal80spam•28m ago•0 comments

Trump Financial Disclosure Shows 21,000 Trades in 2025

https://www.advisorhub.com/trump-financial-disclosure-shows-21000-trades-in-2025/
9•throw0101d•29m ago•1 comments

pkgsrc is still available on macOS as a package manager

https://pkgsrc.smartos.org/install-on-macos/
2•uneven9434•29m ago•0 comments

FlowerBench: Benchmarking AI Agents on Real Enterprise Work

https://flower.ai/benchmarks/flowerbench/
2•dimitrisflwr•31m ago•1 comments

China will likely have its own Mythos-like model around February 2027

https://www.the-substrate.net/p/china-will-likely-have-its-own-mythos
3•throw0101d•32m ago•0 comments

Show HN: Open-source Claude Code skills that mine Reddit/X for content topics

4•vatricemir•33m ago•0 comments

Ask HN: Are there good security benchmarks for LLMs?

2•melvinroest•33m ago•0 comments

The Devadasis, Dance Community of South India: A Legal and Social Outlook

https://brill.com/view/journals/ijgr/29/1/article-p102_102.xml
2•thunderbong•39m ago•0 comments

We built a P2P app with no servers. Internet of Peers [video]

https://www.youtube.com/watch?v=n76zGrt4aRY
2•closet_slayer•39m ago•0 comments

Road to Elm 1.0

https://elm-lang.org/news/faster-builds
11•wolfadex•40m ago•1 comments