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•8mo ago

Comments

zoezoezoezoe•8mo 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•8mo 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.

Reverse Engineering Bluetooth on Amazon Kindle EReaders

https://sighery.com/posts/reverse-engineering-bluetooth-on-kindle-ereaders/
1•mattmar96•1m ago•0 comments

Frontier Models are Capable of In-context Scheming

https://arxiv.org/abs/2412.04984
1•william-evans•1m ago•0 comments

The Golden Rule of Driving

https://leroy.works/articles/the-golden-rule-of-driving/
1•leroy-is-here•1m ago•0 comments

Where Are the Beautiful Cities?

https://twitter.com/david_perell/status/2005730447897055414
1•lleims•4m ago•0 comments

Google Home Users Are Trying to Hack Their Way to a Better Voice Assistant

https://gizmodo.com/google-home-users-are-trying-to-hack-their-way-to-a-better-voice-assistant-20...
1•gnabgib•4m ago•0 comments

Cyberattack disrupts France's postal service and banking during Christmas rush

https://apnews.com/article/france-postal-service-cyberattack-4ea0c3e3bcb8a87341de8aebc1dfc916
3•gnabgib•7m ago•0 comments

Sprites: Persistent, suspendable, Linux environments as a Service

https://sprites.dev
1•nateb2022•10m ago•0 comments

The former Chinese police officer bringing bubble tea to wartorn Ukraine

https://www.theguardian.com/world/2025/dec/30/former-chinese-police-officer-bringing-bubble-tea-t...
1•mykowebhn•11m ago•0 comments

Enterprises Can Navigate Geolocation, Storage, and Privacy Compliance

https://guptadeepak.com/the-global-data-residency-crisis-how-enterprises-can-navigate-geolocation...
1•guptadeepak•13m ago•1 comments

India has surpassed Japan to become the fourth-largest economy

https://www.dw.com/en/india-overtakes-japan-as-4th-largest-economy-report-says/a-75341063
5•guptadeepak•15m ago•1 comments

ESPectre Sensor: open-source motion detection system for ESP32

https://espectre.dev/
3•882542F3884314B•16m ago•0 comments

Tatiana Schlossberg Has Died

https://www.nytimes.com/2025/12/30/us/politics/tatiana-schlossberg-dead.html
1•HR01•18m ago•0 comments

Painting with light in WebGL: terrain builder in the browser

https://medium.com/@bartoszu/painting-with-light-building-a-3d-island-in-the-browser-with-three-j...
2•bartoszu_•18m ago•0 comments

New brain implant restores lost senses using light

https://newatlas.com/medical-devices/neuro-key-implant-restore-lost-senses/
2•thunderbong•19m ago•0 comments

Show HN: Line Weaver – Image to G-Code Conversion for Pen Plotters

https://github.com/straczowski/line-weaver
1•rstraczowski•20m ago•0 comments

Junkyard Nissan V8 Lays Down Nearly 700 WHP with a Turbo and Little Else

https://www.thedrive.com/news/junkyard-nissan-v8-lays-down-nearly-700-whp-with-a-turbo-and-little...
1•PaulHoule•20m ago•0 comments

Prof. Software Developers Don't Vibe, They Control: AI Agent Coding Use in 2025

https://arxiv.org/abs/2512.14012
5•dpflan•21m ago•0 comments

Everything as Code: How We Manage Our Company in One Monorepo

https://www.kasava.dev/blog/everything-as-code-monorepo
21•benbeingbin•22m ago•9 comments

Show HN: Git-aware File tree viewer for Jupyter [video]

https://www.youtube.com/watch?v=zaK-EZd0GCY
1•loa_observer•23m ago•0 comments

Billionaire Superyachts in St. Barts for New Year's Eve

https://www.forbes.com/sites/jimdobson/2025/12/16/inside-the-billionaire-superyacht-rush-whos-cru...
1•walterbell•24m ago•0 comments

Show HN: Emergence (I asked Claude to impress me)

https://dwyer.co.za/static/claude.html
1•sixhobbits•24m ago•0 comments

Social Media Posts Predict Unemployment Spikes Two Weeks Early

https://scienceblog.com/social-media-posts-predict-unemployment-spikes-two-weeks-early/
3•geox•25m ago•0 comments

The sword-wielding man hired to kick squatters out of empty Oakland homes

https://oaklandside.org/2025/09/30/asap-squatter-removal-oakland/
1•randycupertino•25m ago•0 comments

Flock and Urban Surveillance

https://computer.rip/2025-12-26-Flock-and-Urban-Surveillance.html
2•kelnos•27m ago•0 comments

Soldr, an open-source compact soldering station

https://www.soldr.pro/
1•unwind•28m ago•0 comments

Ask HN: What's your dock setup for your work laptop?

1•charliebwrites•29m ago•1 comments

Amtrak: A Year of Records

https://media.amtrak.com/2025/11/amtrak-a-year-of-records/
2•eatonphil•29m ago•0 comments

Zpdf: PDF text extraction in Zig – 5x faster than MuPDF

https://github.com/Lulzx/zpdf
2•lulzx•31m ago•1 comments

The $100M Mistake: Microsoft PhotoDraw

https://www.youtube.com/watch?v=bGmXCb-irJ0
1•bane•32m ago•0 comments

Desktop Classic System – Spacial computing hearkening back to classic Mac OS

https://mycophobia.org/dcs/
3•todsacerdoti•33m ago•0 comments