Dancer2
Dancer2 copied to clipboard
Use Dancer2 standards in tutorial
Especially https://metacpan.org/pod/distribution/Dancer2/lib/Dancer2/Tutorial.pod#Putting-it-all-together is bad and confuses new users. - just in a discussion with an unlucky person who followed that part.
So:
- Use dancer2 gen to properly create the app and adjust this.
- Code goes into a module and not in the main script
- Use standard plugins for login and database.
- Configuration goes into the proper files.
We really don't need to save place in our tutorial by lumping it altogether instead of where the code / config belongs.
Dancer2::Tutorial is where new users try to learn how to get started with Dancer2 - the techniques demonstrated are not be used unless you know what you are doing - in this case its highly possible you may not need to read this guide.
I started my app using this example and I was quite happy until I had to do some extra customization and configuration. Then I realized I took the wrong path and I had to migrate my code to a new project properly generated using dancer2 -a project.
I agree with racke, his suggestion could probably create more value in the content of this guide.
I think it would be a good idea to add a final section to the end of this tutorial showing how to move from the script in the "Putting it all together" section to an app generated by the dancer2 script and proper module.
I kind of like the idea of starting with a *.pl file. It strips things down to its essence. And then you can show the user that "hey, look, there's an even better and easier way to do this" using the dancer2 command.
OK, grabbed. Let me know what you think. Thanks.
Hey,
I'm just going through the issues. I think this one can be closed. The changes made by @sdondley in #1425 address the issues described here and were merged into the master
branch in April.