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.

Show HN: I built a dead simple App Store screenshot maker

https://ezscreenshots.com
1•abrowniejr•7m ago•0 comments

Salary isn't everything: Why flexibility to work remotely is the future of work

https://thehill.com/opinion/finance/5859902-hybrid-work-performance-retention/
1•robtherobber•9m ago•0 comments

Tesla's 4680 battery cells are underperforming and frustrating buyers – Electrek

https://electrek.co/2026/05/07/tesla-4680-battery-cell-performance-data-shows-cant-build-own-cells/
1•xbmcuser•11m ago•0 comments

Introductory Lectures on Black Hole Thermodynamics [pdf]

https://www.physics.umd.edu/grt/taj/776b/lectures.pdf
2•gone35•15m ago•0 comments

Rpow2: A tribute to the original RPOW by Hal Finney

https://github.com/frkrueger/rpow
1•janandonly•15m ago•0 comments

GTM Engineer Roles at WorkMotion, Supabase, SymphonyAI

https://gtmjobs.beehiiv.com/p/9-gtm-engineer-roles-this-week-workmotion-supabase-symphonyai-more
1•benchmarkapp•22m ago•0 comments

Claude Flags Hantavirus Vaccine Questions as Security Risk

3•pell•24m ago•3 comments

Syrian Tourist Map

https://alnashra.org/map11/gis_syria2/syria_tourism.php
1•altilunium•28m ago•0 comments

Data Centers in Space

https://nb1t.sh/data-centers-in-space/
1•freakynit•28m ago•0 comments

Google removes privacy assurances after stuffing devices with their AI model

https://www.thatprivacyguy.com/blog/google-quietly-removes-on-device-ai-privacy-claim/
2•AlexanderHanff•30m ago•1 comments

Show HN: Link_in_bio – Static HTML, no-back end Linktree alternative

https://github.com/p32929/link_in_bio
1•heliskyr2•33m ago•0 comments

Debian welcomes the 2026 GSoC interns

https://bits.debian.org/2026/05/welcome-gsoc2026-contributors.html
1•tannhaeuser•34m ago•0 comments

Mathematics Genealogy Project

https://www.mathgenealogy.org
1•ipnon•34m ago•0 comments

WebRTC Is the Problem

https://moq.dev/blog/webrtc-is-the-problem/
2•L_226•35m ago•0 comments

Copying Memory Is an Art

http://miod.online.fr/software/openbsd/stories/ovbcopy.html
1•signa11•44m ago•0 comments

Zed Is Pretty Nice

https://blog.kronis.dev/blog/zed-is-pretty-nice
2•KronisLV•45m ago•1 comments

CERN's KiCad component library now open source

https://home.cern/computing/cerns-kicad-component-library-now-open-source/
4•elashri•48m ago•1 comments

Scripily – AI for Restoring and Transcribing Damaged Documents

https://scripily.com/
1•thisarajay•51m ago•0 comments

Atlas of Artificial Intelligence

https://vivamau.github.io/aimap/
1•mnovasoftrm•51m ago•1 comments

Pi-for-Word: Pi Agent as Add-In for M365 Office Word

https://github.com/damianofalcioni/pi-for-word
1•damianofalcioni•54m ago•0 comments

Global perceptions of US fall below Russia under Trump

https://www.reuters.com/world/china/global-perceptions-us-fall-below-russia-under-trump-survey-fi...
3•benterix•58m ago•1 comments

San Fran: We Buried a $10k Treasure Chest

https://www.buriedtreasuresf.com
2•vinnyglennon•58m ago•0 comments

AI is rapidly changing cybersecurity across the world

https://fixtechhubs.blogspot.com/2026/05/ai-cybersecurity-threats-are-rising.html
1•rindodi•1h ago•0 comments

GitRace – a tap-to-fly arcade game where every level is a real GitHub repo

https://driftwood-4cd6d.web.app
1•root_theory•1h ago•0 comments

SEO Migration Checklist: From A to Z (DevGuide)

https://focusreactive.com/blog/seo-migration-checklist/
2•katyadrozd•1h ago•1 comments

Coinbase AWS Service Disruption

https://status.coinbase.com/incidents/frg5wqm113dh
1•aghuang•1h ago•0 comments

Show HN: Corsproxy – Fix CORS Errors Instantly – Free for Development

https://corsproxy.io/
1•mariusbolik•1h ago•0 comments

Notes from Inside China AI Labs

https://www.interconnects.ai/p/notes-from-inside-chinas-ai-labs
1•eamag•1h ago•0 comments

Police advised to disable Bluetooth on Axon body-worn cameras to avoid detection

https://www.abc.net.au/news/2026-05-08/police-advised-turn-bodycams-to-flight-mode-over-security-...
3•stubish•1h ago•1 comments

Diagrammer: Tell the model, get the diagram or the graphical map

https://github.com/IdraDev/Diagrammer
1•idradev•1h ago•1 comments