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.

Meet the crypto billionaires building a world where money buys you a vote

https://www.bbc.com/news/articles/cly8eqyj8e2o
1•1vuio0pswjnm7•49s ago•0 comments

AliExpress gets record €550M fine from EU for allowing sale of illegal products

https://www.bbc.com/news/articles/cp8714286dpo
1•leephillips•1m ago•0 comments

Building the Pkg.go.dev TUI Explorer

https://packagemain.tech/p/building-a-pkggodev-tui-explorer
1•der_gopher•1m ago•0 comments

Dragon Labs CR-8: An 8-Channel Coherent SDR Crowdfunding Soon

https://www.rtl-sdr.com/dragon-labs-cr-8-an-8-channel-coherent-sdr-crowdfunding-soon/
1•wyclif•1m ago•0 comments

Cursor: SQLite rebuilt from manual with different model agents

https://twitter.com/cursor_ai/status/2079256614238814551
1•nvahalik•2m ago•0 comments

Software-defined hardware in the age of AI

https://www.mckinsey.com/features/mckinsey-center-for-future-mobility/our-insights/software-defin...
1•arbayi•4m ago•0 comments

AI Agentic Landscape 2026

https://trustedagents.manzia.com
1•royt75•4m ago•0 comments

Pasly – Make every ⌘V smarter

https://pasly.app/
1•AntonielMariano•6m ago•0 comments

Nvidia is building the first 'national AI'

https://www.techradar.com/pro/nvidia-is-building-the-worlds-first-national-ai-japans-frontia-proj...
2•01-_-•6m ago•0 comments

Show HN: Visual-HN – a hcker.news reader with images

https://hn.is-ai-good-yet.com/?view=frontpage
3•ilyaizen•7m ago•0 comments

Levels of Concern

https://graybeard.ing/levels-of-concern/
1•rglover•8m ago•1 comments

Reputation Is a Strategic Asset–Treat It Like One

https://freethinkinggenius.substack.com/p/your-reputation-is-a-strategic-assettreat
1•meticulousjess•8m ago•0 comments

Mark Cuban: fight inequality by giving all workers company stock

https://fortune.com/2026/07/20/mark-cuban-income-inequality-company-stock-spacex-ipo-cost-plus-dr...
3•01-_-•8m ago•1 comments

Ransomware attack forces Coca-Cola to suspend US production at dairy unit

https://www.cybersecuritydive.com/news/ransomware-attack-coca-cola-suspend-production-dairy/825540/
1•fortran77•8m ago•0 comments

Show HN: Intersections – A Daily Word Game

https://www.playintersections.com/
1•ch_ase•9m ago•1 comments

Don't Wait, Learn – The Best Resource Is Mythical

https://arpitbhayani.me/blogs/best-resource-is-mythical/
1•s_vighnesh•9m ago•0 comments

The Science of Winning: How High Performers Think About Risk

https://freethinkinggenius.substack.com/p/the-science-of-winning-how-high-performers
1•meticulousjess•10m ago•0 comments

Show HN: AI World Bakeoff – 9 models × 3 Three.js worlds

https://ai-world-bakeoff.pages.dev/
1•valhallarecords•11m ago•0 comments

I tried to record music onto a cassette tape using modern tech

https://swiftrocks.com/i-tried-to-record-music-onto-a-cassette-tape-using-modern-tech
1•ingve•13m ago•0 comments

Interactive Claude Code Reference

https://schwwaaa.github.io/claude-cheatsheet/
1•schwwaaa•14m ago•0 comments

Show HN: Fable,Kimi,GPT5.6 FFA naval war,airstrikes and radio diplomacy [video]

https://www.youtube.com/watch?v=nFxRtjgKtY0
1•masterchef2209•16m ago•0 comments

LA to Farnborough UK in Under 9h Max Speed Mach 0.93

https://bombardier.com/en/media/news/bombardiers-global-8000-worlds-fastest-civil-aircraft-sets-n...
2•r2sk5t•16m ago•1 comments

Why Microsoft's $80B Xbox Bet Backfired

https://www.wsj.com/video/why-microsoft-80-billion-xbox-bet-backfired/1CE7B4ED-CFBE-4DD8-A2AB-CC9...
3•1vuio0pswjnm7•17m ago•1 comments

Cue AI

https://deepmind.google/models/gemma/gemmaverse/cue-ai/
1•logickkk1•19m ago•0 comments

The /Goal Function Made Loop Engineering Click for Me

https://bhart.org/articles/the-goal-function-made-loop-engineering-click-for-me
2•yruzin•21m ago•0 comments

Tell HN: Old Reddit Now Requires Login

9•quincepie•21m ago•4 comments

Show HN: Lagotto Meter – how well do AI agents understand your website?

https://lake8.dev/lagotto-meter/
1•tommy2970•22m ago•0 comments

The Supply Deals Feeding the AI Frenzy Are No Sure Thing

https://www.wsj.com/finance/the-massive-supply-deals-feeding-the-ai-frenzy-are-no-sure-thing-3a89...
1•1vuio0pswjnm7•23m ago•0 comments

FCC plans ID mandate that could block anonymous use of prepaid burner phones

https://arstechnica.com/tech-policy/2026/06/fcc-plans-id-mandate-that-could-block-anonymous-use-o...
2•dynm•24m ago•0 comments

State of In-App Subscriptions

https://adapty.io/state-of-in-app-subscriptions/
1•kamphey•24m ago•0 comments