Ruby and Java

Source: Internet
Author: User
Tags ruby on rails
Bruce Tate's beyond JavaArgue that JavaAs the preferred language for enterprise development, the rule will eventually end, and enterprise innovation also takes place in Java for the first time in ten years.Out of the domain. In that book, he lookedHaving achieved unprecedented success in different degrees, we have also considered that the new language surpasses JavaThe features to be obtained.

The subsequent sections discuss other competing languages in this field and clearly think that Ruby is at the forefront. These are all from Tate's own performance breakthroughs (supported by Ruby on Rails) and Ruby testing.And from other users is also advantageous evidence.

Will Ruby gradually surpass Java?? JavaWhat gaps exist in Ruby? And whether these two languages will be difficult to use?
To investigate these situations, we contacted several of the most outstanding authors, blogs, and developers to gain their insights. All their responses are shown in this article.

Copyright Disclaimer: Any website authorized by matrix must retain the following author information and links for reprinting.
Author: Chris Adamson; ginge (author's blog: http://blog.matrix.org.cn/page/ginge)
Original article: http://www.onjava. Com/pub/A/onjava/2005/11/16/ruby-the-rival.html
Http://www.matrix.org.cn/resource/article/44/44288_ruby+java.. Html
Keywords: Ruby; Java

Bruce Tate: one stone stirred up a thousand Waves

Bruce Tate is not written as an outsider.This book. His advisory company focuses on JavaPersistence frameworkAnd lightweight development methods.Author of the book, spring: A developer's notebook, better, faster, lighter JavaAnd bitter Java.

1.You have spent a lot of time on Ruby. It seems that it is similarCompetitors excel. What do you think makes Ruby better than PhP?Is Python a superior language?

These are good languages, but they all have some disadvantages. For large applications, PHPAnd PerlYou cannot generate readable code consecutively. LISP, Python, and smalltalk lack the catalyst that a great language should have. Ruby is a good language, and the catalyst (Rails) provides compelling new value (in terms of efficiency) and is still growing rapidly. Ruby is not necessarily the best language, but it will be the most likely language I have ever seen. Ruby is unlikely to surpass Java in the Committee. It is likely to first achieve good results in a smaller but important environment. This environment is a WebFat relational database with large UI.

2. Does rails mean Ruby? Other languages include JavaCan't we achieve the same idea?

Today, rails is more than. netThe catalyst for languages such as scape, with JavaWith the same functions, applications can be transmitted over the network. But I think rails is probably just a ruby meta-programming framework.The first wave.

3. Many of your books are based on the typical & ldquo;Interface connection to database& Rdquo; in this scenario, Ruby's success stories seem to be only a small project of one or two developers. But you admit that JavaHeavyweight enterprise frameworkValue to some projects (that is, large-scale applications on large systems ). Under what circumstances will a project be too large for Ror? What if the feature of an ROR is slow?

You can do many things with Ruby and small teams. Almost all the basic code is written by one person, but it is related to the livelihood of the entire company. Before some major companies start to make a serious attempt, we don't know how much you can use Ruby or rails. One of the most attractive tasks is the economic scale and smaller scale. What if the productivity figures are real? In case of a 5x increase? You can divide jobs in a department and divide jobs into one of the teams. Communication rarely becomes a problem. Management and negligence are rarely a problem. We all know what tipping points means for a company's growth. As increasing the level of communication and management creates many obstacles, it is very difficult for a company to grow by more than 100, or even times. However, Ruby on Rails is highly scalable.

4. Do you see JavaWill developers turn to Ruby, or will Ruby be used by a new generation of developers?

I think both are possible. Some developers cannot tolerate servlet learning.S, spring, XML, Hibernate, StrutsThen we need to learn some UI bonding frameworks.. In rails, they will be completely released. JavaDevelopers are already looking for more advantageous methods, and they have discovered Ruby on Rails. Accepted rails JavaThe number of dreamers is astonishing. They include thought works, James Duncan David son, Stuart Halloway and David Geary.

5. Is JavaCannot we do something to maintain its outstanding position? If it is too complex and inflated, What can prevent developers from moving backwards to JDK 1.4?

JavaIt will continue to peak and maintain good performance in enterprise applications, but the time will not lag. In a sense, it will eventually be replaced. We will need a more advanced abstraction. I think our best hope is to invest enough in JVM to better support dynamic languages and embrace new things.Code, it is best to keep a conservative attitude.

6. Should we expect Ruby to make a sensation in other fields? IfIt is so good to use it. If Ruby has a suitable UI framework that can be usedWill it be useful in desktop applications?

It is too early to say anything. Today, although Ruby is a catalytic language (Rails), it is only a candidate. What will happen in the future? I don't know anyone.

James Duncan David son: trying new transactions

If you use TomcatOr ant(Seriously, what JavaWhat have developers used ?) Then you are familiar with James Duncan David son's work. At sun, he strives to open source these projectsAnd donate them to the Apache Foundation. He also compiled the ServletThe first two versions of the API, as well as processing XMLJavaAPI. After leaving Sun, he started Mac OS X development. Compile running Mac OS X pantHer and participated in the compilation of running Mac OS x tiger, Mac OS X pantHer hacks, cocoa in a nutshell, and learning cocoa with objective-C, 2nd Edition

1. The last time we saw you, you were the Mac desktop apps in cocoa guy. Now, I can see on your blog that you are deeply immersed in rails. What is that?

I was desperate and eager to pay for it. At that time, I just bought a new house and the mortgage payment deadline was about to expire.-Oh,
Wait, do you want me to take it seriously? Well, the fact is that my friends and I have been trying to work together for a while. At the right time, we made a technical evaluation for the project, and rails became the first choice. At that time, I had never used rails or Ruby. However, I will not let a small need to learn to prevent me from doing that project. I have learned three languages this year, maybe four. I no longer believe that a language can do anything. If I need to learn some new knowledge and do something, I will do my best to learn it well.

2. What do you think of rails?

It is mainly about simplicity. Easy to complete. The first project of the application I made was originally a Java-basedWebApplication. Everyone knows that there will be a better, faster, and easier method. Ruby has always been a good language-and an interesting language-so it is built on this framework., It should be noted.

3. Is Ruby obscure and rails novel a problem for customers?

Not all. The opposite is true today. There are too many potential jobs and not enough people are actually developing Ruby on Rails Applications.

4. Why is Ruby so special? Can't rails be implemented in other languages? Can't it give JavaImplementation?

Few other languages can complete rails, Or something like rails. JavaNot among them. Rails gets some amazing things from Ruby. Trying to copy it in another language is not only a waste of rails, but also a waste of other languages. However, its concept will certainly be well applied in other dynamic and Dynamic Language.

Indeed, I am very excited to see that other projects are implementing ideas derived from rails to other platforms. For example, as a rails version in Python, Django has achieved some fixed development. However, it is actually a giant of Python, and how it grows will be very interesting.

Now, I have already said that you cannot use JavaTo implement rails. But it does not mean that you cannot use JavaDo something equally outstanding. JavaThe power can be applied to a new framework in an interesting and magical way.. But no one has done those things yet. Everyone applies to J2EEThis cake is so popular that no one has to reconsider the problem in a more intense and dynamic way. Although someone proposed a Java-basedKiller frameworkIt can do as much work as rails, and it must not do like rails.

5. Well-designed JavaThe application can well support the expansion of features-design your classes and packages, so your mood will take a long time. Can a team compile a really large Ruby application? Is it maintainability? Or can ror be used for minor attacks?

Well-designed applications can support feature extensions in any language. Poor design, No matter what language, cannot be used. At the same time, there is also a question about how to define large applications. The first rails application I wrote in ruby is not enough code to deploy it to production, but the same size of the application I wrote in other languages has reached 5,000 lines of code, therefore, how to define a large scale is a problem.

Can a team compile a Ruby on Rails application that supports a large number of features, runs well, and has maintainability in time? Yes, no doubt. After using Ruby on Rails for a while, I Will Be confident to use rails to solve Web applications of any size.Application Problems. However, it is because I spent some time on it and realized that it is possible to write an application with good design.

That is to say, it is very likely that dozens of junk Ruby on Rails Applications are being written. Hundreds or thousands of instances are possible. If you do not know what you are doing, you will write a spam application.

6, then we go back to the WebApplication, you can use Ruby on the desktop, or do we always use C #Is the UI written in an object-oriented C or language supported by the OS service provider?

Well, part of my life is going back to the WebApplication. It is a good environment for me, because since 1994, I have been working on web-based. But now I will develop desktop-based applications. In addition, there is a huge demand for desktop applications. I don't want a network office. You also don't want to build something like aperture into a webApplication.

Can you use Ruby to build a compelling desktop application now? No, the related toolkit does not exist. But if an appropriate toolkit exists-this is possible. There is nothing to stop it from becoming a good desktop application language. That is to say, I have found that the best way to use the platform is to make it as local as possible-close to the platform, whether it is an operating systemOr a webApplication Framework. When I work on a Mac desktop, I need to write object-oriented C and cocoa. When I use Rails WebWork, that means using Ruby. For operating systemsI need C and shell. In this discussion, there will not be only one answer.

I think this is the recent attention to Ruby on Rails and discard the colored JavaGlasses view the true victory of the world. Ruby will not be the next Java, No. But Ruby on Rails will help break this idea-& ldquo; there is only one correct method & rdquo;, no. There are hundreds of solutions to the problem. Really, none of them are clear winners. Only solutions have advantages.

I think it's just like the buildings where we work, eat, and live. Some buildings are best built with cement and steel bars. Others are masonry. There are other good uses of wood, and there is a reason to do that. No one will jump up and say & ldquo; all buildings must be built with bricks! & Rdquo; that's too stupid! In the same way, not all applications should use Ruby on Rails, Django, or J2EE.Or Perl. There are a lot of tools for any particular job. There are new tools to be explored. The trick is to decide the best one.

Let's go back to your question: on the WebApplication Scope, it is easy to see a new frameworkBecause you are not using a video card, GuiDeal with the entire system where the application runs. Unless you are willing to develop your own frameworkYou must select which framework to use. The same is true on the desktop. You can create your own framework, Do whatever you want, but this advice is no better than you do for the WebCreate a new frameworkEasy.

Robert Cooper: powerful weapon

OnjavaThe blog robert cooper recently wrote on his blog
& Ldquo; it's the end of the world as we know it. & quot; & rdquo; To respond to some & ldquo; JavaComments from the end of the Times & rdquo. Cooper is committed to enterprise integration and Web/WebService Application J2EEDevelopers, as well as information and entertainment site screaming-penguiN.com operator.

1. You once said & ldquo; For A Long Time & lsquo; enterprise & rsquo; JavaIt is a sad fact that 500 applications require the & lsquo; enterprise & rsquo; function. & Rdquo; Why JAVADevelopers adopt a framework that is more complex than they actually need?

Well, there are some factors that have led to this phenomenon. One is & ldquo; buzzword Compliance & rdquo;. You want to use what you & ldquo; Should & rdquo; want to use. I remember that Entity Bean was used as a data model for some major projects in, but we soon discovered that the performance was so horrible that we finally switched to the handwritten Dao layer.

RecentlyThe modification of X. Persistence also indicates to some extent that EJBThe failure has always been a lack of support at different levels. Ideally, if I only need basic, simple ORM-type features, I will be able to get it quickly. If I want to go deep into something really complicated, give me a view of distributed transactions & ldquo; deeper & rdquo;. However, even at that high levelIn the 1.1/1.2 world, check how many lines of code you need. 1) obtain the home stub from JNDI, 2) Make a find by, 3) make changes, and 4) Commit transactions. For general applications, there is no reason to have only one & lsquo; 2 & rsquo ;. However, more novel JavaFramework(Read: Spring+ Hibernate) You get the & lsquo; 2 & rsquo;, but you have to do a lot of configuration. In this way, your code is obfuscated in many aspects. Many factors contribute to my speech & ldquo; have a valid default configuration/operation & rdquo;, but that is a different story.

