3 ms·
Thanks for someone pointing this out. There are a lot of places in the code that could use some cleaning up. The overall frontend code structure is a little la
by mtrpcic 13y ago
Thanks for someone pointing this out. There are a lot of places in the code that could use some cleaning up. The overall frontend code structure is a little lacking:
* There's a "main.js", and a bunch of empty .coffee files that were presumably generated via a generator. Choose one frontend language and use it.
* Vendor libs should go in vendor/assets/javascripts. This codebase has assets/javascripts/vendor, and then random vendor libs that aren't even in that folder, they're just in "javascripts".
* The frontend code is going to quickly become jquery soup. There's no structure, all code executes on all pages.
* Very minor, but OS specific files should be omitted from git (like .DS_Store)
* Test coverage seems pretty low
* The secret token is public in the git repo (Why not use secrets.yml and keep it out of SCM to be safe?)
There are a myriad of other minor issues as well. It's a good idea for a project, and would help a lot of entrepreneurs out of done properly, but there are some glaring code quality issues here that worry me about the project as it grows.
- websitescenes 13y agoAlso really great feedback. I have been programming for only three years so I am still learning much of what you describe. I will be cleaning out the unused template files very soon. Good point on jQuery firing on each page, although I am not really sure why it matters if it has no effect. Processing time? There are no tests but I hope to add some soon. (I have never written any, so I will have to learn)
- allyjweir 12y agoFor the JQuery, it is more about separation of concerns and keeping a maintainable an clear codebase. If all of your JQuery is in one file and somehow a small change to one part breaks another page's code that can be very difficult to catch/fix. It's just good form in general to separate it out. You're also right about performance. Loading unnecessary stuff on a page is just going to slow everything down. It's a great idea and also being a relatively new starter myself I can relate. Hopefully you can take all the feedback everyone is giving and make your project better!