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.

US to Withdraw Troops from Germany

https://www.dw.com/en/us-to-withdraw-thousands-of-troops-from-germany/a-77016071
1•pera•1m ago•0 comments

Dazzle Camouflage

https://en.wikipedia.org/wiki/Dazzle_camouflage
1•tosh•2m ago•0 comments

AMD Posts HDMI 2.1 FRL Patches for Their Amdgpu Linux Driver

https://www.phoronix.com/news/AMDGPU-HDMI-2.1-FRL-Patches
1•type0•4m ago•0 comments

Andrej Karpathy: From Vibe Coding to Agentic Engineering

https://www.youtube.com/watch?v=96jN2OCOfLs
1•swolpers•7m ago•0 comments

Study: AI models that consider user's feeling are more likely to make errors

https://arstechnica.com/ai/2026/05/study-ai-models-that-consider-users-feeling-are-more-likely-to...
1•rbanffy•13m ago•0 comments

Show HN: I built Male Hormone Lab Interpreter that does what LLMs can't

https://www.longevity-tools.com/male-hormones-interpreter
2•zsolt224•14m ago•0 comments

Spirit Airlines Is Winding Down All Operations

https://spiritrestructuring.com/
1•KoftaBob•14m ago•0 comments

Show HN: Shutt – Turn Strava activities into shareable photo/video posts

https://shutt.run
1•zzarcon•16m ago•0 comments

Who's the First Person in History Whose Name We Know? (2015)

https://www.nationalgeographic.com/science/article/whos-the-first-person-in-history-whose-name-we...
1•downbad_•16m ago•1 comments

Show HN: Browser-based light pollution simulator using real photometric data

https://iesna.eu/?wasm=skyglow_demo
4•holg•18m ago•0 comments

Show HN: PythonStarter – now with Bitcoin Lightning payments

https://pythonstarter.co/
1•dan_easterman•21m ago•0 comments

Intel Inside the Micro Revolution: 8008 Origins

https://thechipletter.substack.com/p/intel-inside-the-micro-revolution
1•klelatti•22m ago•0 comments

Show HN: Filling PDF forms with AI using client-side tool calling

https://copilot.simplepdf.com/?share=a7d00ad073c75a75d493228e6ff7b11eb3f2d945b6175913e87898ec96ca...
2•nip•32m ago•1 comments

Brace for the patch tsunami: AI is unearthing decades of buried code debt

https://www.theregister.com/2026/05/02/ncsc_brace_for_patch_tsunami/
3•zeristor•32m ago•0 comments

Show HN: From Beats to Notes and Beyond

https://bookerapp.replit.app/book/fom/from-temporal-structure
1•ersinesen•36m ago•0 comments

Ask HN: Is it possible to upgrade the RAM of a MacBook Air M2?

1•julienreszka•36m ago•0 comments

CPanel CVE-2026-41940 Exploitation from a Honeypot Perspective

https://defusedcyber.com/cve-2026-41940-cpanel-exploitation-honeypot-perspective
1•waihtis•40m ago•0 comments

Ask HN: Is the AI running out of capacity?

1•roschdal•42m ago•0 comments

Show HN: Large Scale Article Extract of Newspapers 1730s-1960s

https://snewpapers.com/
2•brettnbutter•43m ago•1 comments

ScopeGuard 0.0.7: Your Go-to linter for scope and shadow issues, now with MCP

https://old.reddit.com/r/golang/comments/1t0nw27/scopeguard_007_your_goto_linter_for_scope_and/
2•eik•45m ago•0 comments

AI coding tools are silently disagreeing with each other

https://github.com/sampleXbro/agentsmesh
2•samplexBro•45m ago•0 comments

Dabbling in Erlang, part 2: A minimal introduction (2013)

https://agis.io/post/dabbling-in-erlang-a-minimal-introduction/
1•pasxizeis•49m ago•0 comments

Claude Code: Creating Kubernetes Debugging AI Agent for VictoriaMetrics

https://rtfm.co.ua/en/claude-code-creating-kubernetes-debugging-ai-agent-for-victoriametrics/
1•valyala•50m ago•0 comments

The Three Durable Function Forms

https://jack-vanlightly.com/blog/2025/12/10/the-three-durable-function-forms
1•birdculture•58m ago•0 comments

Why are there both TMP and TEMP environment variables, and which one is right?

https://devblogs.microsoft.com/oldnewthing/20150417-00/?p=44213
1•ankitg12•1h ago•0 comments

Shadcn/UI: A set of beautifully designed components that you can customize

https://github.com/shadcn-ui/ui
3•doener•1h ago•0 comments

Hanami, Dry and ROM are joining as Hanakai

https://hanakai.org/blog/2026/05/01/welcome-to-hanakai
1•makenosound•1h ago•0 comments

Lucide: Open-source icon library with 1600 vector (SVG) files for icons

https://github.com/lucide-icons/lucide
2•doener•1h ago•0 comments

A collection of Tailwind CSS v4.0 utilities for creating beautiful animations

https://github.com/Wombosvideo/tw-animate-css
2•doener•1h ago•0 comments

There is no Shopify for service businesses. Prove me wrong

https://www.indiehackers.com/post/there-is-no-shopify-for-service-businesses-i-keep-waiting-for-s...
1•stangineer•1h ago•0 comments