emacs-eldev / eldev

Elisp development tool
https://emacs-eldev.github.io/eldev/
GNU General Public License v3.0
227 stars 17 forks source link

Better defaults for beginners #45

Open ram535 opened 3 years ago

ram535 commented 3 years ago

I would like to give a little feedback from the perspective of a beginner. I have never written a emacs package. Hence I do not know every little detail and quirk of writing a package. I know how to write simple elisp. I may find my way after hours of googling the internet.

As I beginner I would like to have the bare minimum of a package where I can build from after run eldev init. An ideal would be after running a command such as eldev init foo, creates the next structure.

foo
├── Eldev
├── .gitignore
├── foo.el
└── test-foo.el

Then I would run eldev test (hopefully using buttercup under the hood) to see that everything is working correctly.

I was surprised the first time, I executed eldev init, it just create a Eldev file and .gitignore file. But first it force me to run git init or otherwise eldev init would do nothing.

I think the entrance of writing a emacs package is too high for a beginner. A beginner can expend hours figure it out all the shenanigans and conventions a package has to include, then expend more time figure it out how to add a test for that.

I think it would be great for the emacs community if the entrance of writing an emacs package could be lower.

Thanks for your work.

doublep commented 3 years ago

This was briefly mentioned in issue #15, but we kind of agreed with the author that there was little to put into such a template. Initializing Git or something else (I hate making "insisting decisions", even if Git is "the standard" VCS now) could be added as an option I guess.

alphapapa commented 3 years ago

I think the entrance of writing a emacs package is too high for a beginner. A beginner can expend hours figure it out all the shenanigans and conventions a package has to include, then expend more time figure it out how to add a test for that.

Maybe you have a mistaken impression of what is required. An Emacs package can be simply one Elisp file, nothing else. Using tests, git, etc. are not required. See the Emacs Lisp manual, https://github.com/alphapapa/emacs-package-dev-handbook, etc.

ram535 commented 3 years ago

Maybe you have a mistaken impression of what is required. An Emacs package can be simply one Elisp file, nothing else. Using tests, git, etc. are not required. See the Emacs Lisp manual, https://github.com/alphapapa/emacs-package-dev-handbook, etc.

It must be obvious to season developer but I spend a couple of hours, trying to set a structure for a package. It was not obvious for me that buttercup required the tests to be in a test directory. Then I spend more time trying to figure it out why buttercup was not running the test when doing eldev test. After sometime I figure it out the minimum boiler code a package need to have. It was then that everything works as expected for a beginner. All that I describe above is really simple if you know it, but it can be really frustrating if you do not know it.

ram535 commented 3 years ago

Other similar packages for other programming languages when creating a project using the corresponding tool gives you the minimum boiler code to start coding.

ram535 commented 3 years ago

For example in dart. I can do dart create -t console-full foo, it will create directory foo and a simple example of a console application inside of it. Now I can do dart run in the root of the directory to run the example. I also can do dart test in the root of the project to run an example test. It is clear what is the minimum required to write a console application and the minimum required of how to write a test for that application.