讓你的Rails專案保持清潔

jieforest發表於2012-06-25
Way back when in the 1600′s, astronomy was all the rage in Europe, due for the most part to the invention and production of telescopes.

As a result, kinds of people were able to learn more and teach society more about stars and such, and it all progressed wonderfully. But, astronomy isn’t just looking at pretty lights; there are a lot of calculations. Also, these aren’t the hundred and fourteen plus twenty six type calculations that you do in your head; they’re heavy duty, with large numbers and frightening chains of arithmetic.

Presumably, the “graduate students” of astronomy at the time were assigned the task of sitting around and crunching numbers for the more experienced astronomers.

Then, a man named John Napier changed everything. By reducing the accuracy of the calculations slightly, he developed (or, at least, introduced in Europe) the system of “logarithms”, which make arithmetic much easier (they’re the basic idea behind the slide rule).

This is what Rails has done to web applications. By making small assumptions about how you write your code and how your app serves its users, it has made the process of developing and deploying high quality web applications a much less painful process.

But, this seems to start to change as you finish your first seven or eight months with your web application. The templates are scattered, the controllers are bloated and the models are sitting around doing nothing. Slowly but surely, your development time slows down, features are delivered slower and slower, and, worst of all, the fun leaks away from developing web applications.

You definitely don’t want this to happen to you.

If you are willing to put in little bits of time from the start, you might be able to prevent this from happening.

So, let’s get started with some things you should keep in mind when crunching out the code for that awesome new application that’s going to change the world.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-733700/,如需轉載,請註明出處,否則將追究法律責任。

相關文章