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.

Agentic AI in a Smolbox

https://remyhax.xyz/posts/smolbox/
1•jerrythegerbil•2m ago•0 comments

Quake Shareware, a CD-ROM just a little too full

https://fabiensanglard.net/quake_shareware_cd/index.html
2•shdon•3m ago•0 comments

Try any open source model for free

https://www.tryingopen.com/
1•HussamAli•4m ago•3 comments

Virgin Galactic wants your help naming its new Delta class spaceship

https://arstechnica.com/space/2026/08/virgin-galactic-wants-your-help-naming-its-new-delta-class-...
1•ohjeez•4m ago•1 comments

Samuel – mimic your speech using Pink Trombone with a model

https://samuel.vvolhejn.com/
1•smusamashah•6m ago•1 comments

Theodore John Conrad

https://en.wikipedia.org/wiki/Theodore_John_Conrad
1•chistev•7m ago•0 comments

Fairphone 6 and PostmarketOS working main camera

https://catcrafts.net/posts/fairphone-6-postmarketos-working-main-camera
2•pizzaiolo•8m ago•0 comments

'Buy Now, Pay Later' Lenders Pitch Loans for Needs Like Electricity and Rent

https://www.nytimes.com/2026/08/17/business/buy-now-pay-later.html
3•apparent•10m ago•1 comments

What's behind the rise of teens spying for Russia?

https://mssv.net/2026/08/13/whats-behind-the-rise-of-teens-spying-for-russia/
1•programLyrique•11m ago•0 comments

Penny Pritzker Warns China's Rise in Research Rankings Is 'Not Good' for U.S.

https://www.thecrimson.com/article/2026/8/10/pritzker-china-research-rankings/
2•Alien1Being•13m ago•0 comments

Gitweb – Git web interface (web front end to Git repositories)

https://git-scm.com/docs/gitweb
1•nodar86•16m ago•0 comments

Tracking the BitTorrent Tracker Infrastructure

https://tracker.evilbit.de/
1•pawal•18m ago•1 comments

Control Charts Make AI Agents Cheaper, Less Necessary, and More Useful

https://newoldweb.com/control-charts-make-ai-agents-less-necessary-and-more-useful
1•netaustin•21m ago•0 comments

My friends all hate AI; I just joined an AI startup

https://www.fast.ai/posts/2026-08-18-returning-to-AI/
3•eamag•22m ago•0 comments

New Amiga logo looks aesthetically well-composed

https://www.reddit.com/r/amiga/comments/1vr5jqi/new_amiga_logo_looks_aesthetically_very/
1•doener•23m ago•0 comments

US tech stock correction likely, warn ECB economists

https://www.ft.com/content/cb4b22ab-4183-4d19-be60-6d2fab86d86d
4•aanet•23m ago•1 comments

Haxy is a Git alternative that stores metadata (issues, PRs etc.) in the repo

https://github.com/xit-vcs/haxy
1•nafey•23m ago•0 comments

Run Qwen locally on Windows and use it remotely from any device

https://www.hiramdeals.com/blog/host-qwen-privately-windows
1•hiramwen•25m ago•1 comments

Foreign psyops campaign targeting American consumer AI (2025)

https://www.ynetnews.com/tech-and-digital/article/rj00kxqzaxx
2•nervai•25m ago•0 comments

What rising Treasury yields are telling us

https://www.axios.com/2026/08/17/treasury-yields-warsh-bonds
2•toomuchtodo•27m ago•1 comments

An interactive display stack explaining optical bonding

https://designshippers.com/work/laminated-display-stack.html
1•krm01•30m ago•0 comments

OS Development Wiki

https://wiki.osdev.org/Expanded_Main_Page
2•pykello•30m ago•0 comments

Show HN: I made a 3D Globe platform to promote your startup based on your MRR

https://mrrglo.be
1•sc4p1n•31m ago•0 comments

OpenAI's autonomous hackers and the newsroom revolt of 2020

https://muddy.jprs.me/posts/2026-08-16-the-agents-discovered-slack/
1•jprs•31m ago•0 comments

There's a Libcurl.dll in My System32

https://daniel.haxx.se/blog/2026/08/17/theres-a-libcurl-dll-in-my-system32/
4•chmaynard•32m ago•0 comments

EY turning internships into yearlong residencies as AI changes entry-level work

https://www.businessinsider.com/ey-internship-residency-career-ai-skills-2026-8
1•petethomas•33m ago•0 comments

It Is Past Time for You to Quit Elon Musk's X

https://publiccomment.blog/p/it-is-past-time-for-you-to-quit-elon-musk-s-x
12•jjoachim3•33m ago•2 comments

Vitol Won Exclusive Fuel Deals to Dominate Africa – At a Cost

https://www.bloomberg.com/news/features/2026-08-17/vitol-won-exclusive-fuel-deals-to-dominate-afr...
1•petethomas•36m ago•0 comments

Could Beowulf See Blue?

https://www.deadlanguagesociety.com/p/history-english-colour-words
3•gherkinnn•37m ago•0 comments

Built a free Irish sport TV listings site

https://sportontvireland.ie/about
1•cf100clunk•38m ago•1 comments