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

Comments

zoezoezoezoe•6mo 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•6mo 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.

Linus Pauling

https://en.wikipedia.org/wiki/Linus_Pauling
1•CGMthrowaway•3m ago•0 comments

Building a Crowd-Feeding platform. Donors fund meals, Restaurants serve them

https://www.bridgemeals.com/
1•willingo•4m ago•0 comments

Show HN: I built and AI phone system and wrote a step by step instructions

https://www.yadalog.com/blog/ai_phone_system_voicemail
1•bacdor•5m ago•0 comments

Soccer, emeralds and cocaine: The 'new' Colombian drug lords with ties to Spain

https://english.elpais.com/international/2025-11-02/soccer-emeralds-and-cocaine-the-new-colombian...
1•PaulHoule•8m ago•0 comments

U.N. Security Council Adopts U.S. Peace Plan for Gaza

https://www.nytimes.com/2025/11/17/world/middleeast/un-security-council-gaza-peace-plan.html
1•vladgur•8m ago•1 comments

'Ugly' Technicals Put the US Stock Rally at Risk of Correction

https://www.bloomberg.com/news/articles/2025-11-17/-ugly-technicals-put-the-us-stock-rally-at-ris...
1•zerosizedweasle•10m ago•0 comments

Randomized Banner Icons with JavaScript and Astro Framework

https://www.nickstambaugh.dev/posts/random-banner-icons
1•sieep•10m ago•0 comments

Lower Than London

https://diamondgeezer.blogspot.com/2025/11/lower-than-london.html
1•zeristor•10m ago•0 comments

Show HN: I developed an IDE tailored for Python developers

1•honghaier•11m ago•0 comments

Valar Atomics Says It's the First Nuclear Startup to Achieve Criticality

https://www.wired.com/story/valar-atomics-says-its-the-first-nuclear-startup-to-achieve-criticality/
3•mellosouls•12m ago•1 comments

Growth of global GDP per head has been remarkably steady over the past 3 decades

https://ourworldindata.org/data-insights/growth-of-global-gdp-per-capita-has-been-remarkably-stea...
1•alphabetatango•13m ago•0 comments

Eurofiber admits crooks swiped data from French unit after cyberattack

https://www.theregister.com/2025/11/17/eurofiber_breach/
2•shdon•15m ago•0 comments

Another Designer Leaves Apple

https://www.macrumors.com/2025/11/17/another-designer-leaves-apple/
2•mgh2•15m ago•0 comments

Iframe with Hot Reload for Code Agents

https://github.com/cesarleaz/iframe-hotreload
1•gabyword•21m ago•0 comments

Epstein files: Larry Summers steps back from commitments over email fallout

https://www.cnbc.com/2025/11/17/larry-summers-jeffrey-epstein-harvard.html
3•koolba•22m ago•0 comments

Parasitic ant tricks workers into killing their queen, then takes the throne

https://phys.org/news/2025-11-parasitic-ant-workers-queen-throne.html
1•wglb•28m ago•1 comments

Legendary game designer, programmer Rebecca Heineman has died

https://www.pcgamer.com/gaming-industry/legendary-game-designer-programmer-space-invaders-champio...
10•shdon•30m ago•1 comments

Physical Intelligence: A VLA That Learns From Experience

https://www.pi.website/blog/pistar06
1•modeless•31m ago•0 comments

Convert Video to 4K Online – AI 4K Video Converter

https://www.4kupscaler.com/tools/convert-video-to-4k
1•aiwebwin2025•36m ago•1 comments

Out-of-Distribution Generalization in Transformers via Latent Space Reasoning

https://arxiv.org/abs/2510.14095
1•marojejian•40m ago•1 comments

I caught Google Gemini using my data–and then covering it up

https://unbuffered.stream/gemini-personal-context/
15•JakaJancar•44m ago•1 comments

Duolingo Isn't 'Free' Anymore – Lily Told Me Why [video]

https://www.youtube.com/watch?v=y8cd1oT3G4Q
1•zeristor•45m ago•0 comments

Music sequenced on Atari MegaSTE

https://tonleiter.net/reihenhaus/
1•nperson•54m ago•0 comments

Replicate Is Joining Cloudflare

https://blog.cloudflare.com/replicate-joins-cloudflare/
3•soheilpro•55m ago•0 comments

Texas Board of Education signals push to the right in social studies overhaul

https://www.texastribune.org/2025/11/14/texas-sboe-social-studies-redesign-conservative-advisers/
1•1659447091•56m ago•0 comments

Judgment Calls

https://thinkhuman.com/judgment-calls/
1•jamesgill•56m ago•0 comments

Fighting poison with poison: A deep-sea worm uses toxins as armor

https://newatlas.com/biology/deep-sea-worm-toxin-armor/
2•rguiscard•56m ago•0 comments

RIP Rebecca Heineman

https://en.wikipedia.org/wiki/Rebecca_Heineman
11•coloneltcb•57m ago•2 comments

What It's Like Working at Conductor

https://www.notion.so/conductor-build/What-It-s-Like-Working-at-Conductor-29da076bd0f2808bad97e3a...
3•jacksondc•57m ago•0 comments

F# 10

https://devblogs.microsoft.com/dotnet/introducing-fsharp-10/
4•soheilpro•58m ago•0 comments