frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Sj.h: A tiny little JSON parsing library in ~150 lines of C99

https://github.com/rxi/sj.h
55•simonpure•57m ago•11 comments

DXGI debugging: Microsoft put me on a list

https://slugcat.systems/post/25-09-21-dxgi-debugging-microsoft-put-me-on-a-list/
57•todsacerdoti•2h ago•8 comments

The University of Oxford has fallen out of the top three universities in the UK

https://hotminute.co.uk/2025/09/19/oxford-loses-top-3-university-ranking-for-the-first-time/
104•ilamont•1h ago•147 comments

I forced myself to spend a week in Instagram instead of Xcode

https://www.pixelpusher.club/p/i-forced-myself-to-spend-a-week-in
45•wallflower•3h ago•8 comments

LaLiga's Anti-Piracy Crackdown Triggers Widespread Internet Disruptions in Spain

https://reclaimthenet.org/laligas-anti-piracy-crackdown-triggers-widespread-internet-disruptions
87•akyuu•1h ago•23 comments

Disk Utility still can't check and repair APFS volumes and containers (2021)

https://eclecticlight.co/2021/11/19/disk-utility-still-cant-check-and-repair-apfs-volumes-and-con...
69•rahimnathwani•4h ago•28 comments

The link between trauma, drug use, and our search to feel better

https://lithub.com/the-link-between-trauma-drug-use-and-our-search-to-feel-better/
15•PaulHoule•55m ago•6 comments

The Beginner's Textbook for Homomorphic Encryption

https://arxiv.org/abs/2503.05136
21•Qision•3h ago•1 comments

A coin flip by any other name (2023)

https://cgad.ski/blog/a-coin-flip-by-any-other-name.html
14•lawrenceyan•2d ago•0 comments

Spectral Labs releases SGS-1: the first generative model for structured CAD

https://www.spectrallabs.ai/research/SGS-1
270•JumpCrisscross•13h ago•39 comments

iFixit iPhone Air teardown

https://www.ifixit.com/News/113171/iphone-air-teardown
276•zdw•14h ago•145 comments

New thermoelectric cooling breakthrough nearly doubles efficiency

https://www.sciencedaily.com/releases/2025/09/250919085242.htm
67•westurner•2h ago•26 comments

AI was supposed to help juniors shine. why does it mostly make seniors stronger?

https://elma.dev/notes/ai-makes-seniors-stronger/
259•elmsec•16h ago•272 comments

Review: Project Xanadu – The Internet That Might Have Been

https://www.astralcodexten.com/p/your-review-project-xanadu-the-internet
26•paulpauper•1h ago•6 comments

How to stop functional programming (2016)

https://brianmckenna.org/blog/howtostopfp
63•thunderbong•2h ago•42 comments

Meta exposé author faces bankruptcy after ban on criticising company

https://www.theguardian.com/technology/2025/sep/21/meta-expose-author-sarah-wynn-williams-faces-b...
339•mindracer•5h ago•236 comments

Ultrasonic Chef's Knife

https://seattleultrasonics.com/
719•hemloc_io•1d ago•584 comments

$2 WeAct Display FS adds a 0.96-inch USB information display to your computer

https://www.cnx-software.com/2025/09/18/2-weact-display-fs-adds-a-0-96-inch-usb-information-displ...
357•smartmic•20h ago•148 comments

Show HN: Freeing GPUs stuck by runaway jobs

https://github.com/kagehq/gpu-kill
4•lexokoh•1h ago•0 comments

Writing a competitive BZip2 encoder in Ada from scratch in a few days – part 3

https://gautiersblog.blogspot.com/2025/09/writing-competitive-bzip2-encoder-in.html
82•etrez•1d ago•5 comments

Extrachromosomal DNA–Driven Oncogene Evolution in Glioblastoma

