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.

China companies Z.Ai,China 360 claim having cybersec AI models to match Mythos

https://www.reuters.com/legal/litigation/chinas-360-says-it-has-developed-tools-match-anthropics-...
1•king_zee•58s ago•0 comments

Pyrite64: N64 game-engine and editor using Libdragon and tiny3d

https://github.com/HailToDodongo/pyrite64
1•poly2it•10m ago•0 comments

Pi is the wrong circle constant

https://www.tauday.com/
2•Foskya•10m ago•0 comments

Ask HN: Impact on LLM development after the USA policy of preliminary vetting

2•mdp2021•13m ago•0 comments

Greece Is Richer. So Why Do So Many Greeks Still Feel Poor?

https://www.dnews.gr/eidhseis/news-in-english/596650/greece-is-richer-so-why-do-so-many-greeks-st...
1•theanonymousone•30m ago•0 comments

Show HN: Custom domain emails for open source projects (KaiMail)

https://kaimail.net/
1•iqbalabd•30m ago•0 comments

Revenue at Risk from AI Displacement

https://zenodo.org/records/20999945
1•tas101•31m ago•0 comments

Show HN: Nomina – Single Binary DNS and Nameserver with WebUI for Homelabs

3•sylwester•32m ago•0 comments

The origins of the school system aimed to produce independent, critical thinkers

https://www.cbc.ca/radio/ideas/humboldt-education-system-bildung-1.7172093
9•pseudolus•33m ago•5 comments

FizzBuzz in Smalltalk

https://donraab.medium.com/fizzbuzz-in-smalltalk-8c6b7cdb6c41
4•ingve•33m ago•0 comments

These Are the Most Beautiful Equations, According to Mathematicians

https://www.scientificamerican.com/article/these-are-the-most-beautiful-equations-in-mathematics/
1•jruohonen•34m ago•2 comments

Ask HN: You have one year to make $1M. What's your plan?

6•vantareed•37m ago•1 comments

Pollen tried to remove my article, and Google is assisting to it

https://blog.pragmaticengineer.com/pollen-tried-to-remove-my-article-about-callum-negus-fancey-an...
3•ingve•37m ago•0 comments

Show HN: O11y.jobs is a job board focused specifically on Observability

https://o11y.jobs/
2•ScarZy•39m ago•0 comments

How VictoriaLogs Stores Your Logs in a Columnar Layout

https://victoriametrics.com/blog/victorialogs-internals-columnar-storage-on-disk/index.html
4•eatonphil•42m ago•0 comments

The curious case of the disappearing Polish S

https://aresluna.org/the-curious-case-of-the-disappearing-polish-s/
1•colinprince•44m ago•0 comments

Three.js R185 Released

https://twitter.com/threejs/status/2070082345689067978
3•aurenvale•47m ago•0 comments

The MUMPS 76 Primer – anniversary edition

https://github.com/rochus-keller/MUMPS/blob/main/docs/MUMPS_Primer.adoc
3•Rochus•47m ago•1 comments

Trump Cut a Billion-Dollar Mining Deal. His Sons Stand to Profit

https://www.nytimes.com/2026/06/28/world/europe/trump-lutnick-sons-kazakhstan.html
7•tcp_handshaker•50m ago•0 comments

After the AI Hype – What's Real, and What's Next – Richard Campbell – 2026

https://www.youtube.com/watch?v=uWnUnMphmPM
1•tcp_handshaker•50m ago•0 comments

Academic-writing kit for Claude Code

https://github.com/josefslerka/study-kit
4•josefslerka•52m ago•0 comments

Show HN: Meta Ads vs. ASA vs. GAC for indie apps (2026 data)

https://launchshots.app/blog/meta-ads-app-install-2026
3•okutan•57m ago•0 comments

The Scaling of PEFT: Towards Million Personal Models of Trillion Parameters

https://arxiv.org/abs/2606.02437
1•Anon84•58m ago•0 comments

A way to exclude sensitive files issue still open for OpenAI Codex

https://github.com/openai/codex/issues/2847
23•pikseladam•1h ago•17 comments

Starbucks Is One of the Largest Banks

https://www.msn.com/en-us/money/companies/starbucks-is-secretly-one-of-the-world-s-largest-banks/...
2•ColinWright•1h ago•0 comments

Guy in his basement creates a drug to treat Alzheimer's disease using AI

https://twitter.com/DouglasYaoDY/status/2070904914050797582
18•binyu•1h ago•20 comments

NASA tests AI medic for astronauts too far from Earth to call a doctor

https://www.theregister.com/ai-and-ml/2026/06/27/nasa-tests-ai-medic-for-astronauts-too-far-from-...
3•LorenDB•1h ago•0 comments

Show HN: Sambee – browser-based file manager for SMB shares and local drives

https://sambee.net
2•helgek•1h ago•0 comments

Warp Point: A curated webring of video game websites

https://www.warppoint.games/
2•mysterydip•1h ago•0 comments

The crowd-funded Porsche 911

https://project996.fun
2•mhavelka77•1h ago•3 comments