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.

To read more, pick up a book not your phone, no wait

https://disassociated.com/read-more-pick-up-book-not-your-phone/
1•speckx•33s ago•0 comments

ESP32-C6 Power Consumption: Arduino vs. Zephyr vs. ESP-IDF Comparison

https://www.qoitech.com/blog/esp32-c6-power-consumption-comparison/
1•hasheddan•51s ago•0 comments

Wpcapng – Wireshark for the Web

https://github.com/stricaud/wpcapng
1•_____k•1m ago•0 comments

Home of local AI and useful web tools

https://pocketweb.tools/
1•shafkathullah•5m ago•0 comments

Silicon Valley has a science fiction problem

https://aeon.co/essays/silicon-valley-has-a-science-fiction-problem
1•bookofjoe•6m ago•0 comments

Tile's Security Is So Bad It's a Feature for Stalkers

https://blog.adafruit.com/2026/03/05/tiles-security-is-so-bad-its-a-feature-for-stalkers/
4•sambellll•9m ago•0 comments

Zig In-Depth Overview

https://ziglang.org/learn/overview/
2•andrewstetsenko•10m ago•0 comments

Trump switched planes earlier this month due to threat from Iran proxies

https://www.theguardian.com/us-news/2026/jul/24/trump-air-force-one-iran-threat
3•prmph•11m ago•0 comments

Unravelling the climate behind the collapse of Bronze Age civilizations

https://www.su.se/english/news/articles/2026-07-24-unravelling-the-climate-behind-the-collapse-of...
2•geox•11m ago•0 comments

Data at the Edge

https://twitter.com/rebeccakaden/status/2074862363874844903
1•gmays•13m ago•0 comments

I Tried Replacing Android with Linux

https://www.youtube.com/watch?v=wJQHQZ3IPaI
1•627467•13m ago•0 comments

Senate committee advances bill lifting 'speed limit in the sky'

https://www.aopa.org/news-and-media/all-news/2026/july/22/senate-committee-advances-bill-lifting-...
1•projektfu•13m ago•0 comments

ThinkPad Ergonomic Keyboard with Trackpoint

https://github.com/saoto28/pineapple60/
1•akyuu•14m ago•0 comments

A Visual Guide to the Hierarchical Navigable Small World Algorithm

https://cfu288.com/blog/2024-05_visual-guide-to-hnsw/
1•qwertyforce•15m ago•0 comments

When SearchValues Pays Off

https://medium.com/c-sharp-programming/when-searchvalues-actually-pays-off-59c5302ac38b
1•sukhpinder0804•15m ago•0 comments

Sam Altman – How to Start a Startup [video]

https://www.youtube.com/watch?v=Vv3CEAS_w34
1•Ronak_Prabhu•16m ago•0 comments

Csvcomp – Zero-dependency Python CSV diff utility

https://github.com/prasad-a-abhishek/csvcomp
1•prasadaabhishek•17m ago•0 comments

Backtesting a trading strategy in Python with yfinance

https://www.nwcast.com/article/guide-how-to-backtest-a-trading-strategy-in-python-20260706
1•francocos•18m ago•0 comments

The Curious Case of Agent Memory

https://rafihasan.com/blog/2026-07-24-the-curious-case-of-agent-memory
1•joker666•18m ago•0 comments

Show HN: new DOS paint app

1•nourdude•19m ago•0 comments

Memory Safety Absolutists

https://itsallaboutthebit.com/memory-safety-absolutists/
2•drogus•19m ago•0 comments

Show HN: I built a blind taste test for Claude and Codex designs

https://taste.rubenflamshepherd.com/
1•rubenflamshep•21m ago•0 comments

OpenAI agent goes rogue, hacks AI community, left escape plans in infrastructure

https://www.tomshardware.com/tech-industry/artificial-intelligence/openai-agent-goes-rogue-and-ha...
2•sbulaev•21m ago•0 comments

Three Theses on the Literacy Crisis

https://trevoraleo.substack.com/p/three-theses-on-the-literacy-crisis
1•samclemens•22m ago•0 comments

I was paying too much for Claude and codex here is how I reduced 90% of it

https://github.com/AjnasNB/qarinah
2•Cognifyr•23m ago•0 comments

Show HN: Working Async – The new wave of remote work is async-first

https://workingasync.io
1•Log007•23m ago•0 comments

Pyshackle: A hard pre-execution gate for AI agent tool calls (open source)

https://pypi.org/project/pyshackle/
2•shacklepro•24m ago•0 comments

Winding Down Artichoke Ruby

https://hyperbo.la/w/winding-down-artichoke-ruby/
1•ksec•24m ago•0 comments

Ask HN: What do you do when your AI agents are working?

2•mavsman•25m ago•0 comments

The Many Claudes of My Code

https://shippingbinaries.com/blog/the-many-claudes-of-my-code
1•u8•25m ago•0 comments