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•7mo ago

Comments

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

I built 'Cursor for Ad Creatives' – Reverse-engineering ads using LLMs

https://www.magicmango.ai/en/blog/cursor-for-ad-creatives
1•lyorrei•5m ago•0 comments

Video Games Like Assassin's Creed Feed into Conspiracy Thinking

https://slate.com/culture/2025/11/video-games-assassins-creed-conspiracy-theory-epstein-qanon-med...
1•omnibrain•5m ago•0 comments

Europe's New War on Privacy

https://unherd.com/2025/11/europes-new-war-on-privacy/
1•joecobb•6m ago•0 comments

Show HN: A better Waze experience for your Tesla

https://www.teslanav.com/
1•ryanvogel•6m ago•0 comments

The Continuous Tensor Abstraction: Where Indices Are Real

https://arxiv.org/abs/2407.01742
1•ubasu•8m ago•0 comments

US War Dept's Big UFO Lie

https://www.overcomingbias.com/p/us-war-depts-big-ufo-lie
2•jger15•15m ago•2 comments

MX Master 4 killer? HP 785M/780M Ultra Fast Scrolling Review

https://www.jacopofranco.com/projects/hp-785m780m-ultra-fast-scrolling-review
1•jacopops•17m ago•0 comments

A simple waybar lyric module

https://github.com/rainaisntbald/waybar_lyrics
1•amadeuspagel•18m ago•0 comments

I built FREE infinite name generator and domain finder for side projects

https://proicon.ai/app/name-generator
1•Abod•21m ago•2 comments

Lumine: Building Generalist Agents in 3D Open Worlds

https://www.lumine-ai.org/
1•jauntywundrkind•22m ago•0 comments

FUTO: Keyboards Shouldn't Connect to the Internet

https://keyboard.futo.org/
2•ForHackernews•23m ago•1 comments

An ortographical typo in Zen of Python text (2008)

https://bugs.python.org/issue3364
1•susam•24m ago•0 comments

Stripe City – Black Friday/Cyber Monday Transactions in Real-Time

https://bfcm.stripe.com/
1•meetpateltech•25m ago•0 comments

Semantic Search over Text with NeuronDB

https://www.pgelephant.com/blog/neurondb-semantic-search-guide
1•pgelephant2025•31m ago•0 comments

Show HN: Nano PDF – A CLI Tool to Edit PDFs with Gemini's Nano Banana

https://github.com/gavrielc/Nano-PDF
13•GavCo•31m ago•2 comments

Joe Armstrong interviews Alan Kay (2016) [video]

https://www.youtube.com/watch?v=fhOHn9TClXY
4•kerim-ca•38m ago•0 comments

Arabic Time Words

https://arabic.desert-sky.net/time.html
1•marysminefnuf•40m ago•0 comments

AlphaFold Is Five Years Old – These Charts Show How It Revolutionized Science

https://www.nature.com/articles/d41586-025-03886-9
2•skx001•41m ago•0 comments

Unexpected events and prosocial behavior: the Batman effect

https://www.nature.com/articles/s44184-025-00171-5
1•atmosx•41m ago•1 comments

Tom Stoppard, playwright of dazzling wit and playful erudition, dies aged 88

https://www.theguardian.com/stage/2025/nov/29/tom-stoppard-playwright-of-dazzling-wit-and-playful...
2•mellosouls•46m ago•1 comments

Oxytocin boosts creativity, but only for approach-oriented people

https://www.psypost.org/oxytocin-boosts-creativity-but-only-for-approach-oriented-people/
2•DrierCycle•50m ago•0 comments

All it takes is for one to work out

https://alearningaday.blog/2025/11/28/all-it-takes-is-for-one-to-work-out-2/
55•herbertl•53m ago•25 comments

We've shipped a bunch of improvements to Macroscope over the last month

https://blog.macroscope.com/blog/changelog-november-2025
1•curiouska•54m ago•0 comments

Show HN: Experimental static AI coded website w/ Astro + tails for github pages

https://tariqdude.github.io/Github-Pages-Project-v1/
1•chiengineer•55m ago•1 comments

Show HN: I built a note-taking app with Markdown, images, and semantic search

https://app.notedown.xyz
1•5inGularity•56m ago•0 comments

Show HN: Free SDK changelog tracker with automatic daily updates

https://sdk-changelog-tracke-y3vn.bolt.host/
1•rokbenko•58m ago•0 comments

Ahead of the holidays, consumer and child advocacy groups warn against AI toys

https://www.npr.org/2025/11/20/nx-s1-5612689/ai-toys
1•1659447091•1h ago•0 comments

Baboon: Data Modeling with Automatic Evolutions and tagless binary codecs

https://github.com/7mind/baboon
2•pshirshov•1h ago•0 comments

A Visual Guide to How the Hong Kong Fire Spread

https://www.bbc.co.uk/news/resources/idt-c9792622-43e7-4b04-8374-2771dce4fcd1
5•skx001•1h ago•0 comments

Airbus issues major A320 recall due to software/radiation problem

https://www.reuters.com/business/aerospace-defense/airbus-issues-major-a320-recall-after-flight-c...
9•thundergolfer•1h ago•1 comments