Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standards organization overhaul + convert to Markdown #19

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

rstevens-nerdery
Copy link

@rstevens-nerdery rstevens-nerdery commented Apr 11, 2018

I felt that the standards weren't very useful to me in the format they were in, and it didn't match up with a lot of other community-provided standards documentation in Ruby or outside it. I took some notes from https://github.com/thenerdery/html-css-standards, removed Jekyll, and updated it so that you can browse the standards within GitHub itself. I think this change will make it easier to contribute to and expand/organize the standards in the future.

Feel free to take as much or as little of this PR as you'd like to.

Changelog

  • Removed Jekyll structure, replaced with Markdown files viewable within GitHub repo
  • Reorganized structure of standards document into separate files
  • Added TOC with links to each file into README.md
  • Added detail to Rails best practices and moved primer on MVC/installation to a separate section
  • Added/updated sections: Ruby best practices (code quality, debugging tools), source control, testing best practices (still empty ... for now)

To easily see what the repository would look like, take a look at the markdown branch.

### Javascript

* Use Javascript, not Coffeescript
* Use Yarn to load Javascript libraries in Rails 5
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why yarn? Since [email protected], there is very little difference between npm and yarn. Npm comes with Node, so enforcing yarn effectively equates to mandating an additional project dependency.

It may be beneficial to also call out how to install node. Using Brew is not the best way, instead, a node version manager like nvm is the better option (for the same reasons rvm is a better way to install Ruby)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woah, I didn't realize npm had improved so much. I'll see about updating this.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Npm has improved, but, is still significantly slower than yarn according to the sources I've found.

That being said, I do believe we can recommend tools, but mandating them should be left for situations in which they improve the workflow significantly for the entire discipline. Yarn vs npm probably doesn't make a significant difference in overall workflow, but, I welcome information telling me otherwise. :)

Just for my two cents, specifically in regards to npm vs yarn.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a while (in js timescale) yarn was the absolute winner; faster installs, a .lock file, etc. But, that was sooo last year. Today, the two are really pretty close: https://medium.com/netscape/npm-5-yarn-killer-ba69737b24d0.

My argument with Yarn vs Npm is threefold:

  1. Yarn adds another dependency
  2. It doesn't really provide much extra value over npm
  3. If you know the difference between yarn and npm, you probably already know what you're doing and can make your own decisions.

Ultimately, I agree with you @powder, mandating tools belongs in the context of a project.

@faxanadu
Copy link
Contributor

Thanks for reorganizing it, that helps a lot already.

Copy link

@powder powder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, thank you for taking the time to do this, I feel like it's a huge improvement already.

Second, I have left a few of comments, and I don't know if you rewrote the entire thing or just copied a lot of it and move some of the things around, but, I do feel like this PR is a good place to at least point out some of the places we have for improvement and or future thoughts. I don't think there's anything that prevents it from being merged and updated though.


There's two ways you can contribute to this repository:
Today at The Nerdery, the Ruby discipline is effectively the Ruby on Rails discipline. We do not do much pure Ruby work and we do not do Sinatra work. Thus, the focus of this document is not actually Ruby standards, but instead Ruby on Rails standards.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this does adequately portray what we're doing, I think this can be left as self-evident. There's nothing saying we will never have other work, or projects/clients that demand a different solution than rails. I don't know that pushing the thought that we're only capable of one thing is healthy for the discipline. We would want anyone that reads this document to know that we are Ruby engineers and promote ourselves as capable of providing a variety of solutions.

Maybe we can shorten this, or clarify that the standards we're documenting do tend to focus more towards Rails practices at the moment. It's good to have scope and we can expand it later.

@@ -0,0 +1,14 @@
# <a name="deployment"></a>Deployment

There are really 2 primary ways to handle deployment on Rails projects at The Nerdery:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment on writing style, feel free to ignore if you disagree.

Would this be better worded as 'There are two preferred ways' instead of 'There are really 2 primary ways'?

