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.

The Leaked Audit That Exposes OpenAI's Real Financial Crisis [video]

https://www.youtube.com/watch?v=UVKmPMTwglI
1•__natty__•3m ago•0 comments

Pre-auth RCE on MikroTik: exploited before the patch, rebuilt in three hours

https://blog.tolmo.com/p/pre-auth-rce-on-mikrotik-exploited
1•ecares•3m ago•0 comments

Which came first, Windows 95's taskbar or NeXT's Dock? Neither

https://www.theregister.com/os-platforms/2026/09/03/which-came-first-windows-95s-taskbar-or-nexts...
1•rbanffy•3m ago•0 comments

Firefox extension that makes Reddit Old again, no account required

https://github.com/moomou/reddit-classic
3•ppymou•7m ago•1 comments

They're Made Out of Meat

https://www.eastoftheweb.com/short-stories/UBooks/TheyMade.shtml
1•embedding-shape•8m ago•0 comments

Show HN: VODForge – a free local desktop UI for YouTube video/playlist downloads

https://getvodforge.com/
1•coopernusbaum•9m ago•0 comments

Show HN: Agentic OS: one Rust Linux binary, one SQLite and sandbox per entity

https://github.com/mmeyerlein/meclaw
1•mmeyerlein•9m ago•0 comments

Single-slot low-profile 75W RTX 3060 with no power connectors disappoints

https://www.tomshardware.com/pc-components/gpus/single-slot-low-profile-75w-rtx-3060-with-no-powe...
1•sbulaev•9m ago•0 comments

Dark Forest: SETI at Home for Agent Swarms

https://github.com/mobdotso/darkforest-plugin
1•david_shi•9m ago•0 comments

Building Without VC

https://novc.fyi
1•taylorfinley•11m ago•1 comments

Amazon cargo plane crashes at Miami airport after it overshoots runway

https://www.theguardian.com/us-news/2026/sep/06/amazon-cargo-plane-crashes-miami-airport
4•vinni2•16m ago•0 comments

Tiny backpack on a warbler reveals epic migration

https://www.washingtonpost.com/health/2026/09/06/i-put-tiny-backpack-warbler-it-revealed-an-epic-...
1•bookofjoe•17m ago•1 comments

Nazi, deportation and remigration party wins in Germany

https://www.aljazeera.com/news/2026/9/6/far-right-afd-wins-vote-in-germanys-saxony-anhalt-state-e...
4•giov4•17m ago•1 comments

The Great Barrier Reef refuses to die on schedule - best years record

https://www.latimes.com/opinion/story/2026-09-06/great-barrier-reef-refuses-to-die
2•bilsbie•19m ago•0 comments

Show HN: HexBOTs – a cellular automaton with robotic lawnmowers

https://hexbot-genesis.netlify.app/
2•unitX•20m ago•0 comments

The car industry A/B tested selling a car with and without CarPlay

https://a.wholelottanothing.org/the-car-industry-a-b-tested-selling-the-same-car-with-and-without...
17•gumby•23m ago•6 comments

Fundamentalista: Fundamental analysis of listed companies in Ruby from SEC EDGAR

https://github.com/bruno-costanzo/fundamentalista
2•br1costanzo•25m ago•0 comments

Understanding Computer Memory Architecture and SSD Internals

https://codingpirate.com/understanding-computer-memory-architecture-ac9320110787
2•Deeptiman•25m ago•0 comments

A Minimal Turing Test

https://www.sciencedirect.com/science/article/pii/S0022103117303980
2•AFF87•26m ago•0 comments

Ask HN: What's the best place to learn about skills and AI for coding in general

3•rrmdp•28m ago•2 comments

Show HN: Notifyd – one-binary notification service on Postgres, operated via MCP

https://github.com/rmzlb/notifyd
1•rmzlb•28m ago•0 comments

There Gonna Be a Shortage of Everything

https://out-of-hell.xylon.me.uk/shortage.html
7•xylon•31m ago•3 comments

Monitor GitHub repo stats without limits with gittraffic.com – for maintainers

https://gittraffic.com/blog/2026/09/01
2•pellecchialuigi•32m ago•1 comments

Show HN: HakoVM – Firecracker-class VMs in macOS, built by a macOS hacker

https://github.com/las7/HakoVM
2•sakuraiben•33m ago•0 comments

Localhub: Turn your local videos into your own offline YouTube

https://beta-japan.com/exis/p/localhub/
1•exisvr•34m ago•0 comments

Making signaling ML models, eliminating coding barriers

https://twitter.com/reviseml/status/2096682767446679648
1•Aadi_Ajmire•41m ago•1 comments

Chainsaw maker STIHL's chief calls for longer hours without extra pay

https://www.euronews.com/business/2026/09/06/reforms-chainsaw-maker-stihl-chief-calls-for-longer-...
5•devonnull•41m ago•0 comments

App Store Connect CLI

https://github.com/rorkai/App-Store-Connect-CLI
1•luispa•44m ago•0 comments

Ask HN: How do you manage skills files?

2•imadtaieber•49m ago•3 comments

Germany's far-right AfD projected to win

https://www.cnn.com/2026/09/06/europe/germany-afd-state-election-majority-intl
8•hasley•55m ago•12 comments