Compared with Python frameworks such as Django and Pylon, does RubyonRails have great technical advantages?

Source: Internet
Author: User
Tags ruby on rails
What are the main technical advantages if there are advantages? What are the main technical advantages if there are advantages? Reply: The Instructor (pure Aries @ Qingfeng) who gave the intern the first class said this question during my internship. The general meaning is: the bigger your application is, the fewer things the framework can provide to you. The new framework will greatly improve efficiency at the beginning of development. However, in the future development, there will be fewer and fewer help and more designs.

This is probably the reason. Douban still uses Quixote, because in addition to route distribution, other frameworks cannot provide much help. The framework provides the working mode of the framework.

So I think for general applications, if we can get efficiency advantages from the framework, Ruby on Rails or Django doesn't matter much. On the contrary, document quality, Community activity, and number of users with quality (that is, the number of users who can actually solve the problem in StackOverflow or the mail list) will be more affected by these non-technical factors. There are certainly differences and advantages between frameworks.

For example, Spring transaction management. For example, the quick prototype of Rails. In addition, "Some Frameworks of lightweight frameworks such as Quixote, Sinatra, and node", or even "no framework ", It is also a framework.

The framework should not be considered by technical personnel (the differences in modern languages are sometimes not worth mentioning ). Architects need to consider this.

Considering Scalability costs, is it cheaper to use Spring Server clusters to manage things than to use replicasla clusters?
Consider a quick prototype. Can I use Rails to show a usable item to VC in a month?
Considering that the user needs to edit and automatically distribute mail templates, is PHP preferred because there are ready-made products?
Considering that the system involves a large amount of personal data, is the Java framework selected based on security considerations?

When the requirements are more diverse, you may need to mix multiple frameworks.
Spring API + Rails?
If there is a large number of concurrent simple things, do you want to consider adding Node?
If there is a simple index of a large amount of data, do you consider NoSQL databases?
For different libraries in multiple languages, is it important to consider using Python as an adhesive?

Today, hybrid frameworks are quite common. In the future, it will be difficult to unify languages and frameworks. Since everyone is a good player, it is wise to choose a combination based on your needs. Ruby is not as personal as it is in other communities
Ruby has great advantages in DSL. The rspec used for testing is very useful. Automated Testing is very important. without testing, many things cannot be done at all.
Metaprogramming. Python programmers seem to reject this, while ruby thinks this is good.

Django's source code is very long, and the longer it is, the worse it will be read. The boss asked me to add a method in the tables to tables Table. I remember that I changed the method at least three or four places (I don't know if there is a problem with my method ). I think the ideal state is just to change somewhere.

Berkeley chose rails for development, and there was no ruby in his previous courses. In addition, the cs61a and AI of berkeley all learn python.


Berkeley says in the course software as a service

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 writtenOr How quickly they can "bash out" a feature, But for functionality delivered with high assurance of stability and while keeping the codebase BeautifulAnd MaintainableFor Continued growth. To define 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 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 outweweigh the learning costs.

A common counterargument in academia is "Our curriculum already teaches language X, So upper-pision courses shocould leverage that knowledge. "We believe this approach optimizes for the wrong thing. first, software release sionals are routinely expected to learn new versions by applying concepts from ages they already know, so "learning how to learn" new versions 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 failed. Thus, even if our students never use Ruby again, they will have learned how Reduce to practiceSuch important ideas Metaprogramming, higher-order programming, functional programming, and use of closures in the service of higher producticode and more maintainable code.We believe these skills will transfer to new ages, 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. from the perspective of a software life cycle, there is no advantage at all, but the efficiency of development in the early stage is faster, the software is optimized in the later stage, and the performance is improved. What else should be done? That means the workload cannot run. Rails has three advantages over Python web framework in terms of web development efficiency (web only:


Language
Although Ruby and Python are similar in many aspects, there are also many differences. In general, Ruby is more flexible than Python (especially meta programming), so Ruby is easier to create an expressive framework, it is easier for the framework to remove more overhead.

Design
Rails is a typical C2C, and convention can greatly accelerate development efficiency (of course, there are also various drawbacks). While Python advocates explicit, there will be more code to be written, not so much magic, but it is easier to learn and will not accidentally make mistakes.

On the ecosystem
Ruby focuses almost all over the community on web development and Rails, so many new idea (Cucumber, capy.pdf, Sprocket, Capistrano/Mina) are created ), in addition, gem/bundler makes package management easier and the ecosystem more developed. In Python, Django has its own ecosystem, but there are many other frameworks in the industry with scattered resources, and other frameworks are difficult to generate a climate. In addition, another big application of Python is actually in scientific computing, therefore, we feel that the web development ecosystem is not as developed as Ruby. When developing small and medium-sized websites, rails is the fastest. rails can automatically generate a prototype within one minute. This is an integrated solution that other frameworks cannot do. rails is encapsulated completely. It is a model plug-in and extension of social programming far beyond others. the framework solutions and materials of ruby are very rich. The perfect meta-programming mechanism with envy of other languages is destined to be more intelligent than other frameworks.

The disadvantage is that a high degree of integration will lead to bloated and performance reduction. The large scale of the website needs to be dependent on the architecture. The ruby community is also addressing this problem and developing several streamlined and high-performance frameworks, such as sinatra railsapi and other languages. there is no difference between learning and imitating rails.
Another drawback is that the domestic cloud platform basically does not support ruby. As a result, with the constant expansion of php in China and the rise of nodejs, rails has missed the best development period in China. As for the future of rails whether or not we can get started again depends on how 37signal and the community face the new html5 wave. I prefer Python. flexible. great advantages. Rails can quickly launch the product. rails provides a complete framework and best practices. This is incomparable to the python framework. One thing I feel very useful is the migration function, which comes with Rails, other Python frameworks are implemented through plug-ins (Django only implements migration in core functions in version 1.7. Currently, Migrations | Django documentation is under development. )

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.