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.

LLM Model Cache Operator on K8s

https://github.com/federicolepera/praesto
1•lep_qq•33s ago•0 comments

Ukraine striking Russian energy infrastructure at unprecedented rate

https://www.ft.com/content/13687b48-9e54-44a1-bd4d-600bbc052baf
1•JumpCrisscross•3m ago•0 comments

Ford rehires human engineers after AI fails to match quality checks

https://www.bbc.com/news/articles/cgrkd41n2v9o
1•JumpCrisscross•5m ago•0 comments

Suezmax

https://en.wikipedia.org/wiki/Suezmax
1•thunderbong•10m ago•0 comments

Show HN: Design Patterns for AI

https://verificationdesign.com/
1•verify-ai•11m ago•0 comments

OpenAI's apparent failure to visit key site raises questions over UK investment

https://www.theguardian.com/technology/2026/jul/04/openai-apparent-failure-visit-key-site-questio...
1•YeGoblynQueenne•12m ago•0 comments

Show HN: Pixtrava – Public Profiles for Our Persistent 3D Voxel World

https://pixtrava.com/blog/public-profiles-launch
1•sbcom•13m ago•0 comments

Common 3D Benchy Problems, Causes and Fixes

https://bambu3design.com/13-common-3d-benchy-problems-causes-fixes/
2•ehsanamel•13m ago•1 comments

Japan's Hayabusa2 probe to conduct flyby of Torifune asteroid

https://www3.nhk.or.jp/nhkworld/en/news/20260705_01/
1•dvh•14m ago•0 comments

Show HN: Selbstbild – What Fable 5 thinks of your HN comment history

https://selbstbild.eu
2•Topfi•26m ago•0 comments

Skill > ~2.5-3X PNG > OCR > paint in QR

https://github.com/YogiSotho/dense-image-gen
2•yogisotho•33m ago•0 comments

New Weekly Space and Hypersonics Engineering Newsletter

https://buttondown.com/MaxQFrontier/archive/from-orbital-data-farms-to-hypersonic-prints-this/
2•chadsutter•35m ago•1 comments

Teaching Claude to Write Like Zweig

https://rornic.dev/posts/teaching-claude-to-write-like-zweig/
3•rornic•36m ago•0 comments

Sedentarism Exhibits a Distinct Mitochondrial Bioenergetic Phenotype

https://www.mdpi.com/3042-5158/2/3/10
2•bookofjoe•36m ago•0 comments

Self Hosted NAS Platform

https://github.com/benjaminjaklic/NAS_readme
2•user1256•38m ago•0 comments

Diffflow.com: Visual-Selector

https://diffflow.com/blog/visual-selector/
2•7rin0•38m ago•0 comments

If You Can Write Acceptance Criteria, You Can Write an AI Routing Policy

https://age-of-product.com/ai-routing-policy/
2•swolpers•40m ago•0 comments

Show HN: ChartsPrintables – printable conversion charts and reference tables

https://chartsprintables.com
2•robot1996•44m ago•0 comments

Harvey AI started with a Reddit thread. Now it's worth $11B

https://freemalta.com/hub/library/they-named-a-11-billion-company-after-harvey-specter-then-they-...
2•ilhaniremyuce•49m ago•0 comments

The New 'Bootstrap' to the American Dream: Deep Cleaning Cars

https://www.wsj.com/business/entrepreneurship/why-some-workers-are-trading-desks-for-car-detailin...
2•JumpCrisscross•51m ago•0 comments

Europe's new climate in seven charts

https://www.bbc.com/news/articles/c8e2j0j87reo
3•saikatsg•51m ago•0 comments

Scientist who cleaned space toilet on work now leading Mars exploration

https://www.bbc.com/news/articles/cz758x04g83o
4•saikatsg•52m ago•0 comments

U.S. Policies Unintentionally Accelerated China's Open AI Ecosystems

https://arxiv.org/abs/2606.15999
3•hunglee2•1h ago•0 comments

I wanted to be Anthony Bourdain–until I met him

https://cailey.substack.com/p/i-wanted-to-be-anthony-bourdainuntil
6•FinnLobsien•1h ago•2 comments

Comparing Investment Options with Charts – The Basics

https://finbodhi.com/docs/blog/compare-charts/
3•ciju•1h ago•0 comments

What Is Linux Swap, and Should You Enable It?

https://blog.lyc8503.net/post/21-swap-setup/
2•uneven9434•1h ago•0 comments

Update: ZerfAI generated 60 Micro SaaS ideas – 14 scored 8/10 or higher

https://www.zerfai.com/
1•awsaqh•1h ago•0 comments

Ask HN: Good fast IDE for reading and navigating code in multiple languages

1•akkad33•1h ago•1 comments

Show HN: Self-healing review gate and knowledge base for Claude Code (Beta)

https://verity.md
2•claudiacsf•1h ago•0 comments

"Gauging your humanity This may take some seconds"

https://github.com/unt-libraries/django-altcha-middleware
1•joebig•1h ago•0 comments