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.

The Making of Grand Theft Auto VI

https://www.bloomberg.com/features/2026-grand-theft-auto-6-making-of/
1•zuInnp•38s ago•1 comments

Show HN: OraStage – turn two photos into a Hotel Lobby rap video

https://orastage.com/
1•sylwair•1m ago•0 comments

New Simulation Found for Physics

https://pmad-sim.org/sim.html
1•mrbrown1125•2m ago•0 comments

Show HN: Building an LLM from Scratch in TypeScript

https://book.humanexperiences.io/
3•baraa_•5m ago•0 comments

TV4 postpones show after AI agent erases edited material

https://swedenherald.com/article/tv4-postpones-the-challenge-until-2027-after-technical-failure-e...
2•tobr•6m ago•1 comments

Pulsar at ESUG 2026 (new Smalltalk IDE)

https://blog.lorenzano.eu/pulsar-at-esug-2026/
2•mpweiher•8m ago•0 comments

AI Laser Locking for Quantum Computers: How QuEra Automates It

https://www.quera.com/blog-posts/holding-the-light-teaching-an-ai-to-lock-and-tune-our-quantum-co...
2•EvgeniyZh•8m ago•0 comments

I let an AI run my startup for a week

https://daily.tinyprojects.dev/221
8•tinyprojects•9m ago•0 comments

Intuit vs. Oracle: Which Technology Stock Is the Smarter Investment for 2026?

https://www.rswebsols.com/news/intuit-vs-oracle-which-technology-stock-is-the-smarter-investment-...
2•rswebsols•10m ago•0 comments

The meaning of life in a world without work – Yuval Noah Harari (2017)

https://www.theguardian.com/technology/2017/may/08/virtual-reality-religion-robots-sapiens-book
2•guitarlimeo•11m ago•0 comments

Agent erased full season of "The Challenge Swe": "Hundreds of days of work gone"

https://www.aviaduct.com/?l=og+en&u=https%3A%2F%2Fwww.aftonbladet.se%2Fnojesbladet%2Fa%2F31oE8A%2...
2•lensecat•14m ago•0 comments

EscapeFrom – would you use it?

https://escapefrom.city
2•drungli•14m ago•1 comments

Show HN: Fakenamegenerator – free browser based mock data generator

https://www.fakenamegenerator.online/
2•zamranilyas•14m ago•0 comments

Reviewing Ergodnc – What a Clean Laravel API Still Gets Wrong

https://codyssey.dev/code-reviews/reviewing-ergodnc-clean-laravel-api
2•davorminchorov•16m ago•1 comments

Lessons for the 21st century from a book by 'Frankenstein' author Mary Shelley

https://worldsensorium.com/lessons-for-the-21st-century-from-a-200-year-old-book-by-frankenstein-...
2•dnetesn•18m ago•0 comments

Fish Audio Drama 3: an open-weight, directable TTS model

https://huggingface.co/fishaudio/drama-3
2•joshcsimmons•19m ago•0 comments

Humans drew pictures on the sky, and what the pictures tell us

https://blue-continuum.com/connect-the-dots
2•dnetesn•20m ago•0 comments

Show HN: Graft – open-source source control for agent-scale monorepos

https://github.com/VishiATChoudhary/graft
2•vc14•21m ago•1 comments

Game of Life – But Multiplayer, Hypermedia and Python

https://stario.dev/apps/life
2•bobowski•21m ago•0 comments

Pear, PHP's First Package Manager

https://phpnews.net/pear-history
2•ericbarnes•23m ago•0 comments

Ask HN: Many SWEngs out there are considering re-training

7•jrowilliams•24m ago•2 comments

Ask HN: Why do people say "I built it" when we should say "Claude built it"?

4•gonzar79•26m ago•4 comments

Apple: Switch to Safari (From Chrome)

https://www.apple.com/safari/switch/
5•signa11•26m ago•1 comments

Grist: Turn the spreadsheets running your business into secure applications

https://www.getgrist.com/
2•janandonly•27m ago•0 comments

Zewards

https://zewards.app
2•creaateo•28m ago•0 comments

Show HN: A guided 3D Leonardo da Vinci museum, built in code

https://museumofages.org/w/vinci
2•micstradev•34m ago•3 comments

The operation of Starlink terminals in Ukraine was restricted above 160 kph

https://www.reddit.com/r/UkraineWarVideoReport/comments/1x5kefw/last_night_the_operation_of_starl...
6•jacquesm•40m ago•0 comments

Science Corp implants its vision-restoring chip in its first Stargardt patient

https://techcrunch.com/2026/10/13/science-corporation-implants-its-vision-restoring-chip-in-its-f...
3•bookofjoe•40m ago•0 comments

Ask HN: What is the current trajectory of a senior engineer?

7•guitarlimeo•40m ago•3 comments

Can I offer you a nice CI Pipeline in this trying time?

https://practicalai.co.nz/blog/6.html
2•sgrnz•44m ago•0 comments