https://aacrjournals.org/cancerdiscovery/article/doi/10.1158/2159-8290.CD-24-1555/764257/Extrachr...
6•PaulHoule•3h ago•0 comments

Liberté, égalité, Radioactivité

https://worksinprogress.co/issue/liberte-egalite-radioactivite/
11•paulpauper•57m ago•0 comments

UUIDv7 in Postgres 18. With time extraction

https://www.thenile.dev/blog/uuidv7
54•sierikov•3h ago•27 comments

President Trump Signs Technology Prosperity Deal with United Kingdom

https://www.whitehouse.gov/articles/2025/09/president-trump-signs-technology-prosperity-deal-with...
13•donutloop•56m ago•4 comments

Hi No Youjin

https://aethermug.com/posts/hi-no-youjin
16•mrcgnc•3d ago•2 comments

Linux Ready to Upstream Support for Google's PSP Encryption for TCP Connections

https://www.phoronix.com/news/PSP-Encryption-Linux-6.18
24•Bender•1h ago•5 comments

Teardown of Apple 40W dynamic power adapter with 60W max

https://www.chargerlab.com/teardown-of-apple-40w-dynamic-power-adapter-with-60w-max-a3365/
202•givinguflac•3d ago•167 comments

Gluco data handler: Receive and visualize glucose data on Android

https://github.com/pachi81/GlucoDataHandler
22•croemer•3d ago•1 comments

The bloat of edge-case first libraries

https://43081j.com/2025/09/bloat-of-edge-case-libraries
112•PaulHoule•15h ago•126 comments

Why, as a responsible adult, SimCity 2000 hits differently

https://arstechnica.com/gaming/2025/09/thirty-years-later-simcity-2000-hasnt-changed-but-i-have/
152•doppp•3d ago•176 comments
Open in hackernews

How to stop functional programming (2016)

https://brianmckenna.org/blog/howtostopfp
63•thunderbong•2h ago

Comments

skybrian•2h ago
Apparently, someone doesn’t really get what makes functional programming hard to understand? It’s not writing the occasional pure function.

Code review or pair programming might help here, to learn the team’s common idioms.

IshKebab•1h ago
Yeah this 100%. FP isn't hard because of FP - it's all the other things that popular FP languages come with that makes them hard to understand. Arguably most of them are not related to FP; they're just style choices:

1. Global type inference.

2. Implicit syntax (no brackets for function calls, commas to separate arguments, semicolons to end statements/expressions, etc.)

3. Currying & point free style.

4. Tendency to have very deep nested expressions. The gap between `let foo =` and it's actual value can often be hundreds of lines.

I'm sure you can write FP code that avoids these issues and is easy to follow but it doesn't seem like people do that in practice.

Rust avoided all of these issues fortunately.

(Oh I forgot about monads.)

amluto•1h ago
Also: avoidance of mutable state, even locally. A lot of functions can be more straightforwardly expressed using mutable variables and data structures, and most functional languages can handle local mutable state, but a lot of code in functional languages avoids it.

Conversely, a lot of code written in imperative languages would be clearer and/or less bug-prone if it avoided mutable state and used persistent data structures.

I wish there was a mainstream, high performance language that made both styles equally ergonomic.

delta_p_delta_x•54m ago
> I wish there was a mainstream, high performance language that made both styles equally ergonomic.

Unironically, C++.

ndriscoll•44m ago
Or depending on what "high performance" means (e.g. if Java or Go would be considered acceptable), Scala.
Mond_•1m ago
> > I wish there was a mainstream, high performance language that made both styles equally ergonomic.

> Unironically, C++.

At best C++ falls under "equally unergonomic".

Philpax•26m ago
Does Rust not meet that description?
amluto•20m ago
Rust is very good at making things immutable. But that doesn't mean it's particularly fun to, for example, append or prepend something to a list and retain a reference to both the old and the new list.

Compare to most "functional" languages, in which prepending an item to a list and ending up with immutable references to the old and new lists is almost the defining feature of the language.

