frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Avoid Continue

https://www.teamten.com/lawrence/programming/avoid-continue.html
2•todsacerdoti•6mo ago

Comments

zoezoezoezoe•6mo 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•6mo 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.

GeoPulse: Self-hosted location tracking with timeline, analytics, friend sharing

https://old.reddit.com/r/selfhosted/comments/1od2r8i/geopulse_selfhosted_location_tracking_with/
1•ValentineC•51s ago•0 comments

Kevin Kelly: The Web Runs on Love, Not Greed (2002)

http://scripting.com/stories/2002/01/09/kevinKellyTheWebRunsOnLoveNotGreed.html
1•freediver•55s ago•0 comments

LLMs show a "highly unreliable" capacity to describe own internal processes

https://arstechnica.com/ai/2025/11/llms-show-a-highly-unreliable-capacity-to-describe-their-own-i...
1•pseudolus•3m ago•0 comments

The Beauty of Building

https://ym2132.github.io/the_beauty_of_building
1•Two_hands•4m ago•0 comments

Robert Hooke

https://en.wikipedia.org/wiki/Robert_Hooke
1•wjb3•6m ago•0 comments

Things you can do with diodes

https://lcamtuf.substack.com/p/things-you-can-do-with-diodes
2•zdw•10m ago•0 comments

Show HN: Inspector Claude – explore your Claude Code sessions

https://github.com/santaclaude2025/inspector-claude
1•jjak82•15m ago•0 comments

For rural Californians, unreliable power has become the norm

https://www.hcn.org/issues/57-11/for-rural-californians-unreliable-power-has-become-the-norm/
3•dangle1•16m ago•0 comments

Opinion: The era of 'free' excess renewable energy is over

https://www.utilitydive.com/news/the-era-of-free-excess-renewable-energy-is-over/804471/
2•boshomi•20m ago•0 comments

Nicholas Carlini – Are LLMs worth it? [video]

https://www.youtube.com/watch?v=PngHcmMmwWI
1•teddykoker•25m ago•0 comments

SQLite Cache Schema

https://gist.github.com/ewaldbenes/e48b9b4c1d0e1cb7175dfdd868addd58
1•thunderbong•29m ago•0 comments

Palantir tops estimates, boosts fourth-quarter guidance on AI adoption

https://www.cnbc.com/2025/11/03/palantir-pltr-q3-earnings-2025.html
2•mgh2•31m ago•0 comments

Looking for Input

2•tigydavid•33m ago•0 comments

Trump readies US troops for ground invasion in Mexico to go after drug cartels

https://www.independent.co.uk/news/world/americas/us-politics/trump-drug-cartels-mexico-plans-mil...
7•saubeidl•41m ago•2 comments

We Used to Read Things in This Country

https://thebaffler.com/salvos/we-used-to-read-things-in-this-country-mccormack
3•samclemens•43m ago•0 comments

Cost-neutral food tax reforms for healthier and more sustainable diets

https://www.sciencedirect.com/science/article/pii/S0921800925003052
2•PaulHoule•52m ago•0 comments

Visualizee.ai

https://visualizee.ai
1•bellamoon544•52m ago•1 comments

Fusion Energy in 2025: Six Global Trends to Watch

https://www.iaea.org:443/newscenter/news/fusion-energy-in-2025-six-global-trends-to-watch
2•mpweiher•54m ago•0 comments

Claude Code refused to add rainbows and unicorns to my app

18•glamp•55m ago•3 comments

A Friendly Tour of Process Memory on Linux

https://www.0xkato.xyz/linux-process-memory/
9•0xkato•55m ago•4 comments

Bay Area man creates prehistoric Halloween by bringing "Doloresaurus" to life [video]

https://www.youtube.com/watch?v=BXiNtT6cRc4
1•guerrilla•55m ago•0 comments

A confidential manifesto lays out a billionaire's new vision for NASA

https://www.politico.com/news/2025/11/03/jared-isaacman-confidential-manifesto-nasa-00633858
2•c420•56m ago•0 comments

Linkers: A 20 Part Series (2007)

https://www.airs.com/blog/archives/38
5•mattrighetti•58m ago•1 comments

2025 United States federal government shutdown

https://en.wikipedia.org/wiki/2025_United_States_federal_government_shutdown
3•wslh•1h ago•1 comments

KitteHub: Python projects in the cloud in a few clicks

https://github.com/autokitteh/kittehub
1•itayd•1h ago•0 comments

OneBusAway: Open-source transit app for real-time information

https://github.com/OneBusAway
1•thunderbong•1h ago•0 comments

Guideline has been acquired by Gusto

https://help.guideline.com/en/articles/12694322-guideline-has-joined-gusto-faqs-about-our-recent-...
33•surprisetalk•1h ago•17 comments

Physical activity as a modifiable risk factor in preclinical Alzheimer's disease

https://www.nature.com/articles/s41591-025-03955-6
3•bookofjoe•1h ago•0 comments

No space, no time, no particles: a vision of quantum reality

https://www.newscientist.com/article/2500081-no-space-no-time-no-particles-a-radical-vision-of-qu...
3•fnord77•1h ago•0 comments

DJI's Drones, Both Branded and Disguised, Are Even Closer to a US Ban

https://petapixel.com/2025/11/03/djis-drones-both-branded-and-disguised-are-even-closer-to-a-us-ban/
6•bookofjoe•1h ago•2 comments