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.

The ColorChecker, photography's most important 24 squares, turns 50

https://www.dpreview.com/news/the-colorchecker-photographys-most-important-24-squares-turns-50/
1•sohkamyung•3m ago•0 comments

Open Source Access Control Management Application

https://github.com/Simkura-tech/loudin
1•jackmerrifield2•3m ago•1 comments

World's biggest dark matter detector spots a single weird particle

https://www.science.org/content/article/world-s-biggest-dark-matter-detector-spots-single-weird-p...
1•zzzeek•4m ago•0 comments

Claude Preserved thinking – Modifying a conversation now results in an error

https://platform.claude.com/docs/en/build-with-claude/preserved-thinking
1•sippeangelo•7m ago•0 comments

Don't allow Gemini AI access to your Gmail

https://tuta.com/blog/google-gemini-ai-email
3•bwidlar•8m ago•0 comments

AI Coding Agent Skills for Real Engineers

https://github.com/mattpocock/skills
1•gurjeet•9m ago•0 comments

Copilot code review can now approve pull requests

https://github.blog/changelog/2026-09-01-copilot-code-review-can-now-approve-pull-requests/
1•fourfire•9m ago•0 comments

The Future Is Not Tech-Forward

https://www.thetechbubble.info/p/the-future-is-not-tech-forward
1•doener•11m ago•0 comments

What's within a 10-minute walk in 50 European cities

https://strado.info/
2•bookofjoe•11m ago•0 comments

Library of ODE Solvers

https://solvers.milanrother.com/
1•skywalqer•11m ago•0 comments

How to Build a Notion AI Chatbot for Your Help Center

https://quickchat.ai/post/notion-ai-chatbot-help-center
1•piotrgrudzien•12m ago•0 comments

TikTok CEO says over two dozen Jewish organizations are telling them who to ban

https://twitter.com/MaryBowdenMD/status/2094500265206407223
7•slowin•15m ago•0 comments

Dyson Made a Camera-Equipped Toothbrush That Flosses for You

https://www.theverge.com/tech/986737/dyson-camerajet-smart-toothbrush-live-camera-flosser-pricing...
2•airhangerf15•17m ago•0 comments

Inception: Mercury 2.5 Preview on OpenRouter

https://openrouter.ai/inception/mercury-2.5-preview
1•Topfi•19m ago•1 comments

Moe expert offloading on a 2-core Celeron with 2.7GB RAM

https://github.com/dhishwasher/moe-offload-bench
2•fukoffandie•20m ago•0 comments

ChatBlackGPT

https://chatblackgpt.com/
1•rmason•21m ago•1 comments

I Want a Wife (1971) [pdf]

https://www.sevanoland.com/uploads/1/1/8/0/118081022/_brady_i_want_a_wife.pdf
2•NaOH•23m ago•0 comments

Decompiler Explorer

https://dogbolt.org
3•tripdout•24m ago•0 comments

Beneath the Bottleneck: An R&D and Technology Review of Lithium and Rare Earths

https://dukespace.lib.duke.edu/bitstreams/909c3952-6af4-48dd-a4d0-9baf0b16880c/download
3•Eridanus2•25m ago•0 comments

Rootkit Evading Elastic Defend Module Load Detection

https://matheuzsecurity.github.io/hacking/elastic-trusted-pid-bypass/
1•matheuzsec_•26m ago•0 comments

My local model setup on an M4 Pro Mac Mini

https://lws.io/blog/my-local-model-setup/
3•raybb•26m ago•0 comments

MapQuest is No. 1 on the App Store after refusing to change Lake Ontario's name

https://www.cnn.com/2026/09/01/business/mapquest-number-one-app-refusal-lake-america
4•dnemmers•27m ago•0 comments

Welcome to the Old Internet Again

https://theoldnet.com/
4•jruohonen•30m ago•0 comments

GitHub Down Again?

1•yodon•32m ago•1 comments

Show HN: TinyJS – small apps on Win/Mac/Linux

https://tinyjs.app
2•tarwin•32m ago•1 comments

Dropbox Security Breach: Hackers Access Accounts Through Authentication Flaw

https://decrypt.co/377099/dropbox-security-breach
3•rkagerer•35m ago•2 comments

Private group wants to launch "cheapest possible" mission to Alpha Centauri

https://arstechnica.com/space/2026/09/private-group-wants-to-launch-cheapest-possible-mission-to-...
3•Gaishan•37m ago•0 comments

Ask HN: Where do you announce your projects?

1•lennart-rth•39m ago•2 comments

Steve Jobs, Closed Macs, and Me: A Guest Post (Del Yocum)

https://pogueman.substack.com/p/steve-jobs-closed-macs-and-me-a-guest
3•rmason•39m ago•0 comments

Nature Deficit Disorder

https://en.wikipedia.org/wiki/Nature_deficit_disorder
5•gurjeet•43m ago•0 comments