IshKebab•4m ago
Yeah although I find FP languages' obsession with singly linked lists to be a real flaw because they have such awful performance characteristics. And also pretty bad ergonomics often. The number of times stuff comes out backwards...
jen20•1h ago
Also the unwillingness of so many enterprise developers to learn anything that wasn't commonplace in 2001, regardless of whether they were in the workforce by then.
elevation•43m ago
> I forgot about monads

I've been solving business problems with code for decades. I love pure, composable functions, they make my job easier. So do list comprehensions, and sometimes, map and filter. Currying makes sense.

But for the life of me, no forum post or FP tutorial that I could find explained monads in clear language. I've googled "what is a monad" once a year, only to get the vague idea that you need monads to handle IO.

I wondered if my brain was broken, but now I'm wondering if most FP adherents are simply ineffective communicators: they've got an idea in their head but can't/won't express it in a way that others after them can understand. In other words, the exact same reason why TFAuthor was corrected by his employer.

vjerancrnjak•33m ago
I felt similar with lenses. The problem lens solve is horrible. You don’t even want that problem.

FP can be the pragmatic as well. You’re going to glue up monad transformers, use lenses like there’s no runtime cost, and compute whatever you need in days but at least you know it works. Maybe there’s accidentally quadratic behavior in lifting or lenses but that’s by design. The goal is to just throw software at things as fast as possible as correctly as possible.

eddlgtm•32m ago
Monads are just monoids in the category of endofunctors.

/s

Monads are, in my head, just a wrapper around a type. Or a box another type is inside. For example we can have an Int and we can put the Int in a box like Maybe<Int>.

Imagine Python code that gets a value from a function that is an Int or None, then another function that takes an Int and returns an Int or None, then another function that takes an Int and returns an Int or None. How hellish is that to handle? If not None, if not none, if not none, ad nauseam...

In Haskell I could use a Traverse function that takes a monad and passes the Int value to the next function or handles the None error, avoiding all the boilerplate.

Other Monads are like the State monad - a box that contains some variables I want to maintain over functions.

Or an IO monad to handle network calls / file calls.

It's probably not a perfect analogy, but I work with functional languages and it tends to hold up for my beginner/intermediate level.

ekidd•13m ago
So, one way to understand a monad is that it's essentially a container type with "map" and "flatten" operations. Let's say your monad is type M<T>. The "map" operation allows you to take a function T->U and a container M<T>, and transform each element, giving you a container M<U>.

"Flatten" takes a container of type M<M<T>> and returns a container of type M<T>. So a List<List<Int>> becomes a List<Int>.

Now comes the trick: combine "map" and "flatten" to get "flatMap". So if you have a M<T> and a function T->M<U>, you use "map" to get an M<M<U>> and "flatten" to get an M<U>.

So why is this useful? Well, it lets you run computations which return all their values wrapped in weird "container" types. For example, if "M" is "Promise", then you can take a Promise<T> and an async function T->Promise<U>, and use flatMap to get a Promise<U>.

M could also be "Result", which gets you Rust-style error handling, or "Optional", which allows you to represent computations that might fail at each step (like in languages that support things like "value?.a?.b?.c"), or a list (which gets you a language where each function returns many different possible results, so basically Python list comprehensions), or a whole bunch of other things.

So: Monads are basically any kind of weird container that supports "flatMap", and they allow you to support a whole family of things that look like "Promise<T>" and async functions, all using the same framework.

Should you need to know this in most production code? Probably not! But if you're trying to implement something fancy that "works a bit like promises, or a bit like Python comprehensions, or maybe a bit like Rust error handling", then "weird containers with flatMap" is a very powerful starting point.

(Actual monads technically need a bit more than just flatMap, including the ability to turn a basic T into a Promise<T>, and a bunch of consistency rules.)

