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•7mo ago

Comments

zoezoezoezoe•7mo 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•7mo 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 Hierarchy of Work Complexity Is Inescapable (Even at Buurtzorg)

https://synexia.substack.com/p/the-hierarchy-of-work-is-inescapable
1•asplake•1m ago•0 comments

Linux 6.18 Released

https://lore.kernel.org/lkml/CAHk-=whnC+hRftevTLeVs3tyyqwn+7un=jUES2-WX+pZhDdKNw@mail.gmail.com/T/#u
2•jrepinc•10m ago•1 comments

Arch Linux-based EndeavourOS releases Ganymede

https://endeavouros.com/news/the-long-wait-is-over-ganymede-has-arrived/
2•jrepinc•12m ago•0 comments

Show HN: BirdWrite – The AI Engine for World-Class Content

https://birdwrite.vercel.app/
1•devanimecx•14m ago•0 comments

TSMC Overseas Fabs – A Success?

https://newsletter.semianalysis.com/p/tsmc-overseas-fabs-a-success
1•emschwartz•15m ago•0 comments

Show HN: Tera.fm – Listen to Hacker News instead of reading it

https://tera.fm/
1•digi_wares•18m ago•1 comments

SmartTube Compromised

https://www.aftvnews.com/smarttubes-official-apk-was-compromised-with-malware-what-you-should-do-...
1•akersten•22m ago•0 comments

A speculative framework for thinking about civilization resolution in the AI era

https://ontomesh.org/civilization-resolution-png-era.html
2•nettalk83•23m ago•1 comments

Waymo Has a Charging Problem

https://insideevs.com/news/780391/waymo-charging-depot-santa-monica/
1•voxadam•25m ago•1 comments

'A full-blown crisis': Americans brace for a surge in healthcare costs

https://www.ft.com/content/beec76df-8e6d-4238-bae2-e51683b62aa4
35•mmarian•30m ago•22 comments

DeLorean Time Travel Engine: Software Anatomy of the 1885 Bug

https://medium.com/@muhammetus/delorean-time-travel-engine-software-anatomy-of-the-1885-bug-0a2f5...
1•thunderbong•31m ago•0 comments

Show HN: Notionfile – Notion templates designed to reduce founder friction

https://notionfile.com
1•tuhel•32m ago•0 comments

Time's up for Rolex? British watchmakers challenge Swiss dominance

https://www.thetimes.com/world/middle-east/article/britain-watch-manufacturing-dubai-bjx06jdmc
2•petethomas•33m ago•0 comments

Stacked Diffs with git rebase —onto

https://dineshpandiyan.com/blog/stacked-diffs-with-rebase-onto/
1•flexdinesh•35m ago•0 comments

Wispr Flow raised $81M for this. I open-sourced it: jarvis.ceo (free forever)

https://github.com/akshayaggarwal99/jarvis-ai-assistant
2•imaka•35m ago•2 comments

Carbon costs of different pathways for reducing fire hazard in the Sierra Nevada

https://esajournals.onlinelibrary.wiley.com/doi/10.1002/eap.70111
1•PaulHoule•35m ago•0 comments

Fancy lion's mane in your latte? The rise of mushroom coffee

https://www.thetimes.com/life-style/food-drink/article/mushrooms-collagen-functional-coffee-g8t03...
1•petethomas•36m ago•0 comments

The lab where Carlsberg is brewing beers of the future

https://www.thetimes.com/life-style/food-drink/article/inside-lab-carlsberg-beers-future-7kzgsfvzz
1•petethomas•39m ago•0 comments

Dookie.nvim: A color scheme inspired by Plan9's acme editor

https://github.com/pebeto/dookie.nvim
1•joseesparza•40m ago•0 comments

Google Antigravity just deleted the contents of whole drive

https://old.reddit.com/r/google_antigravity/comments/1p82or6/google_antigravity_just_deleted_the_...
4•tamnd•43m ago•1 comments

AI helps drive record $11.8B in Black Friday online spending

https://www.reuters.com/business/retail-consumer/us-consumers-spent-118-billion-black-friday-says...
1•TMWNN•58m ago•1 comments

Show HN: Two physics-based programming languages (WPE/TME and Crystalline)

https://github.com/Heimdall-Organization/DHawk-Labs
1•yodamonk1•1h ago•0 comments

Top Gun Traders: Stock Bets and Crypto Culture Take over the Military

https://www.wsj.com/finance/stock-trading-military-crypto-culture-75fb3c59
3•JumpCrisscross•1h ago•2 comments

Yout and RIAA Clash in Court over YouTube's Alleged Copyright Barriers

https://torrentfreak.com/yout-and-riaa-clash-in-court-over-youtubes-alleged-copyright-barriers/
3•gslin•1h ago•0 comments

Observation of neutron emission acoustic cavitation deuterated titanium powder

https://www.nature.com/articles/s41598-024-62055-6
2•throwaway1492•1h ago•1 comments

The potential existential threat of LLMs to online survey research

https://www.pnas.org/doi/10.1073/pnas.2518075122
2•apical_dendrite•1h ago•0 comments

Inside NY Time's Hoax Factory

https://twitter.com/DavidSacks/status/1995225152674533557
1•rmason•1h ago•2 comments

The Ex-President Whom Trump Plans to Pardon Flooded America with Cocaine

https://www.nytimes.com/2025/11/29/nyregion/honduras-hernandez-drug-trafficking.html
11•duxup•1h ago•1 comments

Men 'portrayed as either frightening or pathetic in film and TV'

https://www.telegraph.co.uk/news/2025/11/15/men-portrayed-as-either-frightening-or-pathetic-in-fi...
3•nreece•1h ago•0 comments

A Different Conversation with Nikhil Kamath [video]

https://www.youtube.com/watch?v=Rni7Fz7208c
1•twapi•1h ago•0 comments