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.

Colleges have an education problem (2025)

https://12gramsofcarbon.com/p/colleges-have-an-education-problem
2•theahura•4m ago•0 comments

Show HN: Skiff, a frontier isochrone tuning simulation for sailboats

https://github.com/deepbluedynamics/skiff
3•kordlessagain•9m ago•1 comments

Alphaville LLC initiates coverage of SpaceX with Buy recommendation

https://www.ft.com/content/1344d22b-ee64-488d-bd02-170fe0c9de2b
2•imichael•10m ago•0 comments

Taste

https://katdispatch.bearblog.dev/on-taste/
2•JumpCrisscross•12m ago•0 comments

Cpp-Go-Zig-Odin: A series of small programs/tasks to compare

https://github.com/phillvancejr/Cpp-Go-Zig-Odin
1•ksec•14m ago•0 comments

UK Cybercrime Journal: Argos Account Takeover Fraud

https://blog.bushidotoken.net/2026/07/uk-cybercrime-journal-argos-account.html
1•diedose•22m ago•0 comments

Ask HN: Do your tests clear "If the tests pass, you cannot break the code" bar?

1•tristenharr•22m ago•0 comments

Show HN: AsyncFutures – A Ruby gem for asynchronous/concurrent code execution

https://rubygems.org/gems/async_futures/versions/0.1.2
1•eestrada•24m ago•0 comments

Proof of Concept for the recent Litematica path traversal bug which leads to RCE

https://github.com/AliensToEarth/litematica-rce
2•Cider9986•27m ago•0 comments

Built a tracker to estimate water wastage when talking to Claude

https://github.com/piyushkhemka/sip
1•piyushkhemka•29m ago•0 comments

BMW Warns of Unauthorized Production of 'Pirated' Cars in Russia

https://www.themoscowtimes.com/2026/07/11/bmw-warns-of-unauthorized-production-of-pirated-cars-in...
2•_____k•32m ago•0 comments

SK Hynix CEO: worst memory shortage in 2027, will persist beyond 2030

https://www.reuters.com/world/asia-pacific/sk-hynix-ceo-sees-worst-ever-memory-supply-shortage-20...
4•giuliomagnifico•32m ago•0 comments

Big Tech piles on $350B in debt to fuel AI data center race

https://www.latimes.com/business/story/2026-07-10/big-tech-piles-on-350-billion-in-debt-to-fuel-a...
5•1vuio0pswjnm7•41m ago•0 comments

Credit Sleeves Collapse Bubbles

https://medium.com/@mcgrathrpm/credit-sleeves-are-the-bubble-6c57a54b9cff
2•piyh•41m ago•0 comments

Can't Read Slop Anymore

https://blog.imraniqbal.org/cant-read-slop-anymore/
2•HotGarbage•44m ago•0 comments

Chipmakers have 67,000 unfilled jobs. An old training trick won't work this time

https://qz.com/semiconductor-workforce-1970s-training-fab-hiring-070626
2•edg5000•44m ago•0 comments

AI boom puts Big Tech's transparency to the test

https://www.axios.com/2026/07/10/ai-big-tech-transparency-electricity-water-use
2•1vuio0pswjnm7•45m ago•0 comments

Guide to the circular deals underpinning the AI Boom

https://www.bloomberg.com/graphics/2026-ai-circular-deals/
1•leonidasrup•57m ago•0 comments

Cottage Computer Programming (1984)

https://www.atariarchives.org/deli/cottage_computer_programming.php
1•lioeters•1h ago•0 comments

Landmark – an algorithmic index of relevant names, unclaimed at launch

https://landmarkindex.org
2•javierqac•1h ago•0 comments

I made a free PDF Editor that runs in a browser

https://www.pdfsimplified.com/
1•sanusihassan•1h ago•2 comments

Rejected by LessWrong for "Yellow Flags"

https://zenodo.org/records/21312304
1•tintweezl•1h ago•0 comments

Digital Dispensary and Headshop

https://shop.omeweed.com/
1•mmorga71•1h ago•0 comments

HubSpot transactional email: route through your domain with MailKite – MailKite

https://mailkite.dev/blog/hubspot-transactional-email-domain/
2•gabe_karina•1h ago•0 comments

'Hysteria' Grips San Francisco's Housing Market as A.I. Wealth Pours In

https://www.nytimes.com/2026/07/08/technology/san-francisco-home-sales-openai-anthropic-ipo.html
2•1vuio0pswjnm7•1h ago•0 comments

Why Write Code in 2026

https://softwaredoug.com/blog/2026/07/09/write-code.html
13•zdw•1h ago•2 comments

the history of the human face

https://economist.com/culture/2026/07/09/the-history-of-the-human-face-is-more-than-skin-deep
2•andsoitis•1h ago•0 comments

The Work of Helping A.I. Destroy Work

https://www.nytimes.com/2026/07/10/business/ai-white-collar-jobs.html
2•thm•1h ago•0 comments

Show HN: Chameleon – shows Claude a real file from your repo before it edits

https://github.com/crisnahine/chameleon
1•crisnahine•1h ago•0 comments

Under federal rule, colleges must leave grads better off or lose financial aid

https://www.npr.org/2026/06/30/nx-s1-5835631/turner-camhi-do-no-harm-college-loans
33•nradov•1h ago•32 comments