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.

How Russia's nuclear-powered 'Skyfall' missile works

https://www.npr.org/2026/06/18/nx-s1-5843252/russia-nuclear-powered-missile-burevestnik
1•rbanffy•52s ago•0 comments

Strix: Autonomous Security Platform

https://www.strix.ai/
1•handfuloflight•3m ago•0 comments

Using Gemini to Manage a Farm

https://blog.google/innovation-and-ai/models-and-research/gemini-models/using-gemini-to-manage-farm/
2•simonpure•8m ago•0 comments

Robot Dogs Are a Security Nightmare [video]

https://www.youtube.com/watch?v=lA8WuXDXfcI
1•Bender•13m ago•0 comments

Couple Stalked by eBay Settle for $56M

https://www.nytimes.com/2026/07/28/technology/ebay-settles-stalking-case.html
4•xnx•15m ago•1 comments

The Cipher Behind QSYRUPWD: Reconstructing IBM i Password Hashes

https://blog.silentsignal.eu/2026/07/28/the-cipher-behind-qsyrupwd-reconstructing-ibm-i-password-...
1•kencausey•15m ago•1 comments

FileGRC: Git and file-based SoC 2

https://github.com/Sunpeak-AI/FileGRC
1•handfuloflight•15m ago•0 comments

Pixar's Layoffs Came Days After Receiving a $26M Tax Credit

https://amidamidi.substack.com/p/pixars-layoffs-came-days-after-receiving
2•ani_obsessive•16m ago•0 comments

Show HN: MKPM – GNU Make Package Manager

https://github.com/fe18m/mkpm
1•f18m•17m ago•1 comments

Show HN: list55.com: Transcribe a list into plain text

https://list55.enzom.dev/
1•emadda•17m ago•0 comments

Show HN: Hamza Mask secrets and PII before Claude Code or Codex sends them

https://github.com/softcane/hamza
1•pradeep1177•17m ago•0 comments

Advantages and disadvantages of Windows NT 3.1

https://dfarq.homeip.net/advantages-and-disadvantages-of-windows-nt-3-1/
1•birdculture•17m ago•0 comments

Running Kimi K3 on a M1 Mac

https://github.com/gavamedia/deltafin
5•tito•18m ago•0 comments

A Vine in the Wind

https://blog.sao.dev/vine-in-the-wind/
1•stuartaxelowen•18m ago•0 comments

Distilling the Moat

https://blog.dshr.org/2026/07/distilling-moat.html
1•gmays•20m ago•0 comments

Wordfence Prism AI Vulnerability Detector Finds Backdoored WordPress Plugin

https://www.wordfence.com/blog/2026/07/wordfence-prism-detected-backdoored-wordpress-plugin-withi...
2•leecoursey•24m ago•0 comments

LLMs Will Benefit from Scratch Workspaces

https://win-vector.com/2026/07/28/llms-will-benefit-from-scratch-workspaces/
3•jmount•24m ago•0 comments

Show HN: CogniKernel; AI Coding with cross session and cross platform memory

https://github.com/KanishkNoir/cognikernel
2•KanishkNoir•25m ago•0 comments

My Personal Software Journey: Self-Hosting Agent-Built Apps on a Mac Mini

https://metedata.substack.com/p/016-my-personal-software-journey
2•young_mete•25m ago•0 comments

The word is not the food

https://thetraces.substack.com/p/the-word-is-not-the-food
3•feldrim•28m ago•0 comments

The consumable space data center

https://networkingnerd.net/2026/07/28/the-consumable-space-data-center/
2•tatersolid•28m ago•0 comments

The Forgetting Machine

https://thetraces.substack.com/p/the-forgetting-machine
2•feldrim•28m ago•0 comments

Visa time limits on foreign PhD students and postdocs will harm U.S. science

https://www.statnews.com/2026/07/28/dhs-visa-policy-change-international-students-scientific-rese...
4•Jimmc414•29m ago•0 comments

Wikimedia Won't Voluntarily Recognize Union a Supermajority of Its Workers Want

https://www.404media.co/wikimedia-waits-until-after-its-massive-conference-to-say-it-wont-volunta...
4•pizzaiolo•30m ago•0 comments

Point AI at a "Proven" Microkernel?

2•RantyDave•30m ago•0 comments

Anthropic publishes a practical key-recovery attack on HAWK-256

https://github.com/anthropics/cryptography-research-demo
7•bakigul•30m ago•0 comments

Farmers Are Getting Control of Their Equipment Back

https://www.eff.org/deeplinks/2026/07/farmers-are-getting-control-their-equipment-back
7•Jimmc414•31m ago•0 comments

Iran Has Figured Out How to Overwhelm U.S. Air Defenses

https://theintercept.com/2026/07/28/iran-missiles-drones-us-air-defenses/
10•Jimmc414•32m ago•3 comments

AI Shi(f)ts the Cost to the Reader

https://aloutfi.com/writing/ai-shifts-the-cost-to-the-reader
3•anloutfi•33m ago•1 comments

FBI Seeks AI for Political Watch List

https://reason.com/2026/07/28/minority-report-fbi-seeks-ai-for-political-watch-list/
9•devonnull•35m ago•1 comments