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

How to measure the performance of a quantum computer

https://www.ibm.com/quantum/blog/hardware-metrics-2026
1•mrkO99•3m ago•0 comments

Show HN: SmokeVPN – All-in-One WireGuard VPN Hub – Switch Exits in Realtime

https://smokevpn.com
3•lobito25•10m ago•0 comments

Why Journalism Matters to Democracy (2025)

https://cjmd.com.uw.edu/why-journalism-matters-to-democracy/
2•1659447091•11m ago•0 comments

Texas bans THC cannabinoids except delta-9, except edibles and drinks

https://www.khou.com/article/news/local/texas/texas-thc-ban-2026-delta-8-delta-10-hemp-products-l...
2•burnt-resistor•11m ago•0 comments

A Safe Path to Open Weights

https://thinkingmachines.ai/blog/a-safe-path-to-open-weights/
2•stokedmartin•20m ago•0 comments

Readable ad-hoc commands agent skill

https://github.com/a-b/readable-ad-hoc-commands
1•a-b•21m ago•0 comments

How to Exist

https://www.raptitude.com/2026/07/how-to-exist/
4•walterbell•22m ago•0 comments

US Treasury undertakes historic intervention in yen market

https://www.ft.com/content/0f9b2fe7-bde4-4f5f-b49e-93ccb5da9ea8
4•petethomas•28m ago•1 comments

Random Thoughts of Lineage and Death

1•kooi•31m ago•0 comments

Global temperature changes from 12,000 weather stations (1850-2026)

https://github.com/reflex-dev/xy/discussions/419
7•palashawas•34m ago•0 comments

The Red-Hot Book at the Center of an AI Mystery

https://www.wsj.com/business/media/the-red-hot-book-at-the-center-of-an-ai-mystery-201c4665
2•petethomas•37m ago•0 comments

Hacker uses DeepSeek AI to autonomously attack vulnerable servers

https://www.bleepingcomputer.com/news/security/hacker-uses-deepseek-ai-to-autonomously-attack-vul...
4•sbulaev•40m ago•0 comments

Ask HN: What did you learn last month? (July 2026)

2•bhu1st•40m ago•1 comments

Can I vibe code it?

https://canivibecodeit.com/
4•kamphey•41m ago•2 comments

Hunk – Review-first terminal diff viewer for agentic coders

https://www.hunk.dev/
1•chrkl•42m ago•0 comments

Cyberattack on water systems in multiple states has US officials on edge

https://www.cnn.com/2026/07/31/politics/sweeping-cyberattack-us-water-systems
6•Teever•52m ago•1 comments

Dfs-Large1: New Frontier for Cybersecurity

https://depthfirst.com/research/dfs-large-new-model-release
14•iqster•52m ago•2 comments

Rogue AI hacking incidents amplify debate over open-source tech

https://thehill.com/policy/technology/6003142-nvidia-launches-secure-ai-alliance/
3•petethomas•52m ago•0 comments

I made a free web app that prevents your screen from turning off automatically

https://keepscreenon.vercel.app
2•Adam-Hincu•52m ago•1 comments

China's Xi urges military to step up use of unmanned AI technologies

https://www.bloomberg.com/news/articles/2026-07-31/xi-urges-military-to-step-up-use-of-unmanned-a...
5•thoughtpeddler•53m ago•0 comments

Privilege Escalation in AWS Elastic Kubernetes Service (2023)

https://blog.calif.io/p/privilege-escalation-in-eks
2•882542F3884314B•54m ago•0 comments

Claude-Fleet

https://github.com/Shubhamgupta2612/claude-fleet
2•Shubham2612•58m ago•0 comments

Is Stripe the Internet?

2•Taikhoom2010•59m ago•0 comments

Tesla Weighs Sale of China Business to Pave Way for Potential SpaceX Merger

https://www.wsj.com/business/autos/tesla-weighs-sale-of-china-business-to-pave-way-for-potential-...
3•jnord•1h ago•1 comments

The most famous brand in physical security got pwned by ShinyHunters

https://www.theregister.com/security/2026/07/31/the-most-famous-brand-in-physical-security-got-pw...
6•Bender•1h ago•0 comments

The Major Labels Propose Rules to Keep AI Slop Off the Charts

https://www.ifpi.org/ifpi-rolls-out-global-principles-for-the-eligibility-of-recordings-developed...
4•m463•1h ago•0 comments

Airport sign fails to boot, officers on the scene

https://www.theregister.com/offbeat/2026/07/31/airport-sign-fails-to-boot-officers-already-on-the...
4•Bender•1h ago•0 comments

Flux9s: A K9s-inspired terminal UI for Flux and GitOps state

https://flux9s.ca/
2•bradpenney•1h ago•0 comments

That Viral Photo of San Francisco NIMBYs Shows Why Housing Is Winning

https://inpractice.yimbyaction.org/p/that-viral-photo-of-san-francisco
16•pumpkin88•1h ago•5 comments

Coldcard generated predictable wallet seeds for five years

https://coldcard-hack.up.railway.app/
4•madars•1h ago•0 comments