frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: Which function definition keyword do you prefer, def or fn?

1•winwang•1y ago
I'm curious about what people think of `def` vs `fn`, two short keywords for starting function definitions.

...Or maybe we should subscribe to the church of `df`, haha.

Comments

sitkack•1y ago
def could be for lots of things, fn is for functions. I don't think it matters much as long as you have one. C would have been so much easier to parse. Just copy Zig or Rust.
butlersean•1y ago
def means define, could be used to define all kinds of things

fn isnt a legitimate short form of function

fun doesnt work because of the amusement factor

func is the only alternative we have left

sitkack•1y ago
How about unicode or emojis?

These don't have the full fidelity as hn scrubs emojis

add = (a, b) -> a + b

a, b ⟹ a + b

λ add(a, b): ↪ a + b

johncoltrane•1y ago
"def" is too generic.

"fn" is too cryptic.

"function" is better than the two.

MultifokalHirn•1y ago
Agreed

Why does Britain keep changing prime ministers?

https://www.ft.com/content/cd15556f-8f52-4b7a-8af9-578fdbbaa9c6
1•JumpCrisscross•39s ago•0 comments

Japanese symbols that speak without words

https://arun.is/blog/japan-symbols/
1•msephton•1m ago•0 comments

British Columbia, Time Zones, and Postgres

https://www.crunchydata.com/blog/british-columbia-and-time-zone-changes
1•sprawl_•2m ago•0 comments

Optocam Zero: a Pi Zero based digital camera made using off the shelf components

https://github.com/dorukkumkumoglu/optocamzero
1•iamnothere•3m ago•0 comments

Can You Pass the Test That Strikes Fear into China's High-Schoolers?

https://www.wsj.com/world/china/chinese-gaokao-test-quiz-c38937db
1•bookofjoe•5m ago•1 comments

ReleaseBytes – Central feed for tracking Platform releases

https://releasebytes.com/
1•shadowmonk•5m ago•0 comments

ClawHub's 23 plugins squat the official @openclaw and @clawhub scopes

https://www.manifold.security/blog/scope-squatting-clawhub-plugins
1•axsharma•7m ago•0 comments

Claude: Elevated errors across many models

https://status.claude.com/incidents/bbcpk0t2cj4p
1•forks•7m ago•0 comments

Why American data centers can't plug in

https://worksinprogress.co/issue/why-american-data-centers-cant-plug-in/
1•speckx•8m ago•0 comments

Adaptive speculative decoding: picking draft lengths at runtime

https://fergusfinn.com/blog/adaptive-speculation/
1•hasheddan•8m ago•0 comments

Flock-Powered Police Chiefs Stalking Women Shows Why Warrants Are Needed

https://ipvm.com/reports/police-chiefs-track
7•jhonovich•10m ago•0 comments

The Theoretical Limit of Image Compression [video]

https://www.youtube.com/watch?v=W39hBPOk9Hk
1•eln1•10m ago•0 comments

Sovereign AI: Why Owning the Full Stack Is the New Strategic Imperative

https://www.forbes.com/sites/chuckbrooks/2026/04/22/sovereign-ai-why-owning-the-full-stack-is-the...
1•zzzeek•11m ago•1 comments

One Year with Codeberg

https://guix.gnu.org/blog/2026/one-year-with-codeberg//
2•iamnothere•11m ago•0 comments

OpenAI Codex has a bug that could kill your SSD in under a year

https://www.notebookcheck.net/OpenAI-Codex-has-a-bug-that-could-kill-your-SSD-in-under-a-year.132...
4•abixb•12m ago•0 comments

Canada is looking to build up to 10 new nuclear reactors over the next 15 years

https://www.cbc.ca/news/politics/federal-nuclear-strategy-9.7244509
5•geox•17m ago•0 comments

Ratchets Run Faster with Resharp

https://danverbraganza.com/writings/ratchets-run-faster-with-resharp
1•nvader•17m ago•0 comments

FFmpegKit, revived – a maintained Android build after the original was retired

https://github.com/ffmpegkit-maintained/ffmpeg-kit
3•FFmpegKit•17m ago•0 comments

The art of the swarm: Systemic rivalry with China on European terms

https://ecfr.eu/publication/the-art-of-the-swarm-systemic-rivalry-with-china-on-european-terms/
1•simonebrunozzi•18m ago•0 comments

Memory crisis is getting so bad that even retro RAM prices are going to the Moon

https://www.theregister.com/personal-tech/2026/06/22/the-memory-crisis-is-getting-so-bad-that-eve...
4•speckx•19m ago•0 comments

A self-hosted auditor that tells you if your portfolio thesis still holds

https://daniwave313.gumroad.com/l/tlghil
1•dgomloz•19m ago•0 comments

Paradise Revisited: What Darwin Saw in the Galápagos

https://www.theatlantic.com/magazine/2026/08/writers-way-galapagos-charles-darwin-travel/687480/
2•lbeckman314•24m ago•1 comments

Blobly

https://blobly.medv.io/
2•medv•25m ago•0 comments

Kafka's Broken Promise: There Is No Goldilocks Log

https://www.opendata.dev/blog/announcing-opendata-log/
4•apurvamehta•26m ago•0 comments

Show HN: Making a new video game every day (Day 69: Hot Death Zero)

https://freepocketgames.com/69-hot-death-zero
2•pzxc•26m ago•0 comments

Ask HN: How to manage AI spam in inbox?

1•bmau5•27m ago•0 comments

Company Brain – Open-Source

https://github.com/KubaKoobz/sotu-copilot
1•kuba87•28m ago•0 comments

Doorbell cam filmed Tesla Autopilot crash that killed woman in her home

https://arstechnica.com/tech-policy/2026/06/woman-killed-when-tesla-driver-using-autopilot-crashe...
1•speckx•29m ago•0 comments

Little Alchemy 2

https://www.crazygames.com/game/little-alchemy-2
2•thunderbong•31m ago•0 comments

A Dark Dimension Could Link Two of the Universe's Great Unknowns

https://www.quantamagazine.org/a-dark-dimension-could-link-two-of-the-universes-great-unknowns-20...
1•pavel_lishin•31m ago•0 comments