frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: Declarative vs. Imperative

2•KenPainter•2h ago
I started hacking with TRS-80 Basic long ago. By the time I went pro in my early 20's, I had already developed a strong preference for declarative systems, so much so that I would from time to time create one if it made the solution at hand more robust. Having studied Physics instead of CompSci, I came to this preference outside of any knowledge of the existing arguments for/against or the vocabulary used in the literature. For me it was a simple process: discern common patterns in the imperative code, establish a data structure that captured them, write something to process them.

The commercial motivation was always the correctness guarantee, but the yak-shaving exercise of building the system offered the satisfaction that purely commercial concerns could not provide.

Now, in the dawn of the age of LLM coding, I find the agents are "unreasonably effective" at coding to declarative systems. The entire reference for the data format or DSL can fit in context, and LLMs are naturally more reliable against a constrained system. Compare to CSS, highly unconstrained, where I find code duplication, then conflict, then the inevitable `!important` flags begin to proliferate.

Yet, as anybody who enjoys the benefits of declarative systems will tell you, it can be lonely. The world prefers a general purpose imperative system. I believe the biggest reason is that the open-ended imperative system does not force us into a mapping exercise before we get to work. The code is like a whiteboard, where ideas are tried and modified in flight.

But I'd like to hear from others. Which do you prefer and why? In what situations?

Ask HN: What job boards are good these days?

4•phendrenad2•52m ago•3 comments

Ask HN: Which harness do you use with Qwen3.8 27B? And why?

2•grigio•1h ago•3 comments

Ask HN: Declarative vs. Imperative

2•KenPainter•2h ago•0 comments

LinkedIn is a terrible quality website

5•skyfantom•36m ago•2 comments

Anyone using a Wispr Flow alternative that is non-cloud?

18•itsjeremiahs•15h ago•16 comments

Ask HN: How do GitHub Copilot and Anthropic Claude compare in cost?

3•erwindegroot•6h ago•2 comments

Tell HN: Substack obfuscating text to break reading mode

12•xnx•20h ago•2 comments

Ask HN: Is it impossible to disable Siri on macOS 27?

151•semidror•2d ago•83 comments

Porting a clearing-house money market to a smart contract

3•citizensinan•7h ago•0 comments

Ask HN: When is fine-tuning a small LLM worth it?

8•kooldeep7•18h ago•11 comments

Ask HN: Which is cheaper: ChatGPT tokens or a 2nd Pro 20x subscription?

3•yesitcan•21h ago•3 comments

When Claude CLI asks for feedback, responding authorizes conversation capture

22•mmaunder•2d ago•2 comments

Ask HN: How do your teams share and distribute agent skills?

3•juanviera23•22h ago•2 comments

Tell HN: Firefox's default browser check dark pattern triggers Windows BSOD

5•xeonmc•23h ago•1 comments

Ask HN: How to recover Google auth after phone stolen?

121•keymasta•5d ago•130 comments

Ask HN: Why does it matter if no one reads your novel as long as the AIs do?

10•amichail•1d ago•27 comments

Ask HN: How do you interview devs in a post-AI world?

46•mdwelsh•3d ago•39 comments

Is Claude 20x actually 20x?

6•ko3us•1d ago•3 comments

Ask HN: Dead Internet

15•basilikum•1d ago•11 comments

Ask HN: Ideas for getting more GitHub stars?

3•NatalieTrono•19h ago•3 comments

Ask HN: Remember N8n? Anyone?

15•sankalpdomore•4d ago•10 comments

Ask HN: What do you expect from the next 5 years of AI?

8•msuniverse2026•1d ago•19 comments

Neovim have a ~$800k Bitcoin donation sitting untouched since 2023

318•jakemanger•6d ago•275 comments

You've reached the end!