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.

Dutch public prosecutor hacked Tata Steel for environmental investigation

https://www.techzine.eu/news/security/145955/dutch-public-prosecutor-hacked-tata-steel-for-enviro...
1•Brajeshwar•1m ago•0 comments

AMD "Zen 6" for Desktop Reportedly Pushed to Computex 2027

https://www.techpowerup.com/355030/amd-zen-6-for-desktop-reportedly-pushed-to-computex-2027
1•kristianp•3m ago•0 comments

Biochar and River Mud Recycling Cut Emissions in Traditional Silk Dyeing

https://bioengineer.org/biochar-and-river-mud-recycling-cut-emissions-in-traditional-silk-dyeing/
1•bryanrasmussen•7m ago•0 comments

ThinkBoard 0.9.0

https://vestigecounty.github.io/thinkboard/
1•sev_verso•9m ago•1 comments

My Monitor Was Cutting My Download Speed by 75%

https://blog.tymscar.com/posts/studiodisplayethernet/
2•soheilpro•9m ago•0 comments

Reports: US Agriculture Department, FBI Breached by Hackers

https://english.aawsat.com/world/5343919-reports-us-agriculture-department-fbi-breached-hackers
2•theanonymousone•10m ago•0 comments

What the World Trades. and with Whom?

https://trade.innerkore.com/
1•gagan2020•11m ago•0 comments

FBI reportedly investigating apparent hack of its criminal database

https://www.bbc.com/news/articles/cvze7de86pk3o
6•theanonymousone•12m ago•0 comments

Built for the End of the World and Beyond [video]

https://www.youtube.com/watch?v=8yULxRefZ0w
1•tosh•13m ago•0 comments

Show HN: Turn an Old Android Phone into a Customizable PC Control Deck

https://github.com/ersinkoc/phonebox
1•ishqdehlvi•17m ago•0 comments

Bending Spoons buys Mailchimp for $3.68B

https://techcrunch.com/2026/11/20/bending-spoons-buys-mailchimp-for-3-68-billion/
2•ms7892•17m ago•0 comments

Leaked Files Show Deutsche Bank Protected Russian Profits Despite Warnings

https://www.nytimes.com/2026/11/17/world/europe/deutsche-bank-russia-oligarchs-leaked-documents.html
4•doener•22m ago•0 comments

Ask HN: What is your current hardware set up?

1•dfdydx•22m ago•0 comments

GL.iNet Router and KVM Security Incident (Nov 20 2026)

https://www.gl-inet.com/blogs/blog/glinet-security-notice-2026-11-20
1•benchtobedside•23m ago•0 comments

Show HN: Stop applying to jobs using AI-generated resume

https://unmark.grandimam.com/
2•grandimam•25m ago•0 comments

Ask HN: Solo dev at an early-stage startup (4 YoE). How to land mid-level roles?

2•nasimstg•26m ago•0 comments

Verify OpenAI-Generated Content

https://openai.com/research/verify/
3•tosh•30m ago•1 comments

MRAM Basics: How Magnetic Memory Is Replacing Embedded Flash

https://www.allaboutcircuits.com/technical-articles/mram-basics-how-magnetic-memory-is-replacing-...
2•giuliomagnifico•32m ago•0 comments

Visible Autorouter for KiCad

https://github.com/imsaiguy/autorouter
2•l8rlump•34m ago•0 comments

Jenson's Charity to Invest in CoreWeave

https://www.bloomberg.com/news/articles/2026-11-19/jensen-huang-s-charity-committed-350-million-t...
2•donbox•39m ago•0 comments

An experiment with SIMD in Rust using fearless_simd

https://ankursethi.com/blog/an-experiment-with-simd-in-rust-using-fearless_simd/
2•Brajeshwar•41m ago•0 comments

Some thoughts on AI-assisted work

https://tmrw.bearblog.dev/some-thoughts-on-ai-assisted-work/
2•orbis-tertius•44m ago•0 comments

PostHog and Composability

https://sourceoftruth.substack.com/p/on-posthog-and-composability
1•alexdean•44m ago•0 comments

Echo Lantern Game

https://www.gamepix.com/play/echo-lantern
1•RENiXTech•44m ago•0 comments

Agentic Code Quality – By Addy Osmani

https://addyo.substack.com/p/agentic-code-quality
1•fagnerbrack•45m ago•0 comments

$350M Google Android Settlement Offers Cash for Background Cellular Data Use

https://www.classaction.org/news/350m-google-android-settlement-offers-californians-cash-for-back...
3•DeepLogin•49m ago•0 comments

Talking or just meowing? Food test suggests cats call for human attention

https://phys.org/news/2026-11-meowing-food-cats-human-attention.html
2•bushwart•49m ago•1 comments

etcd is a strongly consistent, distributed key-value store

https://etcd.io/
2•Bluestein•49m ago•0 comments

Amazon's split personality: AWS embraces bot commerce, main site enforces bans

https://www.theregister.com/ai-and-ml/2026/11/20/amazons-split-personality-aws-embraces-bot-comme...
1•nephihaha•57m ago•1 comments

GTA6 sales hit $3.8bn on first day of release

https://www.theguardian.com/games/2026/nov/21/a-new-record-for-entertainment-grand-theft-auto-vi-...
2•kefabean•59m ago•0 comments