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.

AI-driven development – It's a spectrum

https://avohq.io/blog/ai-driven-development-it-s-a-spectrum
1•adrianthedev•1m ago•0 comments

List of price of medieval items (2006)

https://medieval.ucdavis.edu/120D/Money.html
1•downbad_•3m ago•0 comments

Ask HN: How to enforce engineers to understand the code they are shipping

1•hchua•4m ago•0 comments

Why Education Startups Do Not Succeed (2011)

https://avichal.com/2011/10/07/why-education-startups-do-not-succeed/
1•downbad_•4m ago•0 comments

Show HN: Cervantes yet Another HN Reader

https://github.com/nhdez/cervantes
2•pelagicAustral•6m ago•0 comments

The highest ROI activity in AI isn't on your screen

https://layerx.xyz/blog/sim-recap
1•supermalvo•11m ago•0 comments

Hold-to-talk voice input for Pi Coding Agent

https://github.com/codexstar69/pi-listen
1•ankitg12•11m ago•0 comments

Department of Energy ends ALARA

https://nationalinterest.org/blog/energy-world/the-department-of-energy-ends-alara
1•leonidasrup•12m ago•0 comments

The Economist prepares for a two‑track Web: one for humans one for AI agents

https://digiday.com/media/the-economist-prepares-for-a-two-track-internet-one-for-humans-and-one-...
2•thm•19m ago•1 comments

Misconceptions about the Unix Philosophy

https://posixcafe.org/blogs/2024/01/05/0/
1•signa11•19m ago•0 comments

Badger Badger Badger Video Officially Preserved by British Film Institute

https://petapixel.com/2026/05/18/badger-badger-badger-video-officially-preserved-by-british-film-...
2•petecooper•21m ago•0 comments

How Remote Work Has Grown – and Shrunk – Since Covid

https://arilamstein.com/blog/2026/05/18/how-remote-work-has-grown-and-shrunk-since-covid/
2•lumpa•21m ago•0 comments

How to Build Multi-Asset Backtests for Real Trading Strategies

https://medium.com/@DolphinDB_Inc/how-to-build-multi-asset-backtests-for-real-trading-strategies-...
2•CrazyTomato•23m ago•1 comments

Access the properties within Markdown files

https://github.com/thiswillbeyourgithub/LogseqMarkdownParser
1•ankitg12•23m ago•0 comments

Solal

https://news.ycombinator.com/submit
1•speedcleme•25m ago•1 comments

Crypto Jesus tried to sell me an AI religion

https://oneonlyvan.substack.com/p/that-time-crypto-jesus-tried-to-sell
1•5tnvan•25m ago•1 comments

America's Data Center Count Is About to Nearly Double

https://www.apollo.com/wealth/the-daily-spark/americas-data-center-count-is-already-near-double
1•akyuu•25m ago•0 comments

US Government Finances Are Not Ready for a Recession

https://www.apollo.com/wealth/the-daily-spark/us-government-finances-are-not-ready-for-a-recession
1•akyuu•26m ago•0 comments

Stop paying $360/year to access your own email history

https://mailvaulty.com
1•khaledsabae•26m ago•0 comments

Amazon's Singapore retreat: Why its US playbook failed in Southeast Asia

https://www.channelnewsasia.com/business/amazon-singapore-end-local-fulfilment-ecommerce-6121221
2•xbmcuser•27m ago•1 comments

eXo MCP server: expose workplace tools to AI agents with OAuth

https://www.exoplatform.com/blog/introducing-exo-mcp-server-secure-ai-integrations-digital-workpl...
2•jaouanebrahim•32m ago•0 comments

Show HN: AI Coding Engineers that evolve with you

https://hatchery.shelter41.com/
1•DSpider•33m ago•0 comments

Text for proofing fonts: a farewell to the quick brown fox

https://www.typography.com/blog/text-for-proofing-fonts
1•fanf2•33m ago•0 comments

Show HN: macOS system 7 web desktop

https://win9-5.com/macos/
1•keepamovin•33m ago•0 comments

Thinking of harness on mobile? I ported OpenAI Agents SDK to React Native

https://github.com/react-native-info/react-native-agent
2•netspdr•37m ago•1 comments

Anthropic shuts the EU out of its most advanced cyber AI model

https://www.theparliamentmagazine.eu/news/article/anthropic-shuts-the-eu-out-of-its-most-advanced...
2•mellosouls•38m ago•0 comments

The True Cost of Influencing

https://www.thebristolsauce.com/p/the-true-cost-of-influencing-one
1•edent•39m ago•0 comments

Minimum Viable Product Marketing

https://posthog.com/blog/minimum-viable-product-marketing
1•radnessforhire•43m ago•0 comments

Chrome Web Store Rankings – Patterns Across 120K Data Points

https://extensionranker.com/blog/chrome-web-store-ranking-patterns
1•Joseph_Hu•46m ago•1 comments

Zeigarnik Effect

https://en.wikipedia.org/wiki/Zeigarnik_effect
1•XzetaU8•48m ago•0 comments