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.

New EU rules: military age Ukrainian men to lose refugee visas Jun 27 2027

https://www.reuters.com/world/eu-proposes-extending-ukrainian-protection-2028-limit-men-fighting-...
1•spwa4•1m ago•1 comments

The Naibbe cipher: a cipher that produces Voynich Manuscript-like ciphertext

https://www.tandfonline.com/doi/full/10.1080/01611194.2025.2566408#d1e6668
1•wise_blood•8m ago•0 comments

I created a new open-source project

1•danielsyauqi•9m ago•0 comments

AI 2027 Tracker

https://ai2027-tracker.com/
1•merksittich•18m ago•0 comments

Alan Greenspan Has Died

https://businessdesk.co.nz/article/economy/remembering-alan-greenspan
2•vismit2000•23m ago•0 comments

How much? The hidden costs of restaurant dishes

https://www.theguardian.com/food/2026/jun/26/how-much-the-hidden-costs-of-restaurant-dishes
2•helsinkiandrew•24m ago•0 comments

Midwit Cleanse – midwits wipe themselves off the gene pool

https://demiculus.com/midwit-cleanse/
1•demiculus•25m ago•0 comments

Translating Pandas to Polars using LLMs

https://pola.rs/posts/llm-polars-patterns/
3•jeroenjanssens•28m ago•0 comments

Paris to ban drinking alcohol in public as hospitals hit heatwave breaking point

https://www.theguardian.com/world/2026/jun/26/paris-heatwave-drinking-ban-drinking-alcohol-public
2•teleforce•28m ago•1 comments

Paying for LLM inference by the kilowatt-hour instead of per token

https://www.coinerella.com/energy-based-llm-billing-cut-my-bill-to-a-sixth/
1•willy__•29m ago•0 comments

How your team can save 100's of hours of work

https://www.dcaulfield.com/save-your-team-100s-of-hours
1•cauliflower99•38m ago•0 comments

Google Vids: AI-Powered Video Creator and Editor

https://workspace.google.com/products/vids/
1•tilt•39m ago•0 comments

GuixPkgs: Every Guix package, as a Nix flake

https://fzakaria.com/2026/06/25/guixpkgs-every-guix-package-as-a-nix-flake
1•ingve•40m ago•0 comments

Micron blames Apple and customers for the lack of memory capacity

https://www.wsj.com/tech/apple-raises-prices-on-macs-ipads-by-200-or-more-on-some-models-a7463f99
1•alecco•41m ago•1 comments

Patent-CR: A Dataset for Patent Claim Revision

https://aclanthology.org/2025.naacl-long.116/
1•teleforce•46m ago•0 comments

Building effective pen-testing agents

https://cecuro.ai/blog/building-effective-pen-testing-agents
2•GustavHartz•50m ago•1 comments

The Age of the Solopreneur

https://www.stripeeconomics.com/p/the-age-of-the-solopreneur
2•jv_dh•51m ago•0 comments

CasaOS: An open-source home server OS for Docker apps

https://github.com/IceWhaleTech/CasaOS
2•chandler93•52m ago•0 comments

The Human Agentic Gap

https://zenodo.org/records/20920098
1•tas101•53m ago•0 comments

Show HN: Helios – Business OS for Freelancers

https://www.helios.today/
1•Koran37•1h ago•0 comments

What if plants could talk? (OpenAI YouTube) [video]

https://www.youtube.com/watch?v=q_diWy3xdrw
1•frabcus•1h ago•0 comments

Snap's Evan Spiegel, Miranda Kerr help erase $550M in med debt for Californians

https://www.latimes.com/business/story/2026-06-25/snaps-evan-spiegel-miranda-kerr-help-erase-550-...
2•thunderbong•1h ago•0 comments

Show HN: A Transformer Is All You Need

https://zenodo.org/records/20906443
1•KnoxProtocol•1h ago•0 comments

Chinese cybersecurity company claims it's built a better-than-Mythos bug finder

https://www.theregister.com/security/2026/06/26/chinese-cybersecurity-company-claims-its-built-a-...
2•lukewarm707•1h ago•0 comments

Why software GPS spoofing can't beat Pokémon Go's anti-cheat on iOS 17

https://zenodo.org/records/20917374
2•KKSwift•1h ago•0 comments

Reward hacking is swamping model intelligence gains

https://cursor.com/blog/reward-hacking-coding-benchmarks
1•DR_MING•1h ago•0 comments

Evaluating performance and efficiency of the GitHub Copilot agentic harness

https://github.blog/ai-and-ml/github-copilot/evaluating-performance-and-efficiency-of-the-github-...
1•mariuz•1h ago•0 comments

See who stars a GitHub repo, on a map

https://starmapper.bruniaux.com
1•t3r•1h ago•1 comments

Pandas-ta-classic 0.6.52: SMC liquidity sweep detector, Ichimoku fixes

https://github.com/xgboosted/pandas-ta-classic
1•xgboosted•1h ago•0 comments

Global cyber strike disrupts SocGholish, Amadey, and StealC malware networks

https://www.europol.europa.eu/media-press/newsroom/news/global-cyber-strike-disrupts-socgholish-a...
1•jruohonen•1h ago•0 comments