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

First look at Pan Am plane wreckage after 73 years

https://www.bbc.com/news/videos/cx25pp3r61xo
1•sizzle•1m ago•0 comments

How it were are You

1•sheerun•3m ago•0 comments

Rare documents signed by Lincoln removed from D.C. memorial after heat exposure

https://www.washingtonpost.com/dc-md-va/2026/07/15/rare-documents-be-removed-lincoln-memorial-aft...
1•gnabgib•3m ago•0 comments

Politician reads AI prompt during assembly [video]

https://www.youtube.com/watch?v=wlYa8NV5k-U
2•lr0•5m ago•0 comments

Pixar lays off over 100 Bay Area workers using ElastiGirl letterhead

https://www.sfgate.com/tech/article/pixar-mrs-incredible-layoffs-22357876.php
2•toomanyrichies•5m ago•0 comments

Whose freedom is it anyway?

https://collectivefutures.blog/whose-freedom-is-it-anyway/
1•cdrnsf•5m ago•0 comments

Do I need to charge my toothbrush via my monitor?

https://beller-it.de/blog/20260724-charge-my-toothbrush-via-my-display.html
1•mads_quist•6m ago•0 comments

The new rules of context engineering for Claude 5 generation models

https://claude.com/blog/the-new-rules-of-context-engineering-for-claude-5-generation-models
1•opwizardx•6m ago•0 comments

Country went 100% electric vehicles overnight with a drastic approach

https://electrek.co/2026/07/22/laos-bans-gas-diesel-car-imports-ev/
3•sudenmorsian•6m ago•0 comments

Freenet – Services Without Servers [video]

https://www.youtube.com/watch?v=3RBNboYUlVI
1•ciefa•7m ago•0 comments

Chrome's Breaking and Entering

https://unsung.aresluna.org/chromes-breaking-and-entering/
1•ingve•7m ago•0 comments

New North Korean campaign uses fake coding interviews to steal dev credentials

https://www.elastic.co/security-labs/contagious-interview-malware-svg-steganography
2•bmorelli25•7m ago•0 comments

Light Flip Phone

https://www.thelightphone.com/lightflip
1•catchmeifyoucan•9m ago•1 comments

When is an apology not an apology? From an AI boss with a rogue chatbot

https://www.theguardian.com/commentisfree/2026/jul/24/apology-ai-boss-sam-altman-rogue-openai-sta...
1•shadow28•9m ago•0 comments

What syscall-layer tooling cannot see in P2P infrastructure

https://nullrabbit.ai/research/why-syscall-tooling-cannot-see-p2p-infrastructure
1•simonmorley•10m ago•0 comments

Elements of Style Skill (Strunk and White)

https://github.com/obra/the-elements-of-style
1•jrm-veris•12m ago•0 comments

Show HN:LoongForge - High-performance training system for embodied models

https://github.com/baidu-baige/LoongForge/tree/master/loongforge/embodied
1•mindzzz•13m ago•0 comments

Strategy Letter V: Commoditize Your Complements (2002)

https://www.joelonsoftware.com/2002/06/12/strategy-letter-v/
1•louiereederson•14m ago•0 comments

Opus 5 is currently #1 on Artificial Analysis Intelligence Leaderboard

https://artificialanalysis.ai/models
2•aarondong•14m ago•2 comments

Work Is Just Other People

https://yusufaytas.com/work-is-just-other-people
5•yusufaytas•15m ago•0 comments

GitHub PR Creation Down

https://www.githubstatus.com/incidents/jxd617hfwfq8
9•xgvyxia•16m ago•1 comments

The Vision Air Announcement

https://jordan.roher.me/blog/2026/the-vision-air-announcement/
1•jordanroher•16m ago•0 comments

Claude Opus 4.8 can be 10x faster than OpenAI GPT-5

https://www.peterbe.com/plog/claude-opus-is-10x-faster-than-openai-gpt-5-at-non-streaming-complet...
1•peterbe•17m ago•0 comments

GitHub – makerspet/oomwoo: Open-source vacuum robot cleaner

https://github.com/makerspet/oomwoo
2•bilsbie•18m ago•0 comments

Grok 4.5 dropped cache price per 1M tokens from 0.50 to 0.30

https://twitter.com/TimoteiMolnar/status/2080738447418065374
1•timoteimolnar•20m ago•2 comments

Show HN: VinvAI – Ties runtime trace to code segment, prevents reward hacking

https://github.com/VinvAI/VinvAI
2•itsAnshul•20m ago•0 comments

Show HN: Scala Tutorials – interactive Scala 3 lessons in the browser

https://scalatutorials.com
2•eranation•21m ago•1 comments

Show HN: TripVerdict, in 90 SEC know whether your next trip fits the budget

https://www.tripverdict.ca
1•Yadi2508•22m ago•0 comments

Why Europa's hidden ocean may be more difficult to reach than scientists thought

https://phys.org/news/2026-07-europa-hidden-ocean-difficult-scientists.html
1•mikalauskas•26m ago•0 comments

Recreate BART Lines from Memory

https://nalinplad.github.io/draw_bart/
2•notmysql_•26m ago•0 comments