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•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.

Citor: A header-only C++20 thread pool tuned for sub-us dispatch

https://github.com/Lallapallooza/citor
1•Lallapallooza•58s ago•0 comments

Flipper One Tech Specs

https://docs.flipper.net/one/general/tech-specs
1•gregsadetsky•3m ago•0 comments

Marine scientists discover record number of new species

https://abcnews.com/International/marine-scientists-discover-1100-new-species-new-record/story?id...
1•thunderbong•4m ago•0 comments

Notched sticks to calculators: the history of counting machines

https://lcamtuf.substack.com/p/a-brief-history-of-counting-stuff
1•fratellobigio•5m ago•0 comments

Built a CAPTCHA alternative in C with PoW, JA4, and puzzle in complex mode

https://github.com/captxa/captxa-backend
1•captxa•6m ago•0 comments

OSS Alternative to AWS Transfer Family Written in Elixir

https://hex.pm/packages/sftpd
2•ixtli•8m ago•1 comments

Training a small model to write better OCaml with RLVR and GRPO

https://blog.nilenso.com/blog/2026/05/18/training-a-small-model-to-write-better-ocaml-with-rlvr-a...
1•sriharis•10m ago•0 comments

Killing in Japan Stirs Fear of New Crime Rings That Recruit the Vulnerable

https://www.nytimes.com/2026/05/20/world/asia/japan-tokuryu-crime-killing.html
1•mistersquid•10m ago•0 comments

What will better AI mean?

https://geohot.github.io//blog/jekyll/update/2026/05/20/what-will-better-mean.html
1•speckx•13m ago•0 comments

I got ratioed by 300 writers

https://booksbyjeffrey.substack.com/p/i-got-ratioed-by-300-writers
1•exolymph•14m ago•0 comments

TeamPCP Interview

https://buymeacoffee.com/insidedarknet/teampcp-interview
1•Cider9986•15m ago•0 comments

SQL injection on Drupal sites using PostgreSQL

https://www.drupal.org/sa-core-2026-004
2•nwellnhof•16m ago•0 comments

Muxy is a lightweight terminal for Mac with a mobile app for remote control

https://github.com/muxy-app/muxy
1•543310•16m ago•0 comments

SpaceX picks Goldman Sachs for lead left position on record-breaking IPO

https://www.cnbc.com/2026/05/19/spacex-picks-goldman-sachs-to-lead-record-breaking-ipo-sources-sa...
1•cwwc•18m ago•0 comments

Former Cuban president Raúl Castro indicted in US over fatal downing of 2 planes

https://www.bbc.com/news/live/czr24nr681gt
3•tartoran•19m ago•0 comments

Garry Tan – How one founder becomes a 1000x engineer (Stanford) [video]

https://www.youtube.com/watch?v=Lri2LNYtERM
2•sebzuddas•19m ago•0 comments

ReMarkable Connection Utility (RCU)

https://www.davisr.me/projects/rcu/
1•nathell•19m ago•0 comments

Assoc between preop vit D level andpostop pain in breast cancer surgery patients

https://rapm.bmj.com/content/early/2026/05/04/rapm-2025-107495
1•bookofjoe•19m ago•0 comments

Premium Deception: Uncovering a Global Android Carrier Billing Fraud Campaign

https://zimperium.com/blog/premium-deception-uncovering-a-global-android-carrier-billing-fraud-ca...
2•speckx•20m ago•0 comments

Cooling copper plates could slash data center energy use by 90%

https://newatlas.com/energy/cooling-copper-plates-data-center-energy-use/
6•geox•21m ago•0 comments

8k Meta employees are waking up to an email saying they've been laid off

https://qz.com/meta-layoffs-8000-jobs-ai-restructuring-052026
4•robertkarl•23m ago•0 comments

HP Now Sponsoring the Linux Vendor Firmware Service / Fwupd

https://www.phoronix.com/news/HP-Sponsoring-LVFS-Fwupd
1•mikece•24m ago•0 comments

The materials that make fusion possible [video]

https://www.youtube.com/watch?v=jgHB0NLfj4c
1•mpweiher•24m ago•0 comments

The Day Google Stopped Selling Software

https://newtonschooloftech.substack.com/p/the-day-google-stopped-selling-software
1•ash1794•24m ago•0 comments

ExtendDB: An open source DynamoDB-compatible adapter

https://aws.amazon.com/blogs/database/introducing-extenddb-an-open-source-dynamodb-compatible-ada...
2•alexbilbie•26m ago•0 comments

Sam Altman is giving OpenAI tokens in exchange for equity in YC Companies

https://www.inc.com/ben-sherry/sam-altman-says-openai-will-exchange-this-critical-ai-asset-for-st...
4•ageofattention•26m ago•1 comments

UAE says new pipeline that will bypass Strait of Hormuz is nearly 50% complete

https://www.cnbc.com/2026/05/20/uae-pipeline-strait-hormuz-iran-war-oil.html
1•shinryudbz•28m ago•0 comments

My obsession with the em dash and how I use it today

https://dhruvahuja.me/posts/emighty-have-fallen/
1•dhruv_ahuja•29m ago•0 comments

Swiss Open Source Software Benchmark

https://ossbenchmark.com/institutions
1•reconnecting•31m ago•0 comments

ElevenLabs Speech Engine

https://elevenlabs.io/speech-engine
1•mfiguiere•31m ago•0 comments