2. You have never bothered to regard Ruby on Rails as a rising star in Technorati. Do you not want to accept it or do you just hate it?

It's not really so disdainful. Rails is excellent in many important aspects. In fact, if PHPIt's the cool flying fan and Ruby to replace. I think that will be a big improvement. However, although Ruby does clear past errors, it still lacks JavaThere are so many features, but Ruby provides a striking new development model for rapid development. You may disagree. This is only a matter of time. In time, it will certainly work. However, I am somewhat hostile to Ruby/rails because I have always wanted JavaThe features that can be possessed have long been expected by J2EESimplicity.

3. What prompted you to stay in JavaCamp. What do you think of it?

According to my daily work, there is no need to use Ruby to call The PCML/RPG program on 400. Similarly, a large number of JavaThe & ldquo; enterprise-level & rdquo; feature is very important, not to mention that it is a unified packaging and deployment framework..

4, you said & ldquo; however, JavaIt seems like it has become all-encompassing, and it is not & lsquo; webThe language & rsquo; is not a desktop app & lsquo; first-class citizen & rsquo ;. & Rdquo; JavaShould I discard some ambitions and focus on a smaller set of application spaces? In that case, what should I give up?

You know, I have a long discussion with a gentleman on my site. He pointed out that JavaInThe success of the world, TME/TiVo, and placement-maybe the next generation of DVDs. These are effective fields for development, but I think if JavaIf it becomes such a system, it will be a loss.

