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.

PalmOS on FisherPrice Pixter Toy

https://dmitry.gr/?r=05.Projects&proj=27.%20rePalm#pixter
1•dmitrygr•3m ago•0 comments

Have I Been Flocked? – Check If Your License Plate Is Being Watched

https://haveibeenflocked.com/
1•pkaeding•4m ago•0 comments

Show HN: Flexy – We Built a Faster Way to Get Small Dev Tasks Done

https://www.flexytasks.dev/
1•plakhlani2•5m ago•1 comments

Angel

https://en.wikipedia.org/wiki/Angel
1•marysminefnuf•5m ago•0 comments

Show HN: A small reasoning engine that learns rewrite rules from two examples

2•heavymemory•9m ago•0 comments

Jolla Launches Community-Funded Linux Phone

https://linuxiac.com/jolla-launches-community-funded-linux-phone/
1•embedding-shape•23m ago•0 comments

Building PagerDuty's SRE Agent

https://www.pagerduty.com/eng/context-over-cleverness-building-pagerdutys-sre-agent/
1•dadbod80•25m ago•0 comments

Nice overview of ESP32 devkits and ecosystems [video]

https://www.youtube.com/watch?v=sM34IYTIPyQ
3•NoxiousPluK•27m ago•2 comments

Supreme Court Agrees to Review Trump Order Restricting Birthright Citizenship

https://www.nytimes.com/2025/12/05/us/politics/supreme-court-trump-birthright-citizenship.html
2•treetalker•29m ago•1 comments

Show HN: Radioactive Pooping Knights

https://minichessgames.com/#/play/pooping-knights
3•patrickdavey•37m ago•1 comments

Mock Roles, not Objects (2004) [pdf]

https://jmock.org/oopsla2004.pdf
1•n3t•37m ago•0 comments

I cracked a $200 software protection with xcopy

https://www.ud2.rip/blog/enigma-protector/
5•vmfunc•43m ago•1 comments

New Study Investigates How Diet May Slow Normal Brain Aging

https://www.bumc.bu.edu/camed/news-events/articles/2025/new-study-investigates-how-diet-may-slow-...
1•gslin•43m ago•0 comments

EU hits X with €120M fine for breaching the Digital Services Act

https://www.dw.com/en/eu-imposes-120-million-fine-on-elon-musks-x-for-breaking-digital-rules/a-75...
14•vincvinc•49m ago•3 comments

Windows Telemetry

https://sizeof.cat/post/windows-telemetry/
2•DustinEchoes•50m ago•0 comments

India backs off from requiring government-made security app

https://www.scworld.com/news/india-backs-off-from-requiring-government-made-security-app
1•Bender•55m ago•1 comments

Sandvik gets €500M from European Investment Bank for new, smart EVs

https://electrek.co/2025/12/05/sandvik-gets-e500m-from-european-investment-bank-for-new-smart-evs/
1•Bender•55m ago•0 comments

Ultrablack wool textiles inspired by hierarchical avian structure

https://www.nature.com/articles/s41467-025-65649-4
4•defrost•1h ago•2 comments

State of decay in self-hosted commenting (code review)

https://bykozy.me/blog/state-of-decay-in-self-hosted-commenting/
1•byko3y•1h ago•0 comments

HTML Kong (2016)

https://www.xn--8ws00zhy3a.com/blog/2016/07/html-kong#f16.1
1•mmulet•1h ago•1 comments

DeslopifAI – Remove AI Slop

4•haeli05•1h ago•0 comments

Show HN: NanoAI – Unified AI Image Workspace (Generation, Inpainting, Upscaling)

https://nanoai.run
1•Li_Evan•1h ago•0 comments

Show HN: macOS Window Managers Directory

https://macoswm.com/
1•j0r0b0•1h ago•0 comments

Ask HN: What is the future of SaaS when things are this easy to build?

3•fbrncci•1h ago•1 comments

Making WebAssembly and Wasmtime More Portable (2024)

https://bytecodealliance.org/articles/wasmtime-portability
2•apitman•1h ago•0 comments

Data Centers Are a 'Gold Rush' for Construction Workers

https://www.wsj.com/business/data-centers-are-a-gold-rush-for-construction-workers-6e3c5ce0
1•lxm•1h ago•0 comments

A 2,500-year lineage of daemon-like naming conventions, from antiquity to AI

2•troyka•1h ago•1 comments

Mark Zuckerberg rebranded for metaverse. $70B in losses, he's moving on

https://fortune.com/2025/12/05/mark-zuckerberg-metaverse-layoffs-cuts-facebook-rebrand/
5•nsoonhui•1h ago•3 comments

Purpose from First Principles

https://planktonvalhalla.com/20251204-purpose-from-first-principles/
1•mrcgnc•1h ago•0 comments

Hitachi Cooling and Heating Innovations with Heat Pump Tech at AHR 2025 [video]

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