ruby: rails new XXX
rails generate controller SomeController
rails g view SomeView
rails g model SomeClass
.net: yo aspnet (and name entered later)
yo aspnet:MvcController SomeController
yo aspnet:MvcView SomeView
yo aspnet:Class SomeClass
let’s go into code structure
compare all the things
RailsWay
good sides
for business/coding people to prototype
for less-experienced devs - to quickly get results
for geniuses - they will handle any code
mostly-CRUD apps
logic-less systems
bad sides
for advanced developers
complex business logic
long living business processes
multiple teams
predicable speed of work
NextWay - going out of Rails
service objects
repositories
form objects
adapters
domain objects
events
The Next Way is heavily influenced by DDD and classical OOP patterns
It reduces the Rails magic
Why it is important
What I like
lack of compilation / build step
... just save & refresh page
TDD all the thing culture
dynamic typing ... no need to care about types definition
rails console ... to quickly check ideas
Active Record and its models that "just works"
What I don’t like
lack of compilation / build step
... and finding typos only after run the tests
TDD all the thing... because this is the only way to check it
dynamic typing ... and finding decimal where integer was expected
rails console ... and changing things on production server
Active Record and need to look at database schema to find out attributes
Beware of…
raise TooMuchMagicError
Or translated to .NET: throw new TooMuchMagicException();