use-package is a (very?) commonly used package for writing one's Emacs configuration in a more "concise" way. It provides a macro called use-package which removes some boilerplate needed in Emacs configs.
If you followed my Emacs From Scratch series, you're probably using it!
I've been experimenting with a new configuration lately which doesn't use use-package. Why?
use-package certainly provides some useful features:
In my opinion, there are a few downsides to using use-package, especially for new Emacs users:
With all that said, I'm not recommending that people get rid of use-package!
This conversation is mainly an exercise to make us think critically about what it provides and look at that the equivalent Emacs Lisp would be.
I mentioned before that use-package is a macro, but what does that mean?
In Lisp languages, a macro can be thought of like a "code template" which is defined like a function but operates slightly differently.
Instead of the arguments to the macro "function" being evaluated and then passed in, the arguments are not evaluated. The body of the macro "function" returns the real code that should be executed instead!
We can use M-x emacs-lisp-macroexpand with the cursor before a macro call to expand it into the resulting forms. We'll use this in the Emacs From Scratch configuration to understand what use-package does and then convert it to plain Emacs Lisp!
I think that with some additional built-in helpers in Emacs, packages like use-package would be less necessary:
Take a look at leaf: https://github.com/conao3/leaf.el