What Does Freud Think About Your JavaScript Functions?

Sebastian Carlos
3 min readMay 9, 2022

--

Max Halberstadt, Public domain, via Wikimedia Commons

JavaScript developers like to think they are pretty clever. But would they stand a chance against the father of psychoanalysis?

Let’s say, for example, that a developer writes a function called “getUserById”. What does that even mean?

Freud would say that it’s a classic case of displacement. The developers are trying to eliminate their own “id” — the part of the mind that contains the primary impulses — by putting it into the function name.

Or take the “isValid” function. Freud would say that the developers are worried about their validity and self-worth, projecting that onto the function.

And then there are the “init” and “destroy” functions. These are clearly about birth and death. The programmers are trying to come to terms with their mortality.

Object-oriented programming is particularly interesting from a Freudian perspective. The whole concept of classes and inheritance is about the anxieties of the civilized man against the structures of supply and demand that permeate modern society.

A case study: Dan Abramov’s latest commit to the React repo.

At the time of writing, rockstar developer Dan Abramov’s latest commit is “Add @Andarist to changelog credits”.

Mr. Abramov indeed felt that full credits to everyone involved were not properly given, and he proceeded to amend the changelog file.

This action displays a dignified — even if paranoid — concern with justice and equality.

Additionally, it’s crucial to notice that Mr. Abramov changed the number of credited persons in the changelog from one to two, which all but confirms that he’s a dualist and likely believes that the mind and body are radically different things.

A case study: Brian Vaughn’s latest commit to the React repo.

The commit is titled “Fixed possible undefined error in TreeContext reducer”.

Mr. Vaughn is a perfectionist. He’s not only concerned with fixing plain undefined, but even possible undefined.

His fixation on future events is understandable. It would be good for him to remember that — except for the rare exceptions formulated in Einstein’s Theory of relativity — time doesn’t exist. We should focus on the present.

On the upside, I warmly approve of his TreeContext reducer. After all, humans are primates, and climbing trees is in our nature.

Conclusion

The truth is, we can all learn a lot from Freud. So next time you’re writing a function, ask yourself: what does this say about me?

Thanks for reading! If you enjoy humorous tech stories like these and want to support me to keep writing forever, consider signing up to become a Medium member. It’s $5 a month, giving you unlimited access to stories on Medium. If you sign up using my link, I’ll earn a small commission. You can also follow me on Medium and Twitter.

--

--

Sebastian Carlos
Sebastian Carlos

Responses (3)