IshKebab•2m ago
I think this might be the clearest explanation I've seen. Nice work!
jazzypants•1h ago
This is written by the same guy who made a big stink about how JS promises weren't pure monads and somehow that was a problem-- a zealot, in other words.
macintux•2h ago
(2016)
seanhunter•2h ago
By the looks of the code snippets he should have explained that he’s not doing functional programming, he’s just writing unnecessarily non-idiomatic python code. I’m sure his manager would have understood.
ndriscoll•1h ago
The code snippets are Scala. The first snippet is idiomatic. I can't imagine a team adopting Scala and complaining about functional programming though.
tengbretson•1h ago
I thought "idiomatic Scala" was an oxymoron.
mrkeen•1h ago
I've been there. One of the more functionally-minded devs wrote something to do with putting Keys and Values into some kind of json store, and a less functionally-minded dev complained about all the type variables - Ks and Vs I guess.
flohofwoe•2h ago
When did method chaining become 'functional programming'?

It's not 'functional programming' that makes the code unreadable, but overly long chains of array-processing functions. Sometimes a simple for-loop which puts all operations that need to happen on an array item into the loop-body is indeed much more readable.

jolux•1h ago
> When did method chaining become 'functional programming'?

It's very similar to applicative style in FP. Conceptually, method chaining is equivalent to nested function application, it just comes with syntax sugar for specifying the `self` parameter.

mrkeen•1h ago
> When did method chaining become 'functional programming'?

As soon as you stop calling it "method chaining" and start calling it "function composition".

If you chain together a bunch of methods ('.' operator) in an OO setting, that's called a "fluent interface". It's a sign of good design and is to be commended.

If you compose a bunch of functions ('.' operator) in an FP setting, it's an unreadable mess, and you will receive requests to break it into separate assignment statements and create named variables for all the intermediate states.

busterarm•1h ago
There's only one universal lesson that I've learned over my 25+ year career so far and it's that software engineering types are fragile creatures whose egos must be tended to. Delicately.

This is becoming increasingly true as the years pass and the number of times I've had to drop whole mature architectures and reimplement something worse because some engineer's feefees got hurt can no longer be counted on my fingers & toes.

imtringued•1h ago
Using Scala and then complaining about unnecessary complexity is a bit much. Like, if you made the technologically brave decision to use a niche language like Scala that isn't just a slightly better Java like Kotlin then you'd better expect to accommodate the inexperienced developers by training them, possibly via pair programming, instead of constricting the experienced developers.
hylaride•39m ago
Post was in 2016 when Scala was almost required to use certain big data tools (apache spark, etc), the alternative being python and its limitations.
tsss•1h ago
If this code is too complicated for you then you should reconsider your career.
elevation•1h ago
TFA is indignantly reacting to the least charitable interpretation of what his employer has asked him to do. I'd like to know the honest shape of the code his manager rejected before judging the employer over this.
dismalaf•27m ago
Agreed. Especially if they chose to use Scala...
astrobe_•1h ago
Beyond the satire, one is supposed to write code which is readable, and like often with written works, one has to think about the "audience", the readers. When you write technical documentation, you have to decide ahead of time the expected skill level of the reader - often that decision is written too in the intro as "prerequisite(s)".

When writing code you have the motto "don't make me think" in mind, but how to know what's the maximum level of trickiness for readers? There are familiar techniques and idioms when it is your main programming language, but they are not for someone using this language on the side.

In any case, neither code nor comments should be tutorials. To a reasonable extent, it is up to the reviewer to do their homework or just ask. Then based on that interaction you can add a comment or a parenthesis, or uncompress a bit the code. But not to the point that it means to "dumb down" things, because it is a downward spiral.

dimal•1h ago
> When writing code you have the motto "don't make me think" in mind

I disagree with this phrasing. We’re engineering after all. The entire job is thinking. If someone doesn’t want to think, then they shouldn’t be a programmer.

