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.

Waymo Calls Police on Teenage Riders Who Were Drinking

https://www.roadandtrack.com/news/a71866405/waymo-robotaxi-calls-police-on-teenage-passengers-dri...
1•kerim-ca•2m ago•0 comments

Top Legal Adviser to Joint Chiefs Is Stepping Down a Year Before Completing Term

https://www.propublica.org/article/eric-widmar-retiring-joint-chiefs-legal-adviser
1•Jimmc414•4m ago•0 comments

Practical Lessons from Reinforcement Learning Post Training Experiments [pdf]

https://zenodo.org/records/21115798
1•luvverma2011•4m ago•0 comments

China Cuts 12,200 University Programs, Replaces Many with AI Degrees

https://www.forbes.com/sites/annaesakismith/2026/06/23/china-cuts-12200-university-programs-repla...
2•happy-go-lucky•10m ago•0 comments

Non-tech background, choosing between using CLaudeCode and CodeX

1•virtuallymundo•12m ago•0 comments

Texans deserve more then a Ken Paxton snake game

https://paxtonsnake.3d2k.com/
1•KilledByAPixel•13m ago•1 comments

Show HN: Figment – An AI that I made my friends talk to for 2 weeks

https://figment.computer/
1•subby•15m ago•0 comments

Burner Email, Temp email Box lasting 24 hours

https://burneremail24.com/
1•texasjosh•15m ago•0 comments

Llama 2 LLM on DOS (2025)

https://yeokhengmeng.com/2025/04/llama2-llm-on-dos/
1•userbinator•15m ago•0 comments

Rutazo – Argentina's freight marketplace, built solo in 4 months

https://www.rutazo.com
1•cookinat•15m ago•0 comments

Citicorp Center Engineering Crisis

https://en.wikipedia.org/wiki/Citicorp_Center_engineering_crisis
2•thunderbong•17m ago•1 comments

What's slowing down the AI buildout

https://www.worksinprogress.news/p/ai-is-bottlenecked-by-the-grid
1•droidjj•21m ago•0 comments

Researchers uncover possible cause of muscle pain from cholesterol medication

https://medicalxpress.com/news/2026-07-uncover-muscle-pain-widely-cholesterol.html
2•brandonb•23m ago•0 comments

Show HN: Free and OSS way to extend client-facing functionality of Linear

https://linear.gratis/
1•gvlachos•26m ago•0 comments

AI could keep poor countries poor

https://newsletter.deenamousa.com/p/ai-could-keep-poor-countries-poor
2•zaik•27m ago•0 comments

Morph Chess

https://www.david-duval.com/morph-chess/
1•dvduval•28m ago•1 comments

Looksmaxxing influencer who fled police found dead

https://thetab.com/2026/07/08/looksmaxxing-influencer-who-fled-police-found-dead-after-swimming-n...
2•andsoitis•29m ago•0 comments

Character AI Alternative for Roleplay

https://chatbrat.ai/bratlog/best-character-ai-alternatives-2026
1•henrypissler•30m ago•0 comments

The library of lost journals 603 pages novel fiction book

https://play.google.com/store/books/details/The_Library_of_Lost_Journals_The_Archivist_s_Journ?id...
1•mjbachhav•33m ago•0 comments

DDB: Source-Level Interactive Debugging for Distributed Applications

https://arxiv.org/abs/2607.06107
1•Jimmc414•34m ago•0 comments

Ask HN: How to recover from thin content or de-indexing penalty on Google

2•anitroves•34m ago•2 comments

Meta Patents AI Device That Tracks Your Emotions, Watches You Take Your Meds

https://www.404media.co/meta-patents-ai-device-that-tracks-your-emotions-watches-you-take-your-meds/
4•Jimmc414•34m ago•0 comments

Counterfeit Air-Bags Are Killing U.S. Drivers–and the Government Can't Stop It

https://www.wsj.com/business/autos/counterfeit-air-bag-parts-deaths-regulators-6eddfdd4
1•fortran77•35m ago•1 comments

Ergo: Long Form Philosophy Lectures

https://ergo.org/
1•agnishom•38m ago•0 comments

Neuromancer (TV Series) – IMDB

https://www.imdb.com/title/tt31512174/
1•evo_9•43m ago•0 comments

Two teens learn the hard way not to do toy gun drive-bys from a Waymo

https://arstechnica.com/cars/2026/07/two-teens-learn-the-hard-way-not-to-do-toy-gun-drivebys-from...
1•gbourne1•51m ago•2 comments

FIFA president targeted by complaint to Olympic ethics body

https://www.pbs.org/newshour/world/fifas-infantino-targeted-by-complaint-to-olympic-ethics-body-a...
1•Jimmc414•53m ago•0 comments

Automattic Code for the People Is Rallying Cry for Open Internet

https://variety.com/2026/digital/news/automattic-code-for-the-people-1236802508/
1•pentagrama•54m ago•0 comments

A self-driving Waymo just reports its own passengers to police

https://www.fastcompany.com/91570761/a-self-driving-waymo-just-reported-its-own-passengers-to-police
1•PaulHoule•55m ago•1 comments

Grudge: Stochastic data structure for holding multi-tenant grudges

https://github.com/satmihir/grudge
1•jscrab•56m ago•0 comments