frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Avoid Continue

https://www.teamten.com/lawrence/programming/avoid-continue.html
2•todsacerdoti•2mo ago

Comments

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

The Dutch Eel Ships of London

https://bsky.app/profile/greenleejw.bsky.social/post/3lsvugci7mc2u
1•vintagedave•34s ago•0 comments

Cough Syrup Ambroxol shows promise for Parkinson's dementia treatment

https://newatlas.com/brain/alzheimers-dementia/cough-syrup-dementia/
1•thunderbong•5m ago•0 comments

Retrowave 2

https://store.steampowered.com/app/3331000/Retrowave_2/
1•doener•6m ago•0 comments

Show HN: OffChess – 100k+ Offline, Ad-Free Chess Puzzles App

https://offchess.com
1•avadhesh18•8m ago•0 comments

Show HN: StopAddict – Track your addictions and quit with a simple system

1•skyzouw•8m ago•0 comments

Ready Lists

https://11011110.github.io/blog/2025/07/07/ready-lists.html
1•082349872349872•10m ago•0 comments

Introducing OpenCLI

https://patriksvensson.se/posts/2025/07/introducing-open-cli
3•pimterry•11m ago•0 comments

Cocoa Basics Part Zero: Introduction

https://blog.xoria.org/cocoa-basics-0/
1•todsacerdoti•14m ago•0 comments

UK police dangle £75M to digitize its VHS tape archives

https://www.theregister.com/2025/07/08/uk_police_dangle_75_million/
1•jjgreen•14m ago•0 comments

Taichi: High-performance parallel programming in Python

https://www.taichi-lang.org/
2•fanf2•23m ago•0 comments

Heredocs in Dockerfiles (2021)

https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/
3•tosh•23m ago•0 comments

Am I Online?

https://antonz.org/is-online/
2•begoon•24m ago•0 comments

C4 Bomb: Blowing Up Chrome's AppBound Cookie Encryption

https://www.cyberark.com/resources/threat-research-blog/c4-bomb-blowing-up-chromes-appbound-cookie-encryption
2•Metalnem•25m ago•0 comments

Kronotop v0.12.0 – Scalable, transactional doc DB with query predicates

https://github.com/kronotop/kronotop/releases/tag/v0.12.0
1•mastabadtomm•29m ago•0 comments

WebAssembly: Yes, but for What?

https://queue.acm.org/detail.cfm?id=3746171
3•todsacerdoti•30m ago•2 comments

Thunderbird 140 ESR is out now with new features

https://www.neowin.net/news/thunderbird-140-esr-is-out-now-with-new-features-bug-fixes-and-critical-security-patches/
3•Bluestein•37m ago•0 comments

Zoopharmacognosy

https://en.wikipedia.org/wiki/Zoopharmacognosy
1•elsewhen•38m ago•0 comments

TIL you can make "GIFs" with SVGs for GitHub README.md files

https://koaning.io/posts/svg-gifs/
3•cantdutchthis•42m ago•0 comments

Lessons I Learned from My Failed SaaS Products

https://andresmax.substack.com/p/lessons-i-learned-from-my-failed
1•sjdonado•46m ago•0 comments

How to become passionate about delivering shareholder value

https://www.seangoedecke.com/shareholder-value/
2•rtukpe•51m ago•1 comments

You don't have to use Nix to manage your dotfiles

https://jade.fyi/blog/use-nix-less/
1•signa11•52m ago•0 comments

Visionaries Without Vision

https://www.hamiltonnolan.com/p/visionaries-without-vision
1•te_chris•56m ago•0 comments

One Day in Kentucky and What Makes America Great

https://www.forkingpaths.co/p/one-day-in-kentucky-and-what-actually-33b
1•rbanffy•57m ago•0 comments

Duke Nukem Is Back, but in a Silly and Sad Way

https://kotaku.com/duke-nukem-world-of-tanks-battle-pass-lara-croft-sad-1851785719
4•Bluestein•58m ago•0 comments

U.S. measles cases reach 33-year high as outbreaks spread

https://www.washingtonpost.com/health/2025/07/07/measles-cases-hit-record/
7•thisisit•1h ago•0 comments

Mudita Kompakt minimalist phone for tweens (dumbphone plus) [YouTube] [video]

https://www.youtube.com/watch?v=UmVUIGr-bus
1•kefabean•1h ago•0 comments

'There's a knife at my throat'. A tax code time bomb hammered small businesses

https://qz.com/tax-code-section-174-tech-layoffs-small-businesses
2•mjwhansen•1h ago•0 comments

Female-led aerospace sewing firm is expanding

https://www.bbc.com/news/articles/cpd19952nx9o
5•Bluestein•1h ago•1 comments

Gabe Newell: Linux is the future of gaming (2013)

https://arstechnica.com/gaming/2013/09/gabe-newell-linux-is-the-future-of-gaming-new-hardware-coming-soon/
2•XzetaU8•1h ago•1 comments

How Proxies Improve SEO Monitoring and Analysis?

https://medium.com/@business_46193/how-proxies-improve-seo-monitoring-and-analysis-01d50d2679cf
1•RainbowJ•1h ago•0 comments