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.

Show HN: Ghosted – Direct-source tech and US federal job index, purged daily

https://ghosted2.com/
1•martinwong94•15s ago•0 comments

Show HN: Glass MCP 2.0, with headless support for all platforms

https://github.com/fixed-width/glass
1•mpd•22s ago•0 comments

Teardown of the revised Switch 2 reveals how easy battery swaps will be for some

https://www.theverge.com/tech/1046647/ifixit-nintendo-switch-2-joy-con-teardown-battery-swap
1•nopakos•28s ago•0 comments

How Villagers "Read" Your Letters in Animal Crossing (2024) [video]

https://www.youtube.com/watch?v=8VbwWVvw-zI
1•minimaxir•44s ago•0 comments

Show HN: Doom in Slack

https://github.com/hacksore/doom-in-slack
1•hacksore•53s ago•0 comments

By the end of 2027, the best software teams will stop reading their code

https://medium.com/@NMitchem/the-best-software-teams-will-stop-reading-code-by-2027-73d60e937e71
1•Mitchem•3m ago•0 comments

Tidal Bans AI Songs

https://pitchfork.com/story/tidal-bans-ai-songs/
1•speckx•4m ago•0 comments

Apple is not able to automatically add a link to its EULA

https://maxmannstein.com/blog/where-to-put-the-eula-for-ios-apps-implementing-subscriptions
1•kandu•4m ago•1 comments

I Wanted to Replace Myself Before AI Did

https://tmap.tools/blog/replace-myself-first/
1•JoeyZzZzZz•4m ago•1 comments

Word of the Year: Hyperspecialization

https://indieweb.social/@elgg/117695957438554453
1•vinceleo•4m ago•0 comments

Coding with AI Is Harder, Actually

https://gist.github.com/slezica/828f6ac761374f57a743be4dd9d4c9a7
2•slezica•7m ago•0 comments

Bitcoin not delivering: digital asset veteran questions BTC's value

https://www.coindesk.com/markets/2026/11/28/bitcoin-not-delivering-the-bear-market-has-digital-as...
1•PaulHoule•8m ago•0 comments

A Visual Guide to Agent Harnesses

https://newsletter.maartengrootendorst.com/p/a-visual-guide-to-agent-harnesses
2•mariuz•8m ago•0 comments

Software's Industrial Revolution

https://arcentry.com/blog/softwares-industrial-revolution/
2•wolframhempel•9m ago•0 comments

NoMachine Personal Edition for Windows: the security incident

https://kb.nomachine.com/AR11X01397
2•derektank•10m ago•0 comments

JetBrains raises IDE prices starting February 2027

https://www.jetbrains.com/store/
5•burgerboii•11m ago•6 comments

Show HN: CDX Code Booster – Cut Claude Code and Cursor Token Burn via AST/MCP

https://cdxengine.com/booster_en
1•cantorlabs•11m ago•0 comments

Show HN: A browser for deep work. Block distractions without a way to unblock

https://github.com/mast-browser/mast
2•mikiyas•11m ago•1 comments

DC hospitality businesses use Kalshi to hedge/bet on government shutdown

https://www.axios.com/local/washington-dc/2026/11/30/dc-businesses-kalshi-bet-government-shutdown
1•ryan_j_naughton•11m ago•0 comments

Ask HN: Microsoft Safe Links Resolution

1•Dachande663•12m ago•0 comments

JetBrains Subscription Prices Will Increase on February 1, 2027

https://blog.jetbrains.com/blog/2026/11/30/jetbrains-subscription-prices-will-increase-on-februar...
4•andyexeter•12m ago•1 comments

The Untamed Type

https://ringailedemsyte.com/the-untamed-type
2•ohjeez•15m ago•0 comments

Tech Lost Its Dream Job Status

https://exaltitude.substack.com/p/why-fun-tech-jobs-went-extinct
4•ra0x3•16m ago•0 comments

Making Something Last (8 years)

https://lureinperera.com/post/making-something-last-8
2•lurein•17m ago•0 comments

The extended Riemann Hypothesis for real fields

https://github.com/AxiomMath/erh-totally-real
2•jalev•17m ago•1 comments

Ask HN: What would make ads on a web site more tolerable?

2•psion•20m ago•3 comments

Who Profits When Healthcare Costs Rise [video]

https://www.youtube.com/watch?v=iVQHJhaO_dY
2•motte•21m ago•1 comments

Americans Don't Like Being Told What to Think

https://www.wakeuptopolitics.com/p/americans-dont-like-being-told-what
16•rurp•23m ago•14 comments

The two missing capabilities of frontier AI

https://twitter.com/jmugan/status/2127439631394160670
1•jmugan•23m ago•0 comments

Church of Nahal – An AI Monastery

https://nahal.church/
1•ChilledTonic•24m ago•0 comments