I've noticed some people use this to disable the menu bar in the GUI:
(push '(menu-bar-lines . 0) default-frame-alist)
and some people use this:
(menu-bar-mode -1)
Both achieve the same. The first seems to append a list '(menu-bar-lines . 0)
to the default-frame-alist
variable.
I was wondering which approach is better to use. The first or the second one? or it doesn't matter.
menu-bar-mode
is safer precisely because it checks such things. And it may be the case that even if you push a duplicate (or conflicting) entry, nothing bad happens. The question is: how comfortable are you taking that risk - and that's a question only you can answer. What @lawlist's answer provides is a best practice: you can follow it - or not.