What makes me angry is JavaInvented & ldquo; Applet& Rdquo;(Plus flex/Laszlo), its & ldquo; cool & rdquo; (quick user experience) and & ldquo; powerful & rdquo; (I get data binding/soap/XML for free.-RPC and so on) Make the AppletS. & Ldquo; powerful & rdquo; the fact that JRE is not required immediately kills the AppletIf someone can show me the Laszlo dashboard demo with a number of lines of code, I may have achieved a core development in that aspect. Cool is costly.

5. JavaMore and more complexity and more competitive frameworksYou have criticized it many times before. We use the Semantic encoding of JDK 1.2 and manually compile the servlet.Is it better?

I think the complexity is hard to manage. For exampleBackground focus on using swingThat is very uncomfortable. When You Need To Do Something skillful, none of the & ldquo; simple & rdquo; interfaces can be cast into more & ldquo; advanced & rdquo; interfaces. Frankly speaking, a useful thing recently emerged is Jax-P. In my mind, there are still some things that JRE does not have, but they must exist. SwingHow long has it been there? However, nothing can be provided to you like VB.5. Data Binding table control.

I think the improvement of JDK 1.5 is very significant. When I talk about & ldquo; Reducing complexity & rdquo;, I really mean a) to give more standard approaches to one thing, therefore, if I really need some different features, I only need an external framework.. B) design more friendly APIs-Seriously, look at javamail.JavaDoc to see how to send an htmlHow long does it take you to email in the format. C) add more general functions to the core runtime environment and provide, The style and performance of RIA and aveon/sparkle in the desktop field. Similarly, I remember the original innocence from VB/VC ++ to JavaWorld, think & ldquo; oh, it should have been like this all the time. & Rdquo; a few years ago, I couldn't say I saw anything added to JavaAnd I have the same idea (except for the coming Jax-ws API ). Look at rails and you will feel the same way. Look at flex and you feel the same way. You feel the same way when you look at aveon. I don't like Ruby, but it looks like JavaI am no longer frustrated by keeping pace with the times.

