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•10mo ago

Comments

zoezoezoezoe•10mo 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•10mo 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.

Ask HN: When was the last time your wrote a function in your code?

1•cat-turner•2m ago•0 comments

Enthusiast breaks into smallest HDD with only phone and OpenClaw

https://www.tomshardware.com/pc-components/external-hdds/enthusiast-reverse-engineers-worlds-smal...
1•djinn•2m ago•1 comments

Cesar Chavez, a Civil Rights Icon, Is Accused of Abusing Girls for Years

https://www.nytimes.com/2026/03/18/us/cesar-chavez-sexual-abuse-allegations-ufw.html
1•tlogan•4m ago•0 comments

People Are Messy

https://wire.wise-relations.com/news/2026-03-19-people-are-messy/
1•chelm•7m ago•0 comments

CrackArmor: Critical AppArmor Flaws Enable Local Privilege Escalation to Root

https://blog.qualys.com/vulnerabilities-threat-research/2026/03/12/crackarmor-critical-apparmor-f...
2•doener•8m ago•0 comments

Minoxidil toxicosis in cats and dogs: A scoping review and call to action

https://www.sciencedirect.com/science/article/pii/S019096222500595X
1•felineflock•10m ago•0 comments

Character.ai Hosts Jeffrey Epstein Island Roleplay RPG Scenarios

https://www.gadgetreview.com/character-ai-hosts-jeffrey-epstein-island-roleplay-rpg-scenarios
1•gnabgib•11m ago•0 comments

Linking Smaller Haskell Binaries

https://brandon.si/code/linking-smaller-haskell-binaries/
1•PaulHoule•11m ago•0 comments

He Earns $1k a Job–and He's a Car Dealer's Worst Nightmare

https://www.wsj.com/business/autos/tomi-mikula-youtube-car-buying-negotiations-4a4c3d63
2•randycupertino•13m ago•1 comments

How many branches can your CPU predict?

https://lemire.me/blog/2026/03/18/how-many-branches-can-your-cpu-predict/
2•chmaynard•13m ago•0 comments

Fisher Traction – at-home spinal decompression devices for neck and back pain

https://www.fishertraction.com/
1•denseroll•14m ago•0 comments

Powell: Job creation is near zero

https://finance.yahoo.com/news/powell-job-creation-is-near-zero-202637723.html
2•AlexDragusin•15m ago•0 comments

Why I secretly rewrote my company's core infrastructure in my spare time

https://solc.uk/#p20260302
1•letaps_keys•15m ago•0 comments

Chainguard Is Now Protecting You from AI Agent Skills Gone Rogue

https://techstrong.ai/features/chainguard-is-now-protecting-you-from-ai-agent-skills-gone-rogue/
1•CrankyBear•16m ago•0 comments

Calcosmos

https://www.calcosmos.com/
1•anushkaams•16m ago•0 comments

Never let a good domain go to waste

https://www.whitehouse.gov/lab-leak-true-origins-of-covid-19/
1•blackdogie•17m ago•1 comments

Fighting Context Drift

https://github.com/dsadsadsadsadas/Trepan
1•slx44i•18m ago•0 comments

Aristotle Reasoning Agent

https://aristotle.harmonic.fun/
1•bananaflag•20m ago•1 comments

Microsoft weighs legal action over $50B Amazon-OpenAI cloud deal

https://www.ft.com/content/e814f4c3-4fb5-4e2e-90a6-470044436b39
2•markjgx•23m ago•0 comments

PondDB – Self-hosted agent memory database built on DuckDB

https://github.com/pond-db/pond-db
2•houtianlu•24m ago•0 comments

ORYN – local-first autonomous cybersecurity console, built in 7 days

https://github.com/alihassanassi/ORYN
1•alihassanassi•27m ago•0 comments

Ways to protect your money from potentially higher inflation and unemployment

https://www.cnn.com/2026/03/18/business/consumer-interest-rates-inflation-unemployment-your-money
1•mooreds•29m ago•0 comments

Ask HN: Why is everyone on HN obsessed with Rust?

4•goldkey•29m ago•3 comments

2026, the Year of the Horse

https://www.carlyhasredhair.com/p/2026-the-year-of-the-horse
1•mooreds•30m ago•0 comments

Show HN: WheresMyPermitSF – Self-Hosted SF Housing Permit Bottleneck Analyzer

https://wheresmypermitsf.candace.cloud/
1•kaashmonee•31m ago•0 comments

Why AI Tools Fail – and Where the Real Lever Is

https://dekodiert.de/en/articles/maschinenlesbarer-kontext
1•sdoering•32m ago•0 comments

CISA Urges Hardening After Cyberattack Against Stryker

https://www.cisa.gov/news-events/alerts/2026/03/18/cisa-urges-endpoint-management-system-hardenin...
2•dboreham•33m ago•0 comments

French bulldog frenzy may be cooling in US, but dachshunds are riding high

https://apnews.com/article/popular-dog-breeds-dachshund-french-bulldog-d94ee9db8d56bcb29ccf39e855...
2•mooreds•33m ago•1 comments

Our new Windsurf pricing plans

https://windsurf.com/blog/windsurf-pricing-plans
1•qainsights•36m ago•0 comments

Fruity Loops

https://en.wikipedia.org/wiki/FL_Studio
1•bigwheels•37m ago•0 comments