Painless Rails principles
- Differentiate 'schema' from 'implementation'
- Reduce entry point pressure
- Decompose code based on side effects
- Control the number of degrees of freedom of the app
- Don't mix building blocks and buildable
- Identify "types of code" & extract them into extra layers
- Write code like there's no DB under ActiveRecord*
- Don't mix layers of abstractions
- Prefer black box testing over white box testing
- Don't fight against the framework
- Minimize boilerplate code
They've been derived from the following aspects:
Aspects you need to take into acount:
- Imperative vs Declarative
- Functional approach
- Side effects
- State
- Types
- Polymorphism
- System thinking
- Interaction with external world
- Applications vs libraries
- Layered architecture
- Levels of abstractions
- REST
- Domain Driven Design
- 12 factors
Sources
- SICP (Structure and Interpretation of Computer Programs)
- TAPL (Types and Programming Languages by Benjamin C. Pierce)
- DDD (Domain-driven design by Eric J. Evans)
- CC (Code Complete by Steve McConnell)
Webinar: How to stop worrying about ActiveRecord and love Rails again
April 14 20:00 (Msk/Minsk time)
Attend webinar