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•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 Alignment Problem in Your Government

https://kunnas.com/articles/alignment-problem-in-your-government
1•ekns•1m ago•0 comments

My audio interface has SSH enabled by default

https://hhh.hn/rodecaster-duo-fw/
1•hhh•2m ago•0 comments

Microsoft's Wave of Executive Departures

https://www.theverge.com/tech/917361/microsoft-executive-departures-notepad
1•cdrnsf•3m ago•0 comments

TIPSv2: Advancing Vision-Language Pretraining with Enhanced Patch-Text Alignment

https://gdm-tipsv2.github.io/
1•gmays•4m ago•0 comments

LLMs are pretty good at making slideshows now

https://iter.ca/post/llm-slideshows/
1•smitop•6m ago•0 comments

Show HN: ffmpeg-render-pro – Parallel video rendering with live dashboard

https://www.npmjs.com/package/ffmpeg-render-pro/v/1.2.0?activeTab=readme
1•beeswaxpat•9m ago•0 comments

RLMs process inputs up to two orders of magnitude beyond model context windows

https://github.com/alexzhang13/rlm
1•blumomo•10m ago•0 comments

Support Put, Patch, and Delete in HTML Forms

https://alexanderpetros.com/triptych/form-http-methods
1•acabal•10m ago•0 comments

Solve identity consistency problem for foundational image models

https://www.photalabs.com/blog/every-frontier-model-can-be-personalized-for-you/
1•ykhli•10m ago•0 comments

Show HN: HNswered – watches for replies to your Hacker News posts and comments

https://github.com/adam-s/HNswered
1•dataviz1000•13m ago•0 comments

Simple 3D Modeler on Web

https://sinter-3d.com/
2•db1024•17m ago•1 comments

Google Commits to Invest Up to $40B in Anthropic

https://www.nytimes.com/2026/04/24/technology/google-anthropic-investment-artificial-intelligence...
2•xnx•18m ago•0 comments

Cohere to Acquire Aleph Alpha

https://www.ft.com/content/4492c0d6-855b-4164-9ae5-f4d855a95f1e
2•mkirchner•23m ago•0 comments

What Is APL and What Can APL Do for You? (2024) [video]

https://www.youtube.com/watch?v=-5mSOyr8roc
2•tosh•25m ago•0 comments

Join the Choredle Android Beta Testers List

https://app.choreodle.com/#mlb2-40174361
1•mohanjith•26m ago•1 comments

The Geometry of Forgetting

https://arxiv.org/abs/2604.06222
2•ashwing1984•29m ago•0 comments

Use Built-In VPN in Firefox

https://support.mozilla.org/en-US/kb/built-in-vpn
1•HelloUsername•30m ago•0 comments

The Classic American Diner

https://blogs.loc.gov/picturethis/2026/04/the-classic-american-diner/
4•NaOH•32m ago•0 comments

Relays for Nimony's Standard Library

https://nim-lang.org/araq/relays.html
1•moigagoo•35m ago•0 comments

Show HN: I'm 15 and built a cryptographic accountability layer for AI agents

https://github.com/arian-gogani/nobulex
1•arian_•36m ago•0 comments

mine: A complete, no-frills IDE for Coalton and Common Lisp

https://twitter.com/stylewarning/status/2047736414704435535
2•tosh•40m ago•0 comments

Ubuntu 26.04 Released

https://discourse.ubuntu.com/t/ubuntu-26-04-resolute-raccoon-lts-released/80833
4•synergy20•40m ago•2 comments

AI Agent Designs a RISC-V CPU Core from Scratch

https://spectrum.ieee.org/ai-chip-design
2•Teever•42m ago•0 comments

APL\? (1990)

https://dl.acm.org/doi/epdf/10.1145/97811.97845
2•tosh•44m ago•0 comments

MiniZinc, constraint modelling language solve discrete optimisation problems

https://www.minizinc.org
2•Alifatisk•46m ago•0 comments

FluxBB Built with Rust

https://github.com/skorotkiewicz/fluxbb-rs
2•modinfo•48m ago•0 comments

'Startup Cowboys' Are Making This Texas Town the New Tech Hotspot

https://www.wsj.com/business/entrepreneurship/lockhart-texas-tech-hub-fd1bf380
3•malshe•49m ago•2 comments

A P2P Network for Collaborative AI Code Optimization

https://community.computer/
1•aiw1nt3rs•50m ago•0 comments

Before Apple Music, There Was MapleMusic–Canada's Forgotten Pioneer

https://thewalrus.ca/before-apple-music-there-was-maplemusic/
1•janandonly•50m ago•0 comments

QR Lume – a privacy‑first iOS tool for inspecting QR codes safely

https://apps.apple.com/us/app/qrlume/id6762032298
1•briwandt•51m ago•2 comments