Why Ruby and Rails? Why Not Java, C++, Python, or Scala?
We want students to understand that in the real world, programmers are rewarded
not for the number of lines of code written or for
how quickly they can “bash out” a feature, but for functionality delivered with high assurance of stability and while keeping the codebase
beautiful and
maintainablefor
continued growth. To many students, especially “hotshot” coders who come into a software engineering course with nontrivial programming experience, the methodologies and techniques we use to do this—
design patterns, refactoring, test-first development, behavior-driven design—seem a strange and a dubious use of time.
We have found that students are more likely to gradually embrace these practices if given the
best possible tools to support the practices. The Rails community has created by far the most
seamless, elegant, and comprehensive tool set to support Agile and XP, and the idea of constantly refining and inventing tools that support testing as well as helping produce beautiful application code is a distinguishing characteristic of the Ruby developer ecosystem. While learning Ruby and Rails will be new to most students, juniors and seniors seem to learn it without difficulty, and far superior tools outweigh the learning costs.
A common counterargument in academia is “Our curriculum already teaches language
X, so upper-division courses should leverage that knowledge.” We believe this approach optimizes for the wrong thing. First, software professionals are routinely expected to learn new languages by applying concepts from languages they already know, so “learning how to learn” new languages is a good skill to cultivate in class. Second,
a language that makes it difficult to write and test beautiful and concise code is a poor vehicle for teaching those techniques, so the only investment being “leveraged” is syntactic knowledge, a hurdle surmounted with relative ease. Thus, even if our students never use Ruby again, they will have learned how to
reduce to practice such important ideas as
metaprogramming, higher-order programming, functional programming, and use of closures in the service of higher productivity and more maintainable code. We believe these skills will transfer to new languages, framework, and programming systems. Our survey of alumni of the course that led to this book (see Chapter 13) suggests that our belief is well founded.從一個軟體生命週期來看, 一點優勢都沒, 只是前期開發效率快點, 軟體後期的最佳化, 效能的提升, 那做什麼還得做什麼, 那點工作量跑不了。 Rails在web開發效率上(這裡只說web),我個人覺得要比Python的web framework有優勢,具體都優勢大概有三個方面: