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

Comments

zoezoezoezoe•11mo 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•11mo 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: Watch TV for Free for India

https://tvdekh.com
1•isandeep1995•2m ago•0 comments

My Pragmatic Way to Use Labels in Password Managers

https://martin.sh/my-pragmatic-way-to-use-labels-in-password-managers/
1•showmypost•3m ago•0 comments

How to catch LiteLLM like security issues proactively/reactively?

https://github.com/dinakars777/ai-code-guardian
1•dinakars777•5m ago•0 comments

US SEC's ex-enforcement chief clashed with bosses over cases before leaving

https://www.reuters.com/business/finance/us-secs-ex-enforcement-chief-clashed-with-bosses-before-...
1•breve•5m ago•0 comments

Gl0wFlow – A plain-English scripting language and Rust runtime for AI

https://github.com/nikolakb/Gl0wFlow
1•Gl0wFl0w•6m ago•0 comments

xAI Will Win

https://twitter.com/shaunmmaguire/status/2036097323458343361
1•mhb•6m ago•0 comments

We're Not Vibe Engineering

https://jonathannen.com/not-vibe-engineering/
1•jwilliams•6m ago•0 comments

Designing repos for humans and agents

https://www.merolle.net/blog/designing-repos-for-humans-and-agents/
1•ryanmerolle•7m ago•0 comments

Front end devs need to have design skills

https://www.sarahgebauer.com/post/frontend-devs-need-to-have-design-skills/
1•speckx•8m ago•0 comments

Chinese EV maker BYD in talks to open Canadian dealerships, consultant says

https://www.theglobeandmail.com/business/article-china-ev-maker-byd-auto-dealerships-canada/
2•breve•9m ago•0 comments

OpenAI shutting down Sora app

https://www.nbcnews.com/tech/tech-news/openai-shuttering-sora-video-generating-service-rcna264989
7•websku•11m ago•3 comments

I сan't find a job in the Bay Area, so I'll search in London

https://relocateme.substack.com/p/i-cant-find-a-job-in-the-bay-area
2•andrewstetsenko•12m ago•0 comments

Go Naming Conventions: A Practical Guide

https://www.alexedwards.net/blog/go-naming-conventions
1•yurivish•12m ago•0 comments

UK game development suffers its 'sharpest recorded decline'

https://www.videogameschronicle.com/news/as-uk-game-development-suffers-its-sharpest-recorded-dec...
3•fidotron•12m ago•0 comments

Ossature: Spec-Driven Code Generation

https://ossature.dev/blog/introducing-ossature/
1•beshrkayali•15m ago•0 comments

Army raises enlistment age to 42, removes waiver for marijuana possession

https://taskandpurpose.com/news/army-enlistment-age-marijuana-waiver/
3•ilamont•15m ago•2 comments

Kicking the Tires on Temporal's Agent Skill

https://stevekinney.com/writing/temporal-developer-skill
1•stevekinney•16m ago•0 comments

United Relax Genius Marketing Campaign

https://twitter.com/byAnhtho/status/2036542952164704755
1•AnhTho_FR•19m ago•0 comments

Obsolete Sounds

https://citiesandmemory.com/obsolete-sounds/
2•benbreen•19m ago•0 comments

When upserts don't update but still write

https://www.datadoghq.com/blog/engineering/debugging-postgres-performance/
1•jpineman•19m ago•0 comments

The Most Innovative Companies of 2026

https://www.fastcompany.com/most-innovative-companies/list
1•kaycebasques•21m ago•0 comments

We're Saying Goodbye to Sora

https://twitter.com/soraofficialapp/status/2036532795984715896
12•octabond•21m ago•4 comments

US expected to send thousands more soldiers to Middle East, sources say

https://www.reuters.com/world/middle-east/us-expected-send-thousands-soldiers-middle-east-sources...
7•cdrnsf•21m ago•0 comments

Wedium – TikTok Made in Europe

https://wedium.social/
2•amai•26m ago•0 comments

Show HN: Bounty_OS the job market BLOWS

https://bountyos.com/pitch/
1•andrewconklin•28m ago•2 comments

Is anybody else bored of talking about AI?

https://blog.jakesaunders.dev/is-anybody-else-bored-of-talking-about-ai/
142•jakelsaunders94•30m ago•76 comments

Wonka's Whipple Scrumptious Fudgemallow Delight (2005)

http://foodisnice.blogspot.com/2005/08/chocolate-wonkas-whipple-scrumptious.html
1•microsoftedging•30m ago•0 comments

The Barium X Window System Toolkit for Common Lisp

https://tomscii.sig7.se/barium/
1•oumua_don17•31m ago•0 comments

Litellm PyPI supply chain attack

https://twitter.com/karpathy/status/2036487306585268612
2•vinnyglennon•31m ago•0 comments

Detecting file changes on macOS with kqueue

https://www.vegardstikbakke.com/kqueue/
1•benhoyt•31m ago•0 comments