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.

I made my local GitHub Copilot by myself

https://github.com/just-not-google/BiNeuron
1•waratecs123•29s ago•0 comments

Cavecode – why input many token when few do trick (upto ~80% input tokens saved)

https://github.com/Grimm67123/cavecode
1•newacc321•40s ago•1 comments

Making JupyterLab's visual regression tests delightful to work with

https://openteams.com/engineering-blog/visual-regression-testing-jupyterlab/
1•redsquirrel12•1m ago•1 comments

Feature Visualization – How neural networks build understanding of images (2017)

https://distill.pub/2017/feature-visualization/
1•peter_d_sherman•1m ago•0 comments

The Slow Formation of Durable Software

https://newsletter.dancohen.org/archive/the-slow-formation-of-durable-software/
1•arbesman•2m ago•0 comments

Why the AI Vulnpocalypse Isn't the Breachpocalypse

https://medium.com/@TalBeerySec/why-the-vulnpocalypse-isnt-the-breachpocalypse-yet-it-s-the-econo...
1•el_duderino•2m ago•0 comments

If you're looking, here's a "good deal" for NASA and the European Space Agency

https://arstechnica.com/space/2026/10/nasa-is-keen-on-pursuing-at-least-one-joint-science-mission...
1•rbanffy•3m ago•0 comments

Moefit: Fit Qwen 3.8 Flash on your Mac with limited ram

https://github.com/yavarb/moefit
1•ybathaee•5m ago•0 comments

Tracking Singularity

https://trackingsingularity.com/
1•tosh•6m ago•0 comments

Using light-dark() without getting caught out

https://www.tempertemper.net/blog/using-light-dark-without-getting-caught-out
1•surprisetalk•9m ago•0 comments

HashBack – Server-to-Server Authentication without secret keys or tokens

https://www.hashback.dev/
2•billpg•12m ago•0 comments

Simple, rotationally symmetric Venn diagrams exist for 17, 19 and 23 curves

https://twitter.com/ChrisDzoba/status/2107785499268247681
1•zoba•12m ago•0 comments

Show HN: Schema – Visual Git Diffs for Postgres, MySQL and SQLite Schemas

https://github.com/dobrinov/schema
2•dobrinov•12m ago•0 comments

Show HN: Engineering judgment in AI-assisted development [video]

https://www.youtube.com/watch?v=oMd9R_8O6uY
3•Harish_0089•15m ago•0 comments

A stack that fits your project, and keeps fitting as it changes

https://manifestack.com/
2•yuxt•15m ago•0 comments

Doom on the Vectrex Turns the Classic Shooter into Tron-Like Vector Art

https://www.engadget.com/2279239/doom-on-the-vectrex-turns-the-classic-shooter-into-tron-like-vec...
1•adunk•16m ago•0 comments

Show HN: Monolith / an engine-building game about software startups

https://monolithgame.app/
1•chancelloradams•16m ago•0 comments

Can AI Make a Game Engine? [video]

https://www.youtube.com/watch?v=R_uf5OfMGio
1•poly2it•17m ago•0 comments

Loose opinions on future of software, developers and corporations

https://www.akashtandon.in/technology/2026-10-05-loose-opinions-on-software/
1•akashtndn•18m ago•0 comments

Unity Spark

https://unity.com/spark
1•ilreb•18m ago•1 comments

Show HN: Nimblegate – stop Claude Code and Codex pushing leaked API keys

https://github.com/nimblegate/nimblegate
2•nimblegate•19m ago•0 comments

Show HN: Cai:218x fewer tokens than Graphify, 2976x than raw files

https://daidocs.com/results-code.html
1•Amin_Rigi•20m ago•0 comments

Cosmic shuts the door on AI code as GNOME debates letting bug reports in

https://www.theregister.com/software/2026/10/07/cosmic-shuts-the-door-on-ai-code-as-gnome-debates...
2•sbulaev•21m ago•0 comments

Show HN: BuildABrowser – Rendering Engine with CSS Grid, Passes Acid2, in Java

https://github.com/BuildABrowser/BuildABrowser
1•everyos_•22m ago•1 comments

Pharmacological Activation of AMPK Extends Lifespan in Yeast, Worms and Flies

https://onlinelibrary.wiley.com/doi/10.1111/acel.70721
1•geox•22m ago•0 comments

JPEG-XL code golf art gallery

https://jpegxl.info/old/art/
2•gcr•22m ago•0 comments

Show HN: Open-source demo of a wallet punch card that updates itself

https://punchline.passmint.com/
1•alexpate•22m ago•0 comments

Claude for Google Workspace public beta

https://claude.com/resources/articles/claude-now-works-in-google-docs-sheets-and-slides
2•dieortin•23m ago•0 comments

Microbenchmarks in the Age of Clankers

https://mrale.ph/blog/2026-10-06-microbenchmarks-in-the-age-of-clankers.html
1•ingve•23m ago•0 comments

Write Like It's 1866: LLMs Relearn Telegraphese

https://fiveminutesforward.com/post/2026-10-04-telegraph-test/
2•Theory42•24m ago•0 comments