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.

Show HN: Curate. free, no ADS, with AI, private photo cleaner for iPhone

https://apps.apple.com/us/app/curate-photo/id6825514911
1•rafaelreinert•1m ago•0 comments

Elon Musk's AI Odyssey Review

https://www.theguardian.com/film/2026/oct/27/elon-musk-ai-odyssey-movie-grok-christopher-nolan
2•aestetix•2m ago•0 comments

Anthropic acquires a one-person biotech that used Claude to coordinate 11 labs

https://www.rdworldonline.com/anthropic-acquires-mithril-medicine-one-person-biotech/
1•binyu•2m ago•0 comments

Python jettisons the native JIT, at least for now

https://lwn.net/SubscriberLink/1102102/489e41d80e4966aa/
1•birdculture•3m ago•0 comments

Meaningless as a laptop screensaver: reviewers slate Musk's AI-made Odyssey film

https://www.theguardian.com/technology/2026/oct/27/reviewers-slate-musk-ai-grok-odyssey-film-nolan
2•beardyw•4m ago•1 comments

Wealth Inequality in America drawn to scale

https://dreamagainusa.org/
1•haraball•5m ago•0 comments

Luanti (formerly Minetest) reveal a major ContentDB security incident

https://blog.luanti.org/2026/10/27/contentdb-security-incident/
1•basedpolymer•8m ago•0 comments

Creators Who Show Their Sources Build Trust, Survey Finds

https://www.proofnews.org/creators-who-show-their-sources-build-trust-survey-finds/
1•giuliomagnifico•9m ago•0 comments

China's super-secret space plane visible in clearest photo yet

https://www.popsci.com/technology/china-space-plane-clear-photo/
4•billybuckwheat•12m ago•0 comments

Have you considered building less?

https://reform.trythursday.org/
1•_shantaram•13m ago•0 comments

Amazon Museum

https://museudaamazonia.org.br/
1•gtsnexp•14m ago•0 comments

Technology Limits Are Temporary

https://www.lukew.com/ff/2169/technology-limits-are-temporary
1•plurby•16m ago•0 comments

Turn Cytron MOTION 2350 Pro as air quality scanner using circuitpython

https://www.bleuio.com/blog/scanning-hibouair-sensors-with-circuitpython-bleuio-and-the-cytron-mo...
1•sheikhshuhad•17m ago•0 comments

A collection of website seizure banners created by government agencies

https://seized.fyi
2•heavensteeth•19m ago•0 comments

A Musician's Advice About the College Market (2008)

https://sive.rs/college
1•Michelangelo11•19m ago•0 comments

Show HN: Find SEO and Security issues across clients websites

https://gotrama.com
1•emmanuelyaks•20m ago•0 comments

Obvious to You. Amazing to Others (2010)

https://sive.rs/obvious
1•Michelangelo11•22m ago•0 comments

The Benchmarking Crisis

http://databasearchitects.blogspot.com/2026/10/the-benchmarking-crisis.html
1•timschumi•23m ago•0 comments

A project that visualizes the night sky using ASCII characters

https://github.com/da-luce/astroterm
2•nvmdbljstm•24m ago•1 comments

Cohere says Alibaba's Qwen model tried to send a file to Beijing

https://techcrunch.com/2026/10/26/cohere-says-alibabas-qwen-model-tried-to-send-a-file-to-beijing/
1•gsky•24m ago•0 comments

Cloudflare PHP Capture the Flag Challenge

https://blog.cloudflare.com/php-ctf/
1•usrme•26m ago•0 comments

Moonfold: Coding tasks that survive agent usage limits

https://github.com/Mr-Dark-debug/Moonfold
1•prashantc001•28m ago•0 comments

Agentic Coding Tools for Java Web Apps (Free)

https://www.youtube.com/watch?v=-4p5BiGd9QU
1•spicyroman•30m ago•0 comments

Requesty: AI Gateway and LLM Router for 600 Models in EU Datacenters

https://www.requesty.ai
1•janandonly•33m ago•0 comments

Recycler: Cost-Free Latent Reasoning via Hidden State Recycling

https://seed.bytedance.com/en/public_papers/recycler-cost-free-latent-reasoning-via-hidden-state-...
1•sgiannopoulos•33m ago•0 comments

"No human at the helm": Delaware plan would let AI agents run businesses

https://arstechnica.com/tech-policy/2026/10/no-human-at-the-helm-delaware-plan-would-let-ai-agent...
3•ndsipa_pomu•33m ago•1 comments

The whole site in five languages in 12 minutes, from the command line

https://swiftling.pro/whole-site-in-five-languages/
1•taubek•34m ago•0 comments

Show HN: FreeApply Apply to the new Job on the old Model

https://www.mybotsai.com/
1•StephenTynan789•35m ago•1 comments

Show HN: KI Song erstellen – German AI music from prompts and lyrics

https://kisongerstellen.com
1•Kevin_Guo•35m ago•0 comments

Random Number

https://www.getrandomnumber.org
1•blackethylene•38m ago•0 comments