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.

ZeroFault – Standalone, air-gapped BIP-39 seed typo resolver in WebCrypto

https://layerzerofault.site/tools/bip39-offline-recovery.html
1•drantocuk•2m ago•0 comments

London's grimiest locations became the stars of 'Slow Horses'

https://www.cnn.com/travel/slow-horses-london-filming-locations
1•Tomte•3m ago•0 comments

What's Wrong with AI?

https://homepage.farm/ai.html
2•meetpateltech•6m ago•0 comments

The Company of the Future [video]

https://www.youtube.com/watch?v=deiLxNZH_DM
1•cavoirom•7m ago•0 comments

WebKit Features for Safari 27.1

https://webkit.org/blog/18486/webkit-features-for-safari-27-1/
1•ingve•10m ago•0 comments

ReplaySSM: Cache SSM Inputs, Not State (Tri Dao)

https://tridao.me/blog/2026/replayssm/
1•motownphilly•11m ago•0 comments

Free My TV: An Ad-Free Home Screen for Google TV, LG and Samsung TVs

https://github.com/simbasjungles/free-my-tv
1•acossta•13m ago•0 comments

IXL Acquires NoRedInk

https://app.dealroom.co/news/note/ixl-learning-acquires-writing-platform-noredink-used-in-9-of-10...
1•mathattack•14m ago•0 comments

Minimum lot sizes, Boeing's next 737 MAX, Fervo short sellers, Figure AI's data

https://www.construction-physics.com/p/reading-list-102426
1•juliangamble•20m ago•0 comments

China's Baidu tests robotaxi on London streets

https://www.reuters.com/business/finance/chinas-baidu-tests-robotaxi-london-streets-2026-10-23/
2•pretext•24m ago•0 comments

Show HN: BulkTextKit – 15 free text tools that run entirely in your browser

https://bulktextkit.gt.tc
4•sujalkhatri•25m ago•0 comments

Solving a Giant Rubik's Cube with a Quadruped Robot

https://leggedrobotics.github.io/rubik-skills/
1•thedreammachine•26m ago•0 comments

Crowley's Three Axes of JSON Queryin

https://nrposner.com/blog/crowleys-three-axes-of-json-querying/
1•mpweiher•28m ago•0 comments

jedna

https://triapul.cz/jedna/
1•jruohonen•29m ago•0 comments

Inside Meta’s Efforts to Prevent School Shootings

https://www.newyorker.com/news/the-lede/inside-metas-efforts-to-prevent-school-shootings
1•thm•36m ago•0 comments

Yeti, an MCP server that guides product design from requirements to Jira

https://github.com/macorifice/yeti
1•macorifice•43m ago•1 comments

Shigeru Miyamoto on Gen AI

https://www.ndw.jp/nintendo-interview-261023/
1•glimshe•44m ago•0 comments

OpenShell WebUI – a secure local web UI for OpenShell

https://github.com/shaharia-lab/openshell-webui
1•shahariaa•45m ago•0 comments

PSA: Do not use term "vibe coding"

3•Rabbit504030201•48m ago•7 comments

Amazon's Trainium Takes a Strike at the Training King

https://newsletter.semianalysis.com/p/amazons-trainium-takes-a-strike-at
3•admjs•51m ago•0 comments

Show HN: I built a gallery wall planner for two-sided physical art

https://duoarts.com/gallery-walls
2•redclamp•52m ago•0 comments

The Faux-Vintage Photo: Full Essay

https://thesocietypages.org/cyborgology/2011/05/14/the-faux-vintage-photo-full-essay-parts-i-ii-a...
1•jruohonen•53m ago•0 comments

PhysicsForums and the Dead Internet Theory (2025)

https://hallofdreams.org/posts/physicsforums/
2•bmacho•55m ago•1 comments

I wish restaurants would stop asking for my phone number

https://www.theatlantic.com/culture/2026/10/restaurant-phone-number-question/688926/
1•bookofjoe•56m ago•1 comments

Portable SIMD is in C++26, and you can try it now

https://wrocpp.github.io/posts/portable-simd/
1•Tomte•57m ago•0 comments

What's at Stake in Serbia's Election

https://rademeechtatic.substack.com/p/whats-at-stake-in-serbias-election
1•samizdis•59m ago•0 comments

Ask HN: Linux at work revoked due to MDM, how to fight?

2•aleda145•59m ago•5 comments

Created my first app petpal

https://play.google.com/store/apps/details?id=com.nexushybrids.petpal&hl=en_US
1•Mohtasim801•1h ago•0 comments

Draggy: A Windows desktop app for local and cloud AI chat and coding

https://github.com/Lucki74/draggy
1•lucki74•1h ago•0 comments

Show HN: AI text detector that never sees your text (runs 100% in-browser)

https://kouh.me/ai-text-detector
4•mrkn1•1h ago•5 comments