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.

Less sugar in the first 2 years of life is linked to a body that ages slower

https://www.nature.com/articles/s41467-026-79639-7
2•cuebiz•5m ago•0 comments

They cracked this 250-year-old code and found a secret society inside (2012)

https://www.wired.com/2012/11/ff-the-manuscript/
2•thamiltonsmith•7m ago•0 comments

Jetty Pro

http://hypercritical.co/2026/11/23/jetty-pro
1•8ig8•7m ago•0 comments

Web Design: The First 100 Years (2014)

https://www.sleuthsayers.org/2013/06/the-3500-shirt-history-lesson-in.html
2•Skyfall106•7m ago•0 comments

Spend Elon's Money – Neal.fun

https://neal.fun/spend-elon/
1•vismit2000•9m ago•0 comments

The New SDLC with Vibe Coding

https://www.kaggle.com/whitepaper-the-new-SDLC-with-vibe-coding
1•matthewsinclair•9m ago•1 comments

He Quit a $103K/Year Job to Sell Comic Books [video]

https://www.youtube.com/watch?v=i9t1p6Um450
1•mattm•15m ago•0 comments

Death Clock: The Internet's friendly reminder that life is slipping away

http://www.deathclock.com
1•vismit2000•15m ago•0 comments

Drone Maps of Salvage Yards

https://salvageyarddrone.wordpress.com/
3•uptrails•15m ago•0 comments

Ernie 5.5 Flash Preview

https://ernie.baidu.com/release/ernie-5-5-flash-preview/
1•ByteAtATime•17m ago•0 comments

A trick to eliminate 2π (sometimes) (2023)

https://marci.gunyho.com/theta
1•zenincognito•19m ago•0 comments

Glide Path: For those who miss playing Flight Control on idevices

https://semiseriousllc.com/glidepath/testflight/
1•gurupanguji•20m ago•1 comments

Port 9001

https://www.rfc-editor.org/info/rfc6335/
1•hamonrxe•22m ago•0 comments

An on-device AI agent for Android

https://github.com/wangzan101/mika
1•snasan•22m ago•0 comments

Capability-based end-to-end tests: method, implementation and measured results

https://medium.com/okossa/capability-based-end-to-end-tests-what-they-fix-and-what-they-cost-414f...
1•okwe•23m ago•0 comments

Built ForjaCero, a platform to help for system software engineering roles

https://www.forjacero.xyz
2•sangramnavale•27m ago•0 comments

Army invokes emergency powers to detonate lead in Iowa, bypass court order

https://www.yahoo.com/news/us/articles/iowa-detonation-lead-proceed-under-163603593.html
5•gmays•31m ago•1 comments

Waffo Pancake vs. Lemon Squeezy: Fees, Payouts and Migration

https://www.waffo.ai/compare/lemon-squeezy
1•Luki1234•39m ago•0 comments

One person unicorn is likely in the next decade

https://ajaychavda.com/blog/one-person-unicorn-is-likely-in-the-next-decade
10•zenincognito•49m ago•2 comments

PlumCalc – 33 client-side calculators with a public MCP server

https://plumcalc.com/
2•zooplays•51m ago•0 comments

Show HN: Synth Patch Hero

https://swarkentin.github.io/synth-patch-hero/
2•kaidon•51m ago•1 comments

Cross Streets: Streets that intersect to form compound words

https://crossings.azlen.me/
2•jxmorris12•52m ago•0 comments

Mcpseal: Grade an MCP server for safety before you install it

https://www.npmjs.com/package/@hashshabbir/mcp-pack
3•husham•56m ago•0 comments

Epistemic Opacity

https://twitter.com/theSamPadilla/status/2124562721173877093
2•gmays•58m ago•0 comments

Held together by spare time: Reviving wiki.alpinelinux.org during PHP2Shell

https://lambdacreate.com/posts/held-together-by-spare-time
2•renehsz•58m ago•0 comments

Show HN: Juncts, one DM inbox for five apps that Claude and ChatGPT can work in

https://juncts.com/app?demo=1&utm_source=hackernews&utm_medium=launch&utm_campaign=launch-nov26
5•jlaufr•59m ago•0 comments

Zero data retention with Enterprise Frontier Safeguards is now in beta

https://claude.com/resources/articles/zero-data-retention-with-enterprise-frontier-safeguards
3•lumpa•1h ago•0 comments

The enterprise guide to securing coding agents

https://claude.com/resources/articles/enterprise-guide-to-securing-coding-agents
3•lumpa•1h ago•2 comments

Trading System – tests trading rules against no-information baselines

https://ultimate-trading-system.com/
2•tbuitendyk•1h ago•0 comments

Show HN: FireVoice, free open-source voice studio on your own GPU

https://firevoice.fabwaseem.com
6•fabwaseem•1h ago•1 comments