18F / guides

18F’s guides equip 18F teams, our partners, other practitioners, lawmakers, and the public with tools and practices to improve public services. They affirm experiences, build confidence, and empower exceptional digital experiences.
https://guides.18f.gov
Other
25 stars 10 forks source link

🟢 Ruby article is a stub (expand it) #321

Open beechnut opened 1 year ago

beechnut commented 1 year ago

Additional content could include:

beechnut commented 1 month ago

The page should eventually answer, "Why is this language / language-specific practice right for a government context?" May touch on things like maintenance, compliance, hiring, web frameworks / time to market.

bpdesigns commented 3 weeks ago

Iceboxing til questions above can be answered

beechnut commented 3 weeks ago

Some brainstorming:

Subject Thing Level Reason
style Standard Ruby standard If you just use standardrb, there's no need to spend time debating style standards. Install and move on to getting the work done.
build: rapid prototype 18F Rails template standard For rapid prototyping, use the 18F Rails template. If your project is a derisking prototype or CRUD/CRED app, Rails will get you going fast, and the 18F template sets up a lot of what you need for gov security compliance.
build: production build Hanami + ROM experiment* For builds that more for architecting rigorously validated event-sourced systems, use the CQRS pattern. Hanami as web framework, ROM for persistence. Hanami provides better architected schemas and data validations, and ROM provides less invisible magic — data schemas can be defined in the code, and they let you work better with CQRS / event-sourced patterns that ActiveRecord would quickly struggle under.
programming style Object-oriented AND functional standard Ruby lets you combine the best of object-oriented programming (OOP) and functional programming (FP). Follow functional programming within methods, using dependency injection (DI) to make them more easily testable. Use object-oriented patterns and principles (like SOLID) for organizing code.
code design Sandi Metz's rules recommendation You could fill books with recommendations for code design, but Sandi Metz's rules are a good starting point, as they help identify code smells and push you to design better code.
testing: rapid prototype Use unit tests at minimum, ideally unit and integration tests standard "Move fast and break things" doesn't work in government. How about "Move fast and don't break things"? Using unit tests and integration tests can help avoid regressions and maintain forward velocity.
testing: production build Use BDD and TDD standard BDD provides a common language shared by product folks and devs, and helps turn business requirements into features. Start with setting up Cucumber / Gherkin, then write the integration and unit tests before writing implementation code.
scale Design your application to scale for anticipated usage standard If your service will be serving the general public, design with scale in mind. If you're serving a few hundred or a few thousand agency employees, scalability becomes much less important to design for up front.

Recommended reading (free):

Recommended viewing (free):

beechnut commented 3 weeks ago

For a process, I'm imagining drafting a standard and having an open comment period with the engineering chapter, sort of like we did with the static site generator decision.