Bill Venners: issuer's Point of View

Artima is a lot of JavaWebsites that developers are highly interested in. For a long time, its issuer Bill Venners is a JavaAuthor and consultant. It is also a JavaWorld columnist, inside the JavaAuthor of virtual machine. So when we notice the ruby content on artima, we must find the story behind it.

1. artima has always been used as a JavaSite, but you just created a new Ruby layout. Many special articles of artima today are about Ruby. What prompted this change?

Not changed. Artima used to be a clear JavaSite, but a few years ago we expanded our general development focus to cover other languages. For example, we started to integrate Python blogs in & ldquo; Python buzz & rdquo; and published C ++ articles in & ldquo; the C ++ Source & rdquo. We created a ruby code & Style briefing to share information with the ruby community through high-quality, edited articles.

2. Do you think your ruby report is a trend or a developer who has made changes to the service?

We created a ruby briefing just to serve the Ruby community. I don't know if there is a trend, and I haven't seen many JavaDevelopers go to Ruby. People do not just need to program in one language. I want to know a system language, for example, JavaOr C ++, and a scripting language, such as Ruby or Python, and can work with both. In this way, you can use the best tools in your hands to work.

3. Your first few Ruby articles hardly touched on rails. Do you think there is a big ruby story behind rails? Do you know what Ruby is used?

Besides knowing that rails is a selling point in the market, I don't know much about rails. The rails merchant passes this information over and over again, that is, rails can help you quickly create a webApplication. Everyone clearly receives this message. I think this is a very good marketing job. I also believe this information, but quickly create a webApplications are not only concerned about people. Sometimes people also have relationships with databasesIntegration, Application ServerIn this case, other tools may be more efficient than rails. In Ruby, I think it is a multi-purpose programming language suitable for scripting and system creation. It is similar to Python.

4. Even before rails, compared with other & ldquo; agile & rdquo; languages, people talk about Ruby's unique attraction to Java.Developer. What do you think is special about Ruby? Why does itImmigration so good?

I don't believe there will be a lot of JavaMigration or Ruby is especially suitable for JavaProgrammer. The hype around Ruby may be due to the sale of rails, so perhaps the immigrants you are impressed with come from the claims. Ruby is a good language, but JavaAlso, Python.

5. Do you think we will see a lot of JavaDevelopers start to learn Ruby or go to Ruby, or we will see a new generation skipping JavaAnd replaced by ruby?

JavaWill not leave us. In artima, we chose JavaAs a new architecture, rather than Ruby or Python, it is because it is a mature ecosystem with free and commercial tools and APIs. Compared with JavaYes, there are some improvements in speed when programming with Ruby or Python, but with modern tools like intellij, eclipse. NetJavaIDE, you canIs faster. However, it is quite comfortable to program in Ruby. If someone can find their career in Ruby, please do your best to implement it.

Conclusion

Whether Ruby will sweep Java? Not only are devout Ruby enthusiasts predicting this scene. The developer's point of view is like the best working tool & rdquo; proposed by Venners ;. It is critical that developers are responsible for correctly understanding and using these tools. It is not hard to see that coopper isThe memory of 1.0 of the hype and the predictions of David son & ldquo; nowadays there may be a lot of junk Ruby on Rails Applications in writing & rdquo. It is very dangerous to let the tide of the market wash away without technology. In addition, many people are telling us that using Ruby will greatly improve efficiency. It is indeed an ideal tool, so we should pay attention to it.

I would like to thank Bruce Tate, James Duncan David son, Robert Cooper, and Bill Venners. Thanks for taking their time and onjavaReaders share their ideas.

Related Article

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.