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.

Introduction to Plan 9

https://fqa.9front.org/fqa0.html
1•finnlab•2m ago•0 comments

The Secret of Latino Teens' Better Mental Health

https://www.wsj.com/health/wellness/the-secret-of-latino-teens-better-mental-health-36a264eb
1•impish9208•2m ago•1 comments

Most Technical Problems Are People Problems

https://blog.joeschrag.com/2023/11/most-technical-problems-are-really.html
1•mooreds•3m ago•0 comments

The death (desk) star that blew up IBM's hard drive business

https://dfarq.homeip.net/the-death-star-that-killed-ibms-hard-drive-business/
1•giuliomagnifico•3m ago•0 comments

Nvidia's new AI framework trains an 8B model to manage tools like a pro

https://venturebeat.com/ai/nvidias-new-ai-framework-trains-an-8b-model-to-manage-tools-like-a-pro
1•mooreds•4m ago•0 comments

Netflix to Acquire Warner Bros. In $82.7B Deal

https://www.hollywoodreporter.com/business/business-news/netflix-warner-bros-deal-hollywood-12364...
1•LordAtlas•8m ago•0 comments

Making RSS More Fun

https://matduggan.com/making-rss-more-fun/
1•salmon•10m ago•0 comments

Why real-time AI memory is still slow, and a different approach

https://drive.google.com/file/d/1r8BZPMXw-D_o3G4ldZM3Hw2ZvRcbh5lu/view?usp=sharing
1•JosephjackJR•14m ago•1 comments

Netflix announces deal to buy Warner Bros. and HBO

https://www.cnn.com/2025/12/05/media/netflix-deal-warner-bros
1•eatonphil•16m ago•1 comments

Show HN: Sunrise Calendar: custom printed calendar with sun and moon info

1•elijahparker•16m ago•3 comments

Turning 40

https://andreabergia.com/blog/2025/12/turning-40/
1•speckx•18m ago•0 comments

Show HN: I designed the future or technical interviews' preparation

https://sharpskill.fr/en
1•Enjoyooor•19m ago•1 comments

Show HN: I built a Python library for central bank economic announcement data

https://github.com/fxmacrodata/fxmacrodata
1•roberttidball•22m ago•0 comments

The female crash test dummy has been a long time coming – but she isn't here yet

https://www.npr.org/2025/11/21/nx-s1-5616284/female-crash-test-dummy-design-approval
1•bookofjoe•24m ago•0 comments

Domain Watchdog – Monitoring, Expiration and Backorder

https://domainwatchdog.eu/
1•maelgangloff•24m ago•0 comments

Ensmallening Go binaries by prohibiting comparisons

https://dave.cheney.net/2020/05/09/ensmallening-go-binaries-by-prohibiting-comparisons
1•fanf2•29m ago•0 comments

Ask HN: What do you want for Christmas?

1•ruairidhwm•30m ago•1 comments

Netflix to buy Warner Bros film and streaming businesses for $72B

https://www.bbc.com/news/articles/ce91x2jm5pjo
3•vinni2•31m ago•0 comments

Linus Torvalds thinks Elon Musk is 'too stupid' to be working at a tech company

https://www.neowin.net/news/linux-creator-torvalds-thinks-elon-musk-is-too-stupid-to-be-working-a...
14•bundie•34m ago•1 comments

Show HN: Nana Banana – An AI Image Generation Platform with Multiple Top Models

https://nana-banana.org/
1•harperhuang•35m ago•0 comments

Show HN: Guide – A Cognitive Behavioural Therapy Inspired To-Do App

https://blog.nextfive.in/demo/guide/
1•4mitkumar•37m ago•1 comments

Listen to music like it's 2005

https://lukecyca.com/2025/listen-to-music-like-its-2005.html
1•10729287•38m ago•2 comments

Programmable Diffractive Deep Neural Networks

https://www.nature.com/articles/s41598-025-19638-8
1•tesserato•41m ago•0 comments

He managed to format a 3.5" disk so that it could contain more data than 1.44MB

https://old.reddit.com/r/AskReddit/comments/1pea1t8/comment/nsdzhkz/
1•danso•42m ago•0 comments

Mahjong

https://en.wikipedia.org/wiki/Mahjong
1•tosh•43m ago•0 comments

Netflix says it's struck a deal to buy Warner Bros. Discovery

https://www.cnbc.com/2025/12/05/neflix-warner-bros-discovery-deal.html
2•vo2maxer•44m ago•0 comments

Netflix to Acquire Warner Bros

https://about.netflix.com/en/news/netflix-to-acquire-warner-bros
197•meetpateltech•49m ago•96 comments

Elon Musk's X fined €120M by EU in first clash under new digital laws

https://www.theguardian.com/technology/2025/dec/05/elon-musk-x-fined-eu-first-clash-under-new-dig...
3•robin_reala•50m ago•0 comments

Volcanic eruption led to the Black Death, new research suggests

https://www.cnn.com/2025/12/04/science/black-death-volcanic-eruption-tree-rings
4•giuliomagnifico•51m ago•0 comments

How Russia keeps raising an army to replace its dead

https://www.politico.com/news/2025/12/05/russia-planned-war-of-attrition-00672960
3•gregorymichael•52m ago•1 comments