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: Turri – a coding agent with the power of regenerative software

https://github.com/turri-oss/turri
1•ponoru•2m ago•0 comments

Flying without know how the plane works

https://friendlyai.dev/blog/freeing-your-ai-from-your-computer/
1•FriendlyMike•3m ago•1 comments

Astronomers Find Hints of Star Population That Failed to Explode

https://www.caltech.edu/about/news/astronomers-find-hints-of-star-population-that-failed-to-explode
1•gmays•3m ago•0 comments

AMD EPYC 9006 Venice Unveiled: Inside the Zen 6 Architecture

https://hothardware.com/reviews/amd-epyc-9006-venice-zen-6-architecture-reveal
2•rbanffy•3m ago•0 comments

Show HN: I built the MTV my 13yo self wish existed

https://moodplaylist.com/
1•01jonny01•3m ago•0 comments

Advanced AI models could infer the activity of the brain

https://english.elpais.com/science-tech/2026-11-09/karl-deisseroth-nobel-prize-in-physiology-or-m...
1•geox•4m ago•0 comments

AI Security Issues Are Social Engineering Issues

https://www.oblomovka.com/wp/2026/11/11/ai-security-issues-are-social-engineering-issues/
1•dannyobrien•5m ago•0 comments

Spy versus Guy

https://thezvi.substack.com/p/ai-194-spy-versus-guy
2•7777777phil•8m ago•0 comments

C3 0.8.6:Library fetching,30% smaller safe-mode binaries,and stricter type rules

https://c3-lang.org/blog/c3_0_8_6_fetching_libraries/
1•DASD•8m ago•0 comments

How Do Building Codes Affect the Price of Housing?

https://www.construction-physics.com/p/how-do-building-codes-affect-the
1•rbanffy•9m ago•0 comments

Smarter AI Product Design Centers the User's Real Needs

https://spectrum.ieee.org/human-centered-ai-product-design
1•rbanffy•9m ago•0 comments

A teacher that made $20M a year making videos for babies

https://www.readfounded.com/p/baby-einstein
1•jcox06•10m ago•0 comments

Show HN: Npkill 1.0 – find and delete node_modules, .venv, target and more

https://github.com/voidcosmos/npkill
1•zaldih•10m ago•0 comments

Jensen Huang and Sex After AGI

https://medium.com/@joshbocanegra/jensen-huang-sex-after-agi-7990e96fb1c7
1•jbai•10m ago•0 comments

Danucore AI Infrastructure Engineers

https://www.danucore.com/join-us/ai-infrastructure-engineer
2•bryanmoyer•11m ago•0 comments

Nvidia's Disappearing Singapore Sales Deepen Mystery Around Megaspeed

https://www.wsj.com/business/earnings/nvidias-disappearing-singapore-sales-deepen-mystery-around-...
2•doener•11m ago•0 comments

Dailies

https://www.viewdailies.com
1•zarephcore•11m ago•1 comments

30 years of Internet transfers with curl

https://daniel.haxx.se/blog/2026/11/11/30-years-of-internet-transfers-with-curl/
2•lumpa•14m ago•0 comments

Show HN: AI Red Lines – write down what would make you act on AI

https://yourairedlines.com
3•ap11071•14m ago•1 comments

Running web sites makes me not want to

https://lowkey.party/running-web-sites-makes-me-not-want-to
2•speckx•15m ago•0 comments

Now it is our turn to study statistical mechanics

https://twitter.com/Math_files/status/2120540806490591679
2•delichon•18m ago•0 comments

Gen Z is Unbound [pdf]

https://www.electrictwin.com/gen-z-is-unbound.pdf
2•jjrbea9032e•19m ago•0 comments

PostgreSQL 18.7, 17.12, 16.16, 15.20, 14.25, and 19 RC 2 Released

https://www.postgresql.org/about/news/postgresql-187-1712-1616-1520-1425-and-19-rc-2-released-3442/
4•plaur782•20m ago•0 comments

New Study Rewrites the Rules of the Blood-Brain Barrier

https://www.sciencealert.com/study-rewrites-the-rules-of-the-blood-brain-barrier-including-protei...
2•gmays•21m ago•0 comments

Don't build your own harness: lessons from building Paywalls AI Editor

https://www.revenuecat.com/blog/engineering/lessons-paywalls-ai-editor
3•azvaliev•21m ago•1 comments

Tell HN: I'm working on practical implementations of tag-based file organization

2•prmph•22m ago•0 comments

Writing with AI – Tales and Tips

https://www.juriopitz.com/2026/11/12/ai-assissted-writing-tales-and-tips.html
2•juopitz•24m ago•0 comments

Kazakhstan-linked hackers used AI agent to spy on Central Asian governments

https://therecord.media/kazakhstan-hackers-central-asia
2•waximabbax•25m ago•0 comments

Abandoned Quake 4 expansion finished by modders and now playable

https://www.moddb.com/mods/openq4/downloads/openq4-0141-windows-x64
13•klaussilveira•26m ago•0 comments

Antibody-specific 65M model vs. general 650M model: a tie in the lab

https://www.cradle.bio/blog/fab-test
2•pranxxter•27m ago•0 comments