@@ -0,0 +1,65 @@
# <a name="documentation"></a>Documentation

Good documentation makes a long-lived project easier to understand and maintain. It can help introduce new developers to an unfamiliar codebase, or serve as a reference point for the team coming back to code 6 months later. Documentation may also cover important architectural decisions, complex business logic, or quirks and workarounds of the tech we're working with. Just as we put effort into making tests that last to ensure our application is stable and robust, we also focus on providing meaningful documentation.
Copy link

@powder powder Apr 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


Good documentation makes a long-lived project easier to understand and maintain. It can help introduce new developers to an unfamiliar codebase, or serve as a reference point for the team coming back to code 6 months later. Documentation may also cover important architectural decisions, complex business logic, or quirks and workarounds of the tech we're working with. Just as we put effort into making tests that last to ensure our application is stable and robust, we also focus on providing meaningful documentation.

A great article on improving Rails-based documentation published by Aaron Sumner can be found here. Many of the practices described below are pulled from his philosophy.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a missing link you intended to have here?


## Write clear documentation

* __Don't assume knowledge of the business__: If you've been working in the application for awhile, the names you've given your classes and methods may seem obvious, but to a newcomer they can be a large hurdle to overcome. Help explain ___why___ things are called what they are.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

#### __DON'T__
* Use YARD based [reference tags](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md#Reference_Tags). Although this methodology reduces DRY documentation it also enforces coupling.
* Overload your documentation. Having overly cumbersome documentation is just as bad as having no documentation at all. Keep your docblocks small, concise, and to the point. Often throughout the RubyDocs and YARD documentation pages you will be presented with large docblocks filled with markdown and html structures, unless this type of documentation adds significant understandability to the class or method we ask that you refrain from emulating this. "Short, Sweet, To The Point"
* Don't create [custom tags](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#Adding_Custom_Tags) unless absolutely vital to the understandability of the documentation. If you are presented with a case where you do need to make them ensure that you are always namespacing them.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not specfically aimed at this line.

Do we want to add examples of some of the documentation standards to this document? Perhaps how/if we should document the keys inside of hashes, or not? It's not actually part of the Yard docs, but, I've seen some recommended suggestions on it and such things.

1. [Ruby Warrior](https://www.bloc.io/ruby-warrior/) - a game for learning Ruby.
1. [Rails Best Practices](http://rails-bestpractices.com/) - for learning a *right* way.
1. [Rails Guides](http://guides.rubyonrails.org/) - the ultimate API document for figuring Rails out.
1. [Ruby Koans](http://rubykoans.com/) - learn the quirks of Ruby by fixing unit tests.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add Exercism? I'm a bit of a fan.


We work in a company with lots of different disciplines all commingling on a regular basis. PHP, .NET, Java, Rails and Python... we all get along pretty well. We're also quite adaptable and end up going where the work is - which might not necessarily be in our favorite discipline. The most common frustrations I see developers thrown into the Rails world is that of not having started from a good base.

You see, Ruby is pretty popular. You might not know it, but a metric ton of the critical tools you use daily are built upon it. For the most part, unless you're running Windows, Ruby is already installed. ***gasp*** it was that easy?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can likely add sources to back this. I like to point out that Ruby was recently reintroduced to the top 10 programming languages, and even the top 20 actually means it has somewhat significant usage in the world.

libxslt-dev libpq-dev libreadline-dev libyaml-dev libcurl4-openssl-dev \
postgresql postgresql-server-dev-9.1 git nodejs

# Install RVM to properly select Ruby versions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason we settled on RVM? Is this kind of a legacy decision just handed forward?

I ask out of ignorance, please educate me.

@@ -0,0 +1,46 @@
# <a href="#ruby"></a>Ruby Best Practices
Copy link

@powder powder Apr 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 to this entire file, while there may be exceptions, i do believe a lot of these tools significantly aid quality development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants