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

Disable autoplay and infinite scroll or risk fines, EU tells Meta

https://arstechnica.com/tech-policy/2026/07/disable-auto-play-and-infinite-scroll-or-risk-massive...
1•OptionOfT•12s ago•0 comments

I Think I Know How to Solve the Video Game Industry's Problems

https://ggtribune.com/2026/07/10/opinion-i-think-i-know-how-to-solve-the-video-game-industrys-pro...
1•qdot76367•36s ago•0 comments

MagicView Advertising for Startups

https://www.magicview.com/
1•wesley-zheng•44s ago•0 comments

The Road to Housing Act Might Pass

https://inpractice.yimbyaction.org/p/the-road-to-housing-act-might-actually
1•viajante1882•2m ago•0 comments

China recaptures the first stage of a rocket to reuse it

https://phys.org/news/2026-07-china-page-spacex-recaptures-stage.html
1•miohtama•3m ago•0 comments

Dangerzone: Convert potentially dangerous documents into safe PDFs

https://dangerzone.rocks/
1•Cider9986•3m ago•0 comments

PQC Readiness and Migration Tool

https://postq.dev
1•PallabPaul•4m ago•0 comments

The Difference Between Watercolor and Gouache Paints

https://www.jetpens.com/blog/The-Difference-Between-Watercolor-and-Gouache-Paints/pt/963
2•ynac•4m ago•0 comments

Big Tech Doubles Debt Load to $350B in AI Spending Spree

https://www.bloomberg.com/news/articles/2026-07-10/big-tech-doubles-debt-load-to-350-billion-in-a...
1•thm•4m ago•0 comments

Hackachu: Building Pokémon-inspired games to earn hardware

https://hackachu.hackclub.com/
1•Plastuchino•5m ago•0 comments

Blood Cell 'Nurseries' Upend Understanding of Human Physiology

https://news.feinberg.northwestern.edu/2026/07/02/blood-cell-nurseries-upend-understanding-of-hum...
1•gmays•7m ago•0 comments

How to Read Scientific Papers (Or Give Good Dating Advice)

https://serenakrejcipapa.substack.com/p/how-to-read-scientific-papers-or
1•herbertl•7m ago•0 comments

Lessons from the UK's first trial scheme for electrical repairs

https://relondon.gov.uk/resources/case-study-north-london-repair-voucher-scheme-lessons-from-the-...
1•DamonHD•7m ago•0 comments

The Joy of Old-School Coding After a Stupid Mistake

https://canro91.github.io/2026/07/04/JoyOfCoding/
1•speckx•9m ago•0 comments

Ethical NBA Championships

https://pudding.cool/2026/06/ethical-champions/
1•colinprince•9m ago•0 comments

The inventor of the outside white stripes on roads

https://www.iflscience.com/one-simple-idea-has-quietly-saved-millions-of-lives-over-the-last-70-y...
1•toss1•9m ago•0 comments

Are Memories Transferable – Or Edible?

https://www.quantamagazine.org/are-memories-transferable-or-edible-20260605/
1•CGMthrowaway•10m ago•0 comments

Kimi 2.7 Code: 1T model with 1000 tokens per second

https://www.lithosai.com/
2•rthng•11m ago•0 comments

Lovable: Connect your app to GitHub API

https://docs.lovable.dev/integrations/github-api
1•doener•14m ago•0 comments

Bringing Nebula connectivity to everyone with free managed lighthouses

https://www.defined.net/blog/announcing-managed-lighthouses/
1•radlad•16m ago•0 comments

Why do mosquitoes bite some people more than others?

https://www.bbc.com/future/article/20260708-why-do-mosquitoes-bite-some-people-more-than-others
2•reconnecting•19m ago•0 comments

Postcard from Paris: joining the party brigade at the Firefighters' Ball

https://www.ft.com/content/bd07af81-e0e9-458d-9b08-7c8837fb18f9
1•coloradoave22•19m ago•0 comments

Migrating from GitLab to Forgejo

https://www.bentasker.co.uk/posts/blog/software-development/migrating-from-gitlab-to-forgejo.html
1•speckx•19m ago•0 comments

The Chud Vision of Roman History

https://acoup.blog/2026/07/10/friday-friday-july-10-2026-on-the-chud-vision-of-roman-history/
1•Tomte•20m ago•0 comments

What Every Python Developer Should Know About the CPython ABI

https://labs.quansight.org/blog/python-abi-abi3t
1•ngoldbaum•22m ago•0 comments

Chatbots Can Go into a Delusional Spiral. Here’s how it happens.

https://www.nytimes.com/2025/08/08/technology/ai-chatbots-delusions-chatgpt.html
1•Anon84•25m ago•0 comments

CatchCat – Pokémon Go for Cats, IRL

https://www.catchcat.lol/
1•marojejian•25m ago•1 comments

The Future of Meta Superintelligence

https://newsletter.semianalysis.com/p/the-future-of-meta-superintelligence
1•shadowtree•25m ago•0 comments

It will be as if it has always been this way

https://utf9k.net/blog/it-will-be-as-if-it-has-always-been-this-way/
1•speckx•25m ago•0 comments

Marketing tool for small businesses test

https://turfmark.vercel.app/
1•Mini_dev•29m ago•0 comments