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

Comments

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

OpenSpec: Spec-driven development (SDD) for AI coding assistants

https://github.com/Fission-AI/OpenSpec/
1•tilt•1m ago•0 comments

Show HN: Proxly – Self-hosted tunneling on your own domain in 60 second

1•a1tem•4m ago•0 comments

Show HN: Conflicts.app, Iran conflict dashboard better then alternatives

https://www.conflicts.app/dashboard
2•juliusolsson•6m ago•0 comments

Show HN: J2Download – A simple online downloader supporting 40 platforms

https://j2download.com/
1•manhg•7m ago•0 comments

Bippy: React Internals Toolkit

https://www.bippy.dev/
1•handfuloflight•7m ago•0 comments

The Window Chrome of Our Discontent

https://pxlnv.com/blog/window-chrome-of-our-discontent/
1•SoKamil•11m ago•0 comments

How I've learned that certainty is the thing to fear

https://www.bbc.com/news/articles/c1w5z1d447lo
1•cmsefton•11m ago•0 comments

Show HN: Muffle – Blur everything except the active window in macOS

https://www.getmuffle.com/
1•AbjMV•13m ago•1 comments

I was "early" in agentic coding. Here's my story

3•noemit•19m ago•0 comments

Show HN: Drizby – WIP Metabase Alternative

https://www.drizby.com
1•cliftonc•21m ago•0 comments

The First Multi-Behavior Brain Upload

https://twitter.com/alexwg/status/2030217301929132323
1•DarkCow•21m ago•0 comments

Anthropic CEO reveals the reasons he rejected The Pentagon

https://xcancel.com/0xmitsurii/status/2030451168678457766
4•doener•21m ago•0 comments

Show HN: Stardial – a highly customizable terminal clock (Rust)

https://github.com/hisuic/stardial
2•firesushi•23m ago•0 comments

Emporion: A P2P Economy for Agents

https://github.com/garydevenay/emporion
1•garydevenay•23m ago•0 comments

Microsoft/Hve-Core

https://github.com/microsoft/hve-core
2•coderlens•23m ago•0 comments

Solving Compaction with Lobotomy

https://grimridge.net/blog/solving-compaction-with-lobotomy/
2•WadeGrimridge•25m ago•0 comments

Pushing and pulling: three reactivity algorithms

https://jonathan-frere.com/posts/reactivity-algorithms/
1•fanf2•26m ago•0 comments

Reverse engineering a DOS game with no source code using Codex 5.4

https://github.com/ammaarreshi/SkyRoads-Codex
1•smusamashah•27m ago•1 comments

Show HN: OpenClaw – Self-host OpenClaw in one command

1•congzhangzh•33m ago•0 comments

Money and collateral in an AI-first society

https://adlrocha.substack.com/p/adlrocha-money-and-collateral-in
1•adlrocha•36m ago•0 comments

Ask HN: Can I repurpose a Bluetooth voice remote as input device for a PC?

1•albert_e•38m ago•1 comments

Ask HN: How are you handling persistent memory across local Ollama sessions

1•null-phnix•39m ago•0 comments

Show HN: Spadyum – An Open-Source Civilization Backup Protocol

https://github.com/kivancadiguzel-design/Spadyum-Genesis/blob/main/README.md
1•Spadyum_Genesis•39m ago•0 comments

Julia Snail – An Emacs Development Environment for Julia Like Clojure's Cider

https://github.com/gcv/julia-snail
1•TheWiggles•41m ago•0 comments

Notes on Writing WASM

https://notes.brooklynzelenka.com/Blog/Notes-on-Writing-Wasm
4•vinhnx•43m ago•0 comments

Making Firefox's right-click not suck, more, with userChrome.css

https://joshua.hu/firefox-making-right-click-not-suck-even-more-with-userchrome
3•mmsc•45m ago•1 comments

Run prompts on a schedule with Claude Code

https://code.claude.com/docs/en/scheduled-tasks
1•blacktulip•45m ago•0 comments

Show HN: Open-source self-hosted Intercom and CCTV platform

https://github.com/rosteleset/SmartYard-Server
2•sbca68•47m ago•0 comments

Show HN: Self-Evolving Skill – empirical results from a 5-round experiment

https://github.com/191341025/Self-Evolving-Skill
1•tiansenxu•52m ago•0 comments

What Is AI Reading?

https://generativepulse.ai/report/
1•doener•53m ago•0 comments