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: Sugabots – Group chats where your team and AI agents work together

https://sugabots.ai/
1•homelessdino•4m ago•0 comments

California Billionaire Tax Fight: Newsom Backs Prop. 42

https://discord.com/channels/1519570089488289956/1522069205795606650/1559414533104074774
1•joeymabia1•4m ago•1 comments

Ask HN: How long before someone reverse-engineers Windows?

1•cromka•4m ago•0 comments

The reverts will continue until morale improves

http://peter.eisentraut.org/blog/2026/10/09/the-reverts-will-continue-until-morale-improves
1•debo_•8m ago•0 comments

Show HN: Enki LLM A pure rust (even kernels) with live GPU/CPU brain migration

https://github.com/enkiruntime/enki_llm
2•enki_runtime•8m ago•0 comments

Muse Wonder(Non-Full) Max Is Below Muse Spark 1.3 Max on Code Arena: WebDev

https://twitter.com/arena/status/2110120205464846828
1•hugh4life•11m ago•1 comments

SF Housing Simulator

https://sfhousing.mindlace.net/
2•forthwall•13m ago•0 comments

The First Social Network: In rural Argentina residents send messages w AM radio

https://www.newyorker.com/magazine/2026/10/19/the-first-social-network
1•bookofjoe•14m ago•1 comments

HCP Vagrant Deprecation

https://www.hashicorp.com/en/blog/hcp-vagrant-deprecation-important-dates-and-migration-guidance
2•mikelr•15m ago•0 comments

Nix and Lix local root-privilege-escalation vulnerabilities

https://lwn.net/Articles/1100247/
1•debo_•20m ago•0 comments

Investing in Short AI Timelines

https://cambrianmanagement.ai/
1•lukaspetersson•20m ago•0 comments

Climate change driving child marriages and teen pregnancies

https://www.rfi.fr/en/environment/20261005-climate-change-driving-child-marriages-teen-pregnancie...
1•bilsbie•21m ago•0 comments

The lowest level of programming isn't assembly or machine code, it's microcode

https://www.reddit.com/user/SufianDira/comments/1wujz80/the_lowest_level_of_programming_isnt_asse...
1•SufianDira•24m ago•0 comments

OpenAI engineer accused of planting listening device inside company's office

https://www.cbc.ca/news/world/open-ai-listening-device-fbi-9.7379357
2•uladzislau•24m ago•1 comments

Investigating unintended model actions in our evaluations and internal use

https://www.anthropic.com/research/investigating-unintended-model-actions
1•gmays•28m ago•0 comments

The Planner's Pledge

https://plannerspledge.org/
1•thomasjb•30m ago•0 comments

Musk now working on the "Distributed Inference Cloud"

https://twitter.com/SawyerMerritt/status/2110118022988058637
3•bigwheels•31m ago•1 comments

TV's Kill Voice Agents

https://twitter.com/_josh_meyer_/status/2110043334182043658
1•jrm-veris•31m ago•0 comments

AlphaNIST

https://alpha-nist.github.io/
1•jasonjmcghee•34m ago•0 comments

Physical Intelligence API Beta: Frontier Models for Every Robot

https://www.pi.website/blog/api-beta
1•modeless•36m ago•0 comments

Show HN: Florida HOAs are stealing homes

https://hoaspy.com/hoa/fl/south-florida-hoa-statistics.html
3•lovewins•37m ago•0 comments

Nexus-Q: un motor open source de Rust para PQC

https://nexus-q.link/
2•ManuelAxiom•37m ago•0 comments

Digital Money, Cash, Silver, and Gold as of 2015

https://www.grandpappy.org/edigital.htm
2•Eaglo•37m ago•1 comments

Cornell Bans Fraternity Parties

https://www.nytimes.com/2026/10/13/nyregion/cornell-sexual-assault-fraternity-party-ban.html
2•paaloeye•39m ago•1 comments

Show HN: UpDown – free multiplayer Markdown documents

https://updown.laravel.cloud/059a14a0-9113-4fad-a9db-e8ef2d2e830c
1•simonhamp•42m ago•1 comments

Open source Scion – Anthropic's Git alternative in open source

https://github.com/tinyhumansai/openscion
3•gafoor•45m ago•0 comments

Chained Exploitation of Ivanti Connect Secure Zero-Days

https://www.volexity.com/blog/2026/10/13/a-series-of-unauthenticated-events-chained-exploitation-...
1•wondersky•48m ago•0 comments

New 'Super Ice' 10 Times Stronger, Bringing It Close to the Strength of Concrete

https://www.sciencealert.com/a-new-super-ice-is-10-times-stronger-bringing-it-close-to-the-streng...
4•andrewl•49m ago•1 comments

To Save on Rent, Some Dutch College Students Are Living in Nursing Homes

https://www.theatlantic.com/business/archive/2015/10/dutch-nursing-home-college-students/408976/
3•jameslk•50m ago•1 comments

Player Piano (Kurt Vonnegut)

https://en.wikipedia.org/wiki/Player_Piano_(novel)
1•_doctor_love•50m ago•1 comments