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•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.

C-suite exodus at Boston Dynamics

https://www.semafor.com/article/05/01/2026/c-suite-exodus-at-boston-dynamics
1•ilamont•35s ago•0 comments

How My Mother Made Magic Happen

https://lithub.com/how-my-mother-made-magic-happen/
1•speckx•49s ago•0 comments

China to Invest in DeepSeek at $50B Valuation

https://www.wsj.com/tech/ai/china-to-invest-in-deepseek-at-50-billion-valuation-045041d0
1•gmays•1m ago•0 comments

Using QUIC backscatter to infer hypergiant deployment configurations

https://blog.apnic.net/2026/04/21/using-quic-backscatter-to-infer-hypergiant-deployment-configura...
1•PaulHoule•5m ago•0 comments

18 year old critical vulnerability found in Nginx

https://twitter.com/Markak_/status/2054599711764750498
4•ejcho•5m ago•0 comments

MAME now emulates a Stasi numbers-station speech synthesizer

https://blog.adafruit.com/2022/12/13/mame-now-emulates-a-stasi-numbers-station-speech-synthesizer/
1•austinallegro•6m ago•1 comments

Esploro.app – Modern, sleek and fast SQL client for Mac (open-source / free)

https://esploro.app/
1•mmunj•6m ago•0 comments

Reading the Gerlich AI/critical thinking paper more closely

https://old.reddit.com/r/AICognitiveWatch/
1•GlyphWeaver_a•9m ago•0 comments

Mammalian-like steroidogenesis in plants gives rise to cardenolides

https://www.science.org/doi/10.1126/sciadv.aeb5460
1•PaulHoule•9m ago•0 comments

Altman forced to confront claims at OpenAI trial that he's a prolific liar

https://arstechnica.com/tech-policy/2026/05/altman-forced-to-confront-claims-at-openai-trial-that...
7•Bender•9m ago•0 comments

The Wide Paved Road versus the Narrow Footpath

https://peterspath.net/blog/essay-the-wide-paved-road-versus-the-narrow-footpath/
1•peterspath•10m ago•0 comments

Takeda, slimming down for 'new era,' plots 4,500 restructuring layoffs

https://www.fiercepharma.com/pharma/takeda-slimming-down-new-era-plots-4500-layoffs-latest-restru...
1•randycupertino•10m ago•1 comments

Nginx.org/En/Changes

https://nginx.org/en/CHANGES
2•qwertox•13m ago•0 comments

Scanread.ai – Free OCR for images, PDFs, and handwriting in 100 languages

https://scanread.ai
2•voqusa•14m ago•1 comments

Is Google or Exa better for RLing agents?

https://exa.ai/blog/rl-search-outcomes
1•willbryk•14m ago•1 comments

Figure humanoid robot package handling live stream [video]

https://www.youtube.com/watch?v=luU57hMhkak
4•Animats•15m ago•1 comments

Freedom to Drive Initiative

https://ops.fhwa.dot.gov/freedom-to-drive-initiative.htm
2•aziaziazi•15m ago•1 comments

Build a Basic AI Agent from Scratch

https://medium.com/@rogi23696/build-a-basic-ai-agent-from-scratch-0be3e3022b55
1•ruxudev•15m ago•0 comments

Notepad++ Mac Port Renamed Nextpad++ After Trademark Row

https://www.macrumors.com/2026/05/13/notepad-plus-plus-mac-nextpad-dispute-settlement/
2•01-_-•15m ago•0 comments

Show HN: Micromort Risk Visualizer

https://boxed.github.io/micromort/
3•boxed•17m ago•0 comments

Verisign to delete .name 3LDs and email addresses

https://domainincite.com/31699-verisign-to-delete-name-3lds-and-email-addresses
2•zacwest•18m ago•1 comments

An overview of NVMe and its support on Maestro

https://blog.lenot.re/a/nvme
1•PaulHoule•19m ago•0 comments

Neanderthals drilled cavities to treat a toothache 59,000 years ago

https://arstechnica.com/science/2026/05/neanderthals-drilled-cavities-to-treat-a-toothache-59000-...
4•Bender•25m ago•0 comments

MacBook Neo Deep Dive: Benchmarks, Wafer Economics, and the 8GB Gamble

https://www.jdhodges.com/blog/macbook-neo-benchmarks-analysis/
1•tosh•25m ago•0 comments

A new US Military wargame series began by simulating a nuclear weapon in orbit

https://arstechnica.com/space/2026/05/a-new-us-military-wargame-series-began-by-simulating-a-nucl...
2•Bender•25m ago•0 comments

Tinyhumansai/openhuman: Your Personal AI super intelligence

https://github.com/tinyhumansai/openhuman
1•ulrischa•27m ago•0 comments

Restricting automatic kernel-module loading (2017)

https://lwn.net/Articles/740455/
1•kerneloops•28m ago•0 comments

Apple Working on Plan to Allow AI Agent Apps on the App Store

https://www.macrumors.com/2026/05/13/apple-ai-agent-apps-app-store/
1•thm•30m ago•0 comments

A sentimental tour of late 1990s and early 2000s hacking tools

https://andreafortuna.org/2026/05/13/amarcord/
3•speckx•31m ago•0 comments

Use the Claude Agent SDK with Your Claude Plan

https://support.claude.com/en/articles/15036540-use-the-claude-agent-sdk-with-your-claude-plan
7•AlexErrant•31m ago•4 comments