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.

How Did America Get Its Name? (2016)

https://blogs.loc.gov/loc/2016/07/how-did-america-get-its-name/
1•thunderbong•2m ago•0 comments

Show HN: Random OS I made using C

https://github.com/NoTheIdiot/WindogeOS
1•notheidiot•10m ago•0 comments

Show HN: I built a Python obfuscator that keeps production traces debuggable

https://github.com/zhurong2020/pyobfus
1•znhskzj•11m ago•0 comments

Upgraded melly, our agent on sleek

1•silisleek•11m ago•0 comments

Google is actively hiring someone to save the world from AGI/ASI

https://www.google.com/about/careers/applications/jobs/results/95635593379095238
2•arm32•15m ago•0 comments

The Math Superstar Who's Terrified of AI–and Just Took a Job at OpenAI

https://www.wsj.com/tech/ai/openai-jacob-tsimerman-fields-medal-ai-safety-391d0f79
1•berkeleyjunk•16m ago•0 comments

Protecting the Nation's Communications Systems from Cybersecurity Threats

https://www.federalregister.gov/documents/2026/07/31/2026-15601/modernization-of-the-nations-aler...
1•Jimmc414•17m ago•0 comments

De mora luminis: Roemer's discovery 350 years later

https://arxiv.org/abs/2607.28512
1•Jimmc414•17m ago•0 comments

What's in a Name: A Guide to the Many Flavours of TeX

https://www.overleaf.com/learn/latex/Articles/What%27s_in_a_Name%3A_A_Guide_to_the_Many_Flavours_...
1•smitty1e•18m ago•0 comments

Accepting a Messy Git History

https://beza1e1.tuxen.de/git_two_users.html
1•matheusmoreira•18m ago•0 comments

SF-schema-snapshot – dump a Salesforce org's schema to SQLite

https://github.com/MogwaiNerfHerder/sf-schema-snapshot
1•DavidRussellCG•20m ago•0 comments

Show HN: Sanitizer – Strip sensitive data from documents locally before an LLM

https://provexar.ai/sanitizer
1•MVKozyrev•29m ago•0 comments

What's Happening with IT Hiring?

1•hannibalevit•30m ago•0 comments

Cdbx – an AI coding IDE where you can bring your own API key and own the code

https://cdbx.ai/
1•chbutler•34m ago•0 comments

Show HN: WhisperKeys - Offline macOS dictation, key-by-key

https://github.com/j-sofia/WhisperKeys
1•j-sofia•36m ago•1 comments

A Week in Matrix

https://piegames.de/dumps/a-week-in-matrix/
1•Kesseki•36m ago•0 comments

Tell HN: System76 has critical firmware issues unresolved for over 3 years

2•jaime-ez•40m ago•0 comments

Urldn – A URL shortener with analytics and an AI data analyst

https://waitlist.urldn.com/
2•assmira•40m ago•0 comments

Overactive Neurons Cause Excessive Sweating

https://www.the-scientist.com/overactive-neurons-cause-excessive-sweating-74787
2•gmays•40m ago•0 comments

Yann LeCun on What Comes After LLMs [video]

https://www.youtube.com/watch?v=ngBraLDqzdI
2•caminante•49m ago•0 comments

Speculative Decoding, Visualized

https://www.adaptive-ml.com/post/speculative-decoding-visualized
1•krackers•56m ago•0 comments

Optimal Elevator Placement

https://jslandy.com/elevators/
1•efavdb•59m ago•0 comments

The "memory shortage" that no one saw coming

https://greyenlightenment.com/2026/07/28/the-memory-shortage-no-one-saw-coming/
1•paulpauper•1h ago•0 comments

OPM finalizes rules expanding its power over RIFs, employee appeals

https://www.govexec.com/workforce/2026/07/opm-finalizes-rules-expanding-its-power-over-rifs-emplo...
1•WaitWaitWha•1h ago•0 comments

Rare footage of humpback whale birth captured on drone video

https://www.cbsnews.com/news/humpback-whale-birth-drone-video/
2•WaitWaitWha•1h ago•0 comments

Send a file from this browser as a stream of QR codes

https://app.transfqr.com
1•mohyware•1h ago•0 comments

His Wedding Guests Were Arriving–Just as His $45B Fund Was Falling Apart

https://www.wsj.com/finance/leopold-aschenbrenner-situational-awareness-ai-fund-597633d3
2•oliver236•1h ago•0 comments

Salmon Hat

https://en.wikipedia.org/wiki/Salmon_hat
5•1659447091•1h ago•0 comments

AI Visibility Evidence Model: Five Factors, Graded by Evidence

https://www.richresults.ai/evidence.html
2•spetschinka•1h ago•0 comments

The year Claude users sued over limits is the year the limits mostly went up

https://okaneland.com/study/claude-code-limits/
2•ermantrout•1h ago•0 comments