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.

Easel Now Has Tilemaps

https://easel.games/blog/2026-nov-update
1•BSTRhino•4m ago•1 comments

Binance lost $6.3B without leaking a single private key

https://syncroma.com/en-el-hackeo-de-binance-fontaneria-zero-trust/
1•usmanhussainbas•5m ago•0 comments

Europe plans to squeeze out Starlink

https://www.politico.eu/article/eu-telecom-giants-team-up-against-starlink/
2•TMWNN•7m ago•2 comments

The Interconcept Space

https://enricobottazzi.github.io/inter-concept-space/
1•demivoleegaston•10m ago•0 comments

Using Lotteries to Make Event Ticket Sales Fairer in South Africa

https://mayberay.bearblog.dev/i-hate-online-waiting-rooms-using-lotteries-to-make-event-ticket-sa...
1•mugamuga•11m ago•0 comments

Convert OST to PST

https://blog.perfectdatasolutions.com/ost-to-pst-converter-software-2/
1•tieanderson•15m ago•0 comments

JavaScript Performance Tips That Make a Difference

https://jsdevspace.substack.com/p/20-javascript-performance-tips-that
1•javatuts•16m ago•0 comments

Binance – Total impact sits at around $6.3B

https://twitter.com/binance/status/2115993361517891592
1•victorbuilds•18m ago•0 comments

Mistral 4 had a release, makes it comparable to Chinese open-weight models

https://www.reuters.com/world/china/mistral-ceo-says-new-ai-model-beats-chinese-ones-some-areas-2...
3•nvmdbljstm•20m ago•1 comments

Global GPU prices rise 35% in just three months

https://videocardz.com/newz/global-gpu-prices-rise-35-in-just-three-months
1•giuliomagnifico•23m ago•0 comments

Audience Analysis – First step to project presentation

https://substack.com/profile/323507903-ukane-favour/note/c-374044494
1•UkaneFavour•24m ago•0 comments

An attack against an LLM agent is either detected or proven

1•consent-substra•25m ago•0 comments

WebGPU Best Practices

https://toji.dev/webgpu-best-practices/
1•mariuz•29m ago•0 comments

Show HN: Post-quantum signatureless authorization with recursive verification

https://zenodo.org/records/23778742
3•notsatoshinotsa•30m ago•0 comments

Ask HN: Are you tired too in this AI era?

59•mellosty•30m ago•28 comments

Stone Lighthouses

https://stonewalls.ch/div/histlighthouses
2•tontinton•33m ago•0 comments

elect.horse

https://elect.horse/
3•solarist•34m ago•0 comments

The Snowball Effect

https://aeon.co/essays/how-the-harsh-icy-world-of-snowball-earth-shaped-life-today
2•olvy0•35m ago•0 comments

Efficient Streaming Language Models with Attention Sinks

https://idlemachines.co.uk/essays/streaming-llm-attention-sinks
2•smaddrellmander•38m ago•0 comments

Last night an AI agent performed surgery on a mouse

https://twitter.com/OcanaSantero/status/2115442964574908902
3•bananaboy•40m ago•0 comments

Is it possible to build a direct democracy for one's country using GitHub?

https://github.com/jaenyf/odd
2•jaenyf•41m ago•0 comments

Why do Binance-like exchange development quotes vary so much?

https://cryptiecraft.com/crypto-exchange-development-cost/
1•monroealex17•43m ago•0 comments

I Returned My iPhone Duo

https://codakuma.com/i-returned-my-duo/
20•ricobecks•47m ago•26 comments

Losing the Blacklisting Race

https://medium.com/chainargos/losing-the-blacklisting-race-eea51d0a0f7b
1•Bluestein•50m ago•0 comments

Database Workbench 7.1.0 now available

https://www.upscene.com/news/item/20261028
1•mariuz•52m ago•0 comments

Show HN: Wayther – iOS weather app for road trips

https://wayther.alpennec.com/
2•alpennec•52m ago•0 comments

PEP 851 – Add List.discard()

https://peps.python.org/pep-0851/
2•theanonymousone•55m ago•0 comments

Augmenting Human Intellect

https://ryo.lu/journal/augmenting-human-intellect
1•allenleee•55m ago•0 comments

The AI bubble could expose your deepest secrets

https://www.bbc.com/future/article/20261029-the-ai-bubble-could-expose-your-deepest-secrets
2•saikatsg•56m ago•0 comments

Startups look for ways to make quieter drones

https://www.bbc.co.uk/news/articles/ck1exgejq3xvo
2•edward•56m ago•0 comments