|
|
|
|
|
by afarrell
4190 days ago
|
|
> There is a fundamental rule in programming, it relates to absolutely any technology or language, this rule says that explicit is always better that implicit. Is this a fundamental rule? I thought it was something highly valued by python culture but not by, say, ruby on rails. |
|
One example is overriding an association proxy to have other side effects. Sure it makes for a few very sort lines of code to cause whatever those effects are, but unless someone has read the implementation of the code that behavior becomes completely opaque.
Similarly, acts_as_foo plugins that add implicit behavior everywhere.
The core idea was clever at the time -- that one could do better domain modeling than a few sql statements in a file by using AR and callbacks, but after the app gets a bit complex the domain model classes typically become very tightly coupled and much logic has been flushed away into implicit behaviors to make the remaining code halfway readable.
I have yet to see a Rails app that can stick with the basic structure with over 20 models and still feel remotely well engineered.