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.

Rubio Uses Terrorism Law to Ban Secure Email Service

https://reason.com/2026/08/27/rubio-uses-terrorism-law-to-ban-secure-email-service/
1•KomoD•9m ago•1 comments

Judge blocks Pentagon blacklist of Anthropic as supply chain risk

https://www.cnbc.com/2026/08/28/judge-blocks-pentagon-blacklist--anthropic-.html
1•magoghm•9m ago•0 comments

West Point Professor Fired for Refusing to Lie About Climate Change

https://newrepublic.com/post/214853/west-point-professor-fired-refusing-lie-climate-change
1•petethomas•9m ago•0 comments

We will need more (not fewer) scientists

https://blog.valency.io/posts/we-need-more-scientists
1•joshbloom•11m ago•1 comments

Lake America? Spare Us

https://www.nationalreview.com/corner/lake-america-spare-us/
8•petethomas•17m ago•0 comments

Dev.fast: Cursor for Code Review

https://dev.fast/
1•handfuloflight•19m ago•0 comments

GenRec: An LLM-Backed Recommendation Ranker at Netflix

https://arxiv.org/abs/2608.10257
1•armcat•25m ago•0 comments

The World Needs a Plan

https://garymarcus.substack.com/p/excellent-new-bill-gates-essay-on
2•soltanov•25m ago•1 comments

Synchronisation and SMPTE timecode (time code)

https://www.philrees.co.uk/articles/timecode.htm
2•sublinear•27m ago•0 comments

Float Bloat: vector serialization gone wrong

https://bonsai.io/blog/float-bloat/
1•signa11•27m ago•0 comments

Debating Christopher Nolan's the Odyssey

https://medium.com/theentertainmentbreakdown/debating-christopher-nolans-the-odyssey-429a292e2cc7
1•raynchad•28m ago•0 comments

To Silicon Valley, anything could be a 'psyop'

https://www.cnn.com/2026/08/27/us/word-of-week-psyop-data-centers-cec
2•1659447091•31m ago•0 comments

Bandwidth vs. Latency: What Matters for Live Streaming?

https://www.red5.net/blog/bandwidth-vs-latency/
1•mondainx•34m ago•0 comments

Django-query-guard – Pytest plugin for Django N+1 query detection

1•hacker-pro•34m ago•0 comments

Making EUV: From Lab to Fab

https://www.asml.com/en/company/stories/2022/making-euv-lab-to-fab
2•o4c•39m ago•0 comments

Postgres 19: What's new in monitoring?

https://clickhouse.com/blog/postgres-19-monitoring-whats-new
1•saisrirampur•45m ago•0 comments

In response to Polish government, Meta admits the scale of scam ads

https://twitter.com/KGawkowski/status/2092567740116562116
3•franczesko•47m ago•0 comments

The HEIC to JPG Step That Changes Your Colors

https://heic-color-shift.web.app/
5•Hackergeist•51m ago•2 comments

Nepal Needs Your Help

https://www.bbc.com/news/live/cr0qxd1y219kt
1•pokhareel•53m ago•0 comments

In the product end game, every change carries significant risk

https://devblogs.microsoft.com/oldnewthing/20091104-01/?p=16143
3•anitil•53m ago•1 comments

About legal tech, because I can't sleep

https://patent.dev/about-legal-tech-because-i-cant-sleep/
2•funktionslust•54m ago•0 comments

Recording shows Alabama Power lobbyist discussing bill to appoint utility regula

https://www.wbrc.com/2026/02/16/recording-shows-alabama-power-lobbyist-discussing-bill-appoint-ut...
3•newsomix9xl•58m ago•1 comments

A Turning Point in AI Writing

https://www.theatlantic.com/technology/2026/08/wall-street-journal-ai-op-ed/688433/
1•petethomas•1h ago•0 comments

In a divided America, left and right unite to oppose AI data centers

https://apnews.com/article/data-centers-bipartisan-opposition-trump-democrats-a419be82fb6b32a8fc0...
2•1vuio0pswjnm7•1h ago•0 comments

MI: Measure Price Calculator – AI Pricing for Shopify

https://apps.shopify.com/mi-measure-price-calculator
2•motion-hero•1h ago•0 comments

Leibniz's Philosophy of Physics

https://plato.stanford.edu/archives/fall2024/entries/leibniz-physics/
4•andsoitis•1h ago•0 comments

Show HN: My fast TUI Finnish-English dictionary is now in the browser via WASM

https://taskusanakirja.com/
1•hiAndrewQuinn•1h ago•0 comments

£50k needed to purchase church with Maxwell's grave

https://www.bbc.com/news/articles/cjw5d121x9lo
5•dboreham•1h ago•2 comments

Entropy – Mental Model

https://read.perspectiveship.com/p/entropy
1•fagnerbrack•1h ago•0 comments

WAFT: Warping-Alone Field Transforms for Optical Flow (2025)

https://arxiv.org/abs/2506.21526
1•peter_d_sherman•1h ago•1 comments