|  | From Scott Orgera, your About Programming Editor Ruby 2.1.0 is out, and we've got you covered on what's new. 2014's first newsletter also highlights five key reasons why you should be using XML, explains how to connect to MySQL from PHP and much more... | | Five Reasons Why You Should Use XML XML provides a designer with a way to separate data from the format. This fact alone answers the question, "Why should you use XML?" XML is a markup language, in fact, technically it stands for Extensible Markup Language. By design, it is a carrier for information that needs to be incorporated into a document. Simply put, XML is a briefcase where you store data. Consider five reasons you should use it in your designs. | Ruby 2.1.0: Under the Hood Previously, all method invocations were resolved every time a method was called. This means looking backward through the inheritance tree to find the method being referenced. While not particularly slow since a good portion of the methods being called are defined on higher level classes or mixin modules and (generally) the higher the method is in the chain, the smaller the method hashes are. However, as soon as you started calling methods from mixin modules, or from superclasses, the slower Ruby got. As object oriented programming is one of Ruby's main selling points, this was a problem. To try to fix this, a simple global method cache was implemented. | Ruby 2.1.0: Freezing and Scrubbing Strings Strings are a big issue in Ruby when it comes to performance. Every time you declare a Ruby string, a new object is created and the string data copied into it. This means if you have a string literal in your method, every time you call the method a new string object will be created. This is a relatively expensive operation. | Connect to MySQL from PHP Having a database backing your website is very common in PHP. In order to retrieve data from a MySQL database you must first connect to the database and log in. You can do that using the mysql_connect function in PHP. | | | | Related Searches | | | | Featured Articles | | | | | | | | Sign up for more free newsletters on your favorite topics | | | | You are receiving this newsletter because you subscribed to the About.com Programming newsletter. If you wish to change your email address or unsubscribe, please click here. About.com respects your privacy: Our Privacy Policy Contact Information: 1500 Broadway, 6th Floor New York, NY, 10036 © 2013 About.com | | | | | | Advertisement | |