Readability matters, though. I try to have a narrative structure in my code, so it leads the reader along. Formatting matters. And documentation helps. If you want to introduce an unfamiliar idiom that might be more functional, good, but document it. Share it with the team and talk about it. I know that writing and reading documentation is usually seen as a waste of time unless you’re doing it for AI, but I’ve seen it work well in multiple teams. In my experience, the teams with poor docs have the worst code.

odyssey7•40m ago
"I didn’t have time to write you a short letter, so I wrote you a long one." -- Mark Twain

It's difficult to explain how to write well, but bad writing and bad computing systems typically impose far greater cognitive burden on readers than might have been necessary. There is an art to software engineering.

Functional programming does involve idioms, though I would say no fewer than imperative programming, or OOP, or some other paradigm. One of the overarching themes of FP is to reduce the cognitive footprint to only the essential properties of the problem to be solved.

A novice artist can produce a recognizable figure using many pencil strokes. It takes a master to produce a compelling likeness with only the lines that are necessary.

politelemon•12m ago
Teams are not a static concept, they change members over time and so talking to them has a net zero effect. The newer members will not understand this clever new concept that was introduced, worse, they will misunderstand it or work around it. Which brings us back to don't make me think. If the concepts can be kept as simple as possible, which overlaps greatly with readability, it will have achieved its purpose.
firesteelrain•23m ago
> one has to think about the "audience"

This 100%

When I am doing MBSE, and I discuss what level of detail is required in my abstract models one of my senior coworkers would remind me to “know your audience”. It has helped me and I use the same phrasing when I am coaching my teams now.

_aleph2c_•1h ago
The manager solved the wrong problem. People should be sharing their tricks with each other. This was a perfect time to set up some peer-to-peer training.
jen20•1h ago
Or in the age of AI, "have you asked Claude to explain what the code does so you can learn something?"
jmmv•1h ago
Missed chance to do something like:

  class User:
    def calculateCoworkers() = {
      this.coworkers.clear()
      for { d <- this.departments }
        this.coworkers ++ d.employees
    }
and then, somewhere else...

  user.calculateCoworkers()
  ... many lines after ...
  for { c <- user.coworkers }
    ... do something ...
Yes, I've seen code like this many, many, many times where class members are used as "global variables" to pass state across functions. And I've noticed AI likes to generate code like this too (possibly because of the former (large presence of this "pattern" in the training data), which means I'm encountering this now in pull requests...
cies•1h ago
FP code is often easier to read (the article provides a case to that point).

What gave FP a bad rep is, i guess, Haskell (and the "pure functional approach w/ monad transformer stacks").

Every shop I worked at the devs were already at a level that they'd appreciate FP code: easier to read, refactor and test.

The tendency is also towards FP: see the features in recent Java/C# version. Or languages that gain popularity recently (Kotlin, Rust) are more FP'ish than their predecessors (respectively Java and C++).

apalmer•13m ago
Ultimately the important thing is that the development team align on the style of programming that they will use at least per project. And the larger the codebase and more developers working on it the more important the consistency in implementing the style guide is.

Imperative programming style has many advantages over functional for some problems. Functional programming style has many advantages over imperative for some problems.

The only clearly 'wrong' approach is codebases where you can look at the code and determine a specific developer on the team wrote feature x because it fundamentally looks completely different from the other sections.

ChrisMarshallNY•11m ago
Well, this is one of the reasons that I like coding for myself. The pay sucks, but I don't have to bowdlerize my work.

When someone pays me to write code for them, they get to call the shots; even if I think their judgement sucks.

If they want to hire incompetent programmers, that can't understand even halfway-advanced code, then that's their prerogative, and I need to suck it up, and play by their rules. These may include the need for me to write code as if I just started yesterday, because it will need to be maintained by folks that, um, just started yesterday.

nor0x•5m ago
Would be interested in an article about stopping OOP. I see myself often drifting towards classes and abstractions once my code grows in complexity