personally think that developers shouldn't care about code beauty, because that's not their job. Instead, they should focus on creating great products, which is infinitely more satisfying.
Code Fashion
What defines beauty in code? Just like for clothes, opinions on the subject may vary. Each year, we find new trend-setters, like Jeff Atwood, Martin Fowler, or Eric Evans. They offer convincing arguments to explain why pattern A is better than pattern B. Until someone else publishes a book, explaining that pattern C is much, much better
Fingerprints, as most of us know, are composed of whorls, loops and arches. But keep zooming in, and you'll find tiny, tiny sweat pores arranged in patterns equally unique. Scientists in Korea have found a new way to map those pores that could help identify decade-old fingerprint fragments.
je to zoznam "odporucani do zivota" (patterns) pre vyvojarov ktory sa chcu zlepsovat. je to povodne urcene najma pre zacinajucich programatorov, ale pride mi to nadcasove a je tasm vela napadov a odporucani na celu "programatorsku" karieru. odporucam kazdemu kto programuje, knizka ma dobru granularitu a cita sa lahko.
has_many is an anti-pattern which leads straight to monolithic applications. However, a simple inversion can free us from its grasp.
What is the first model you added to your application? Probably User, right? So, once you wrote user.rb and its corresponding tests, and committed it - why did you ever open that file up again to tell it about something that it did not need to know existed? Rails keeps you from reopening user.rb if you add a column to the User table, and this is good, right? So why, when you added a Posts table far away, did you open up User again to make it aware of Posts? Did the definition of being a user change? Did you did not realize you were violating the Open-Closed Principle, one of the 5 principles of SOLID design? Somewhere inside I bet you knew it felt dirty to keep opening up User and making it aware of things that it had been blissfully unaware of.