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.

Windscribe – We'll move HQ and take our taxes elsewhere

https://twitter.com/windscribecom/status/2055044048122003569
1•mvdwoord•36s ago•0 comments

America is experiencing a productivity miracle

https://www.economist.com/finance-and-economics/2026/05/11/america-is-experiencing-a-productivity...
1•edward•1m ago•0 comments

UUID vs. NanoID – ID Generation Compared

https://tools.pinusx.com/compare/uuid-vs-nanoid
1•ankitg12•1m ago•0 comments

One-of-One Indirapuram Sets a New Standard for Luxury Living

https://realty.economictimes.indiatimes.com/news/brand-connect-initiative/harmandeep-singh-kandha...
1•KirtiKKapoor•2m ago•0 comments

Court upholds discrimination ruling after male excluded from female-only app

https://www.abc.net.au/news/2026-05-15/nsw-tickle-v-giggle-judgement-transgender-woman/106682498
1•wrwr•2m ago•0 comments

Get best online coupons and promo codes and deals of hot brands

https://www.timelycoupons.com
1•oopp0302•3m ago•0 comments

Ask HN: How to be SOC2 Type 2 compliant as a solo-entreprenuer?

2•sochix•6m ago•2 comments

Zero-day exploit defeats default Windows 11 BitLocker protections

https://arstechnica.com/security/2026/05/zero-day-exploit-completely-defeats-default-windows-11-b...
1•ndsipa_pomu•8m ago•0 comments

Have you switched to AI for heart monitoring during physical activity yet?

1•accofrisk•9m ago•0 comments

Slopsmith: A Self-Hosted Rocksmith Alternative That Runs in Docker

https://github.com/byrongamatos/slopsmith
1•steveharing1•10m ago•0 comments

Jelly Tide: My Honest 30-Day Results (Shocking Before and After)

https://finance.yahoo.com/sectors/healthcare/articles/jelly-tide-gummies-exploding-2026-154100263...
1•ragymkalu•17m ago•0 comments

Establishing AI and data sovereignty in the age of autonomous systems

https://www.technologyreview.com/2026/05/14/1137168/establishing-ai-and-data-sovereignty-in-the-a...
2•joozio•17m ago•0 comments

Turn a bare VPS into an operational fortress in 15 minutes and 1 command

1•rockballslab•18m ago•0 comments

Cerebras risked dinner plate-sized AI accelerators. Today it's worth $66B

https://www.theregister.com/ai-ml/2026/05/15/cerebras-wafer-scale-ai-bet-delivers-blockbuster-ipo...
1•beardyw•20m ago•0 comments

'Everyone is unhappy': Meta faces grim mood, plans 8k layoffs soon amid cuts

https://www.aol.com/finance/everyone-unhappy-meta-employees-describe-151500588.html
3•01-_-•21m ago•0 comments

AI that improves itself indefinitely

https://techcrunch.com/2026/05/14/what-happens-when-ai-starts-building-itself/
3•russfink•22m ago•0 comments

PyCon US 2026 Typing Summit Recap

https://bernat.tech/posts/pycon-us-2026-typing-summit-recap/
2•gaborbernat•22m ago•1 comments

Morgan Stanley Bitcoin ETF $MSBT got an official listing announcement from NYSE

https://twitter.com/EricBalchunas/status/2036831654392561983
2•janandonly•24m ago•0 comments

The era of 15GB free Gmail storage is ending

https://www.androidauthority.com/google-gmail-5gb-free-storage-test-3667002/
3•01-_-•25m ago•0 comments

Android rolling out AI-powered "Contextual suggestion" learning from your habits

https://9to5google.com/2026/05/13/android-contextual-suggestions/
2•theanonymousone•26m ago•0 comments

AI makes weak engineers less harmful

https://www.seangoedecke.com/ai-makes-weak-engineers-less-harmful/
2•vismit2000•28m ago•0 comments

Google lets you move passkeys to another password manager on Android

https://www.androidauthority.com/google-passkeys-move-to-another-password-manager-android-3666965/
1•vdelitz•28m ago•0 comments

Out of the Tar Pit (2006) [pdf]

https://curtclifton.net/papers/MoseleyMarks06a.pdf
1•theanonymousone•38m ago•0 comments

A Design Space and Interaction Model of Abstraction in Interactive Systems

https://arxiv.org/abs/2605.11344
1•mrauha•38m ago•0 comments

Helpful tools from Google to keep your accounts safe

https://blog.google/innovation-and-ai/technology/safety-security/world-password-day-2026/
2•vdelitz•42m ago•0 comments

Make It Blink: Over-the-Air Exploitation of the Philips Hue Bridge

https://www.synacktiv.com/en/publications/make-it-blink-over-the-air-exploitation-of-the-philips-...
1•pieterr•48m ago•0 comments

Visual Chronology of Science and Discovery (2025)

https://invention.cards/
1•pimgeek•49m ago•1 comments

Mullvad VPN users have connectivity issues with Supabase

https://status.supabase.com/incidents/ybxpvtjys08w
1•dinoqqq•49m ago•0 comments

The Infinity Machine – Demis Hassabis and the Quest for Superintelligence

https://www.penguinrandomhouse.com/books/752231/the-infinity-machine-by-sebastian-mallaby/
2•zmeden•50m ago•0 comments

Medium's JavaScript Bloat, Gibberish Semantics, and Accessibility Failings

https://medium.com/codex/mediums-javascript-bloat-gibberish-semantics-and-accessibility-failings-...
1•hexage1814•55m ago•1 comments