Do you have RAILS if you don't have Ruby? (COULD RAILS HAVE BEEN Built WITHOUT RUBY?)

xiaoxiao2021-04-09  469

Do you have RAILS if you don't have Ruby? Original: http://www.billkatz.com/node/42 Translation: Suninny read Paul Graham (Translation: Paul Gramham, famous LISP hacker, "on lisp" and "hacker and painter", etc. Book) About computed language, some interesting points of interest, which make me inspire. This blog entry can be called "How to make me realize Ruby on Rails." First, the new language will tend to LISP, perhaps because lisp is a theoretical drill of McCarthy, a thinking experiment, and it is said that it is really designed to have a hard step (1958) calculation limitations, but rather It is said that it is used to explore "Try to make calculation axioms" (see root of lisp "in Graham, the translation: Chinese version of the translation of" LISP "). In contrast, Fortran and C, a large number of tail instructions (CUES) are adopted from hardware to improve operational speed. Over time, the low-level language is used to handle algorithms simple, calculate the problem of poor, and the scripting language (such as Perl, PHP, Python, Ruby) has developed rapidly, and the role of simple adhesives is more complex. Processing the task. From me, I have been to the list, I have been there for 20 years. I want to know if ruby ​​is as strong as it is as strong as it is in distant memory, and more beautiful and flexible than I have used by C, C , PHP. She is a real face-to-object (message)-based language, with strong type, closing and seemingly dynamic (type, open class). Although I am just a novice in Ruby and Rails, I know that she will be a language that makes me happy. Graham talked about the "bottom up design" - adapt to the problem domain by changing the language. It suggests why it is so awesome relative to other web architectures: Rails is like a horsepower Ruby rather than just a bunch of classes, process calls and combines a piece of code. "In LISP, you not only write your program downwards, you also build a language to your program", Graham wrote: "Language and procedure evolve together ... to the end this language will seem to be Designed for your program. And when language and program tacit, you finally get a short, clear and efficient code. "This is a good description from 1993 on Rails, it pointed out the web framework A considerable difference between quite subtle differences. As the standard Ruby allows you to use "Attr_Writer: Some_Attribute", Rails provides a notation "HAS_MANY: DATA_THING" for defining data relationships. This Ruby road seems to be more deepest, with Rails expansion, I don't know if she will continue to stick to the Ruby style. It's time to answer this question - "If there is no Ruby to generate rails?", I think not only look at functionality and have to consider from aesthetics - it is not just a comparison of simple code lines, you go up Rails established a language that resolves the common problem of Web development. For example, Graham, you can build Rails with any diagram of the spiritual machine. The real question is that you have to copy aesthetics, whether you will be a secret implementation of a Ruby interpreter in this process. For Python users, transplantation is also difficult; as a C user, or constructing an Ruby interpreter is easy.

A question of conflict with Zope 2 (a main Python Application and Back-end Server Architecture) is how to make non-Python's architecture in front of the developer, the architects have rewriting, Zope X3 is rewriting works. In the road sign in early development, they wrote, "We know Python is a great language because it has a small core, the value is clear, and there is a huge standard library .zope will follow this pointer. At least A Python prawn Xavier Defrang, thinks "There will be [rails] in python / php / perl / java, it is because of the language relationship ... Can a schema win your good feeling, her simple and elegant design, Instead, it looks like a design mode library. "DEFRANG's complaints about the model of grass rate are very vivid. The essay of Graham is ended here: ... in the object-oriented world, you often deal with" Mode ". These modes often do not serve as a Cixin - Human compiler to run [translation: Paul's original text lists A, B, C). When you see the mode in my program, I think it is a talked sign. A program is only just It can reflect the problem that it needs to explain, this is one of the other regularities, just that my abstract work is not a sign, usually, I will handle some macro to solve this problem. I think Graham It is very different from the synonym of a copy of the model, which is very different from Martin Fowler's view - how can it think that "How to" (How), "When", "Structor" David HeineMeier Hansson is so keen to build a beautiful chart for the Martin Fowler's mode door class .Rails is an illustration of the MVC mode. A certain number of other styles, such as Active Records affect the frame design, this seamless combination Sometimes even let the critics will not be noticed .Rails developers try to extract this regularity as much as possible. Press Rails, they call the DRY (Don't review yourself) principles; conventions ( Translation: Another principle of Rails is that it is unconfigured) Allows us to remove the model information from the database to avoid duplicate code; assistant (helpers) reduces the number of ways we create forms and other views .Rails is not the first A framework for making this simplified trial, but maybe she is the cleanllation of this, because this abstraction is suitable for the Ruby language style. Some frameworks believe in regularity, and even make it a culture - may accompany the additional language - - Such tools can be analyzed and automatically generated. When people read the code, they will understand what it is. In such an environment, the program is used to use tools. Development does not mean in the X language but the Y tool X Language. I think Ruby On Rails, the underlying code is constructed with Ruby and use meta-programming (such as HAS_MANY above) to be simpler as possible, maybe this is because Rails lacks a full-effective IDE such as Visual Studio There are many RAILS-specific keywords that create a language as you expect for web applications, but these keywords operate in Ruby mode. In contrast, some frameworks that are not mixed into the underlying language need to master new Identifier and master a new method. Ruby on rails has code generation script to quickly build a foot Hand frame, and I want to know if this abstraction can do more good.

转载请注明原文地址:https://www.9cbs.com/read-133220.html

New Post(0)