Before we start to learn the Ruby on Rails, let's first try to understand the philosophy behind it.
Ruby on Rails is a
Ruby language based
web application development framework.
It's commonly referred as
often abbreviated as
Rails is an opinionated web development framework designed to be expressive, fun to work with and in turn make the web development process easier.
Rails does a lot of functionalities out of the box for us, such that we don't have to worry about the configuration part nor code it by ourselves, in most cases.
This is achieved by enforcing some strict conventions in place.
Rails philosophy includes two core principles:
Don't Repeat Yourself(DRY) is a software development principle which states that:
"Every piece of knowledge must have a single, unambiguous, authoritative representation within a system".
In short, don't write redundant i.e. repetitive code.
This ensures maintainability, extensibility of the code, and makes it easier to debug.
Rails utilizes the dynamism of Ruby language to make developer's lives easier.
It uses a default set of conventions by making the assumption that we are sticking onto the advocated practices.
If we follow the conventions, then we don't have to configure a lot of things on our own.
Rails auto-magically handles a lot of cases for us.
Custom configurations and practices can change from developer to developer.
Thus when working in a team, it becomes hard to keep track of and review the different practices followed.
That's why the Rails principle of convention over configuration is widely accepted.
However, at the same time, Rails doesn't restrict us to configure the applications in our own custom way, if needed.
To understand Rails framework properly, we need to keep these principles in mind.
Sticking onto these principles will definitely help in making yourself a better programmer.