<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:series="http://unfoldingneurons.com/"
><channel><title>Larry Ullman &#187; Ruby</title> <atom:link href="http://www.larryullman.com/category/ruby/feed/" rel="self" type="application/rss+xml" /><link>http://www.larryullman.com</link> <description>Translating Geek Into English</description> <lastBuildDate>Wed, 08 Feb 2012 21:58:37 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Finding Book Bonus Content</title><link>http://www.larryullman.com/2011/12/20/finding-book-bonus-content/</link> <comments>http://www.larryullman.com/2011/12/20/finding-book-bonus-content/#comments</comments> <pubDate>Tue, 20 Dec 2011 19:27:36 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[C and C++]]></category> <category><![CDATA[Flex]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[jsdd]]></category> <category><![CDATA[phpmysql4]]></category> <category><![CDATA[phpvqs4]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2925</guid> <description><![CDATA[For many of my books, bonus content is made available through the publisher. Sometimes this is material that was intended for the book but had to be cut, such as an appendix or a chapter, and sometimes the material is a true bonus, such as a video screencast. Because it&#8217;s not clear for everyone how [...]]]></description> <content:encoded><![CDATA[<p>For many of my books, bonus content is made available through the publisher. Sometimes this is material that was intended for the book but had to be cut, such as an appendix or a chapter, and sometimes the material is a true bonus, such as a video screencast. Because it&#8217;s not clear for everyone how to access this bonus material, I thought I&#8217;d quickly post instructions here.</p><ol><li>Head to <a
href="http://www.peachpit.com">Peachpit.com</a> (almost all of my books are published by Peachpit Press)</li><li>Click on <a
href="https://memberservices.informit.com/my_account/login.aspx?partner=52">Account Sign In</a> at the top of the page.</li><li>If you don&#8217;t already have an account with Peachpit.com, click the <a
href="https://memberservices.informit.com/my_account/register.aspx">Create a new one&#8230;</a> link to register.</li><li>After you have registered, login.</li><li>On your account page (after logging in), click <em>Registered Products</em>.</li><li>On the Registered Products tab, click <em>Register Another Product</em>.</li><li>Follow the instructions to register the book.</li><li>Return to the Registered Products page.</li><li>For the book in question, click the <em>Access Bonus Content</em> link. That will take you to a page with all the bonus content for a given book.</li></ol><p>Besides being able to access bonus content, there are other benefits to registering at Peachpit&#8217;s site. And while you&#8217;re there, you can also check out <a
href="http://www.peachpit.com/authors/bio.aspx?a=2a14d669-06f6-48cf-a5b8-907169808b9f">my author page</a>, which lists the books I&#8217;ve written for Peachpit, the articles I&#8217;ve published there, and the blog postings I&#8217;ve published there. Both the articles and blog postings are viewable without registration or logging in.</p><p>I hope that helps anyone having trouble finding the material they&#8217;re looking for.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/12/20/finding-book-bonus-content/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Programming Video Courses</title><link>http://www.larryullman.com/2011/12/04/programming-video-courses/</link> <comments>http://www.larryullman.com/2011/12/04/programming-video-courses/#comments</comments> <pubDate>Mon, 05 Dec 2011 02:52:16 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[C and C++]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[video]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2885</guid> <description><![CDATA[I&#8217;ve recently come across a couple of free, public programming courses, as a series of videos, that may be of interest to those of you out there (I haven&#8217;t had the time to view many of the individual episodes, but they look promising). The first is an Introduction to Computer Science and Programming, from an [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve recently come across a couple of free, public programming courses, as a series of videos, that may be of interest to those of you out there (I haven&#8217;t had the time to view many of the individual episodes, but they look promising).</p><p>The first is an <a
href="http://academicearth.org/courses/introduction-to-computer-science-and-programming">Introduction to Computer Science and Programming</a>, from an instructor at MIT. It&#8217;s definitely for beginners and although it uses Python as its primary language, the goal is to convey the fundamentals and the theories involved. It probably gets a bit too high-end for some, but worth taking a gander at regardless.</p><p>The second series is <a
href="http://proglit.com/core-units/">programming literacy&#8217;s Core units</a>. This series is much more broad and covers a range of languages and topics. As I write this, the first six units have been completed and are available as YouTube videos, with downloadable PDFs (and other formats) for the slides and notes. On the other hand, the last one was finished about 20 months ago, so there may never be more in the series. Still, it&#8217;s approachable and I like that the materials are available for viewing separately. And the price is right!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/12/04/programming-video-courses/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>What is Larry Thinking? #36 =&gt; Becoming a Better Programmer and More!</title><link>http://www.larryullman.com/2011/02/01/what-is-larry-thinking-36-becoming-a-better-programmer-and-more/</link> <comments>http://www.larryullman.com/2011/02/01/what-is-larry-thinking-36-becoming-a-better-programmer-and-more/#comments</comments> <pubDate>Tue, 01 Feb 2011 14:45:22 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[mvc]]></category> <category><![CDATA[newsletter]]></category> <category><![CDATA[yii]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2260</guid> <description><![CDATA[In this edition&#8230; About This Newsletter On the Web => Colibri for Windows On the Web => &#8220;Learning the Yii Framework&#8221; Series in French! On the Blog => Creating Forms with the Yii Framework On the Blog => Markdown and MultiMarkdown Q&#38;A => What happened to Ruby on Rails? Q&#38;A => What is the Benefit [...]]]></description> <content:encoded><![CDATA[<p> In this edition&#8230;</p><ul><li><a
href="#about">About This Newsletter</a></li><li><a
href="#web1">On the Web => Colibri for Windows</a></li><li><a
href="#web2">On the Web => &#8220;Learning the Yii Framework&#8221; Series in French!</a></li><li><a
href="#blog1">On the Blog => Creating Forms with the Yii Framework</a></li><li><a
href="#blog2">On the Blog => Markdown and MultiMarkdown</a></li><li><a
href="#qa1">Q&amp;A => What happened to Ruby on Rails?</a></li><li><a
href="#qa2">Q&amp;A => What is the Benefit of the Model in MVC?</a></li><li><a
href="#thinking">What is Larry Thinking => Becoming a Better Programmer</a></li><li><a
href="#news">Larry Ullman&#8217;s Book News => &#8220;PHP for the Web&#8221;, &#8220;PHP and MySQL for Dynamic Web Sites&#8221;, and More!</a></li></ul><h2 id="about">About This Newsletter</h2><p>No real theme to this newsletter: a couple of links to interesting things online, recommendations of two blog postings to consider, answers to two recently submitted questions, and some news. I turned a frequently asked question into a &#8220;What is Larry Thinking?&#8221; topic: how to become a better programmer. I&#8217;ll follow up on that topic in a future newsletter, too. Other forthcoming subjects include: starting a new Web site/business, making a career out of programming, and how to organically grow a Web site.</p><p>As always, questions, comments, and all feedback are much appreciated. And thanks for your interest in what I have to say and do!</p><h2 id="web1">On the Web => Colibri for Windows</h2><p>As you may know, I primarily use a Mac, so I tend to be less aware of the good stuff available for those of you—okay, the <em>majority</em> of you—on Windows. One Mac product that I used to rely heavily upon is <a
href="http://qsapp.com/">QuickSilver</a>. QuickSilver is an application and document launcher, system navigator, utility, jack-of-all-trades. QuickSilver is free, extendable, and quite excellent. Unfortunately, or fortunately for him, the developer that created QuickSilver was hired by Google to create a somewhat similar product for them called <a
href="http://code.google.com/p/qsb-mac/">Quick Search Box for Mac</a>. So I have since returned to <a
href="http://www.obdev.at/products/launchbar/index.html">LaunchBar</a>, with which I&#8217;m also quite pleased. But this blip isn&#8217;t about good Mac software, this is about <a
href="http://colibri.leetspeak.org/">Colibri</a> for Windows.</p><p>I have no idea where or how, but I recently came across Colibri as a Windows equivalent to QuickSilver. Naturally this caught my attention. And although I haven&#8217;t used it myself, I thought it worth mentioning, because if it&#8217;s anything like QuickSilver or LaunchBar, some of you Windows power users will really appreciate it. With Colibri, you can control iTunes, interact with Firefox, perform Web searches, launch applications, and more, all from an interface that appears by pressing the right key combination. Oh, and it&#8217;s free! One negative from the research I&#8217;ve done is that the documentation isn&#8217;t great, at least not online. But still, Colibri may be worth considering.</p><h2 id="web2">On the Web => &#8220;Learning the Yii Framework&#8221; Series in French!</h2><p>Nico, from <a
href="http://www.memorandom.fr">Mémorandom</a>, recently contacted me about translating my popular <a
href="http://www.larryullman.com/series/learning-the-yii-framework/">Learning the Yii Framework</a> into French and publishing it on that site. I&#8217;m pleased to say that the first five parts of the series have already been translated and are available online:</p><ul><li><p><a
href="http://www.memorandom.fr/php/introduction-au-framework-yii/">Introduction to the Yii Framework</a></p></li><li><p><a
href="http://www.memorandom.fr/php/commencer-avec-yii-framework/">Getting Started with the Yii Framework</a></p></li><li><p><a
href="http://www.memorandom.fr/php/configuration-de-yii/">Configuring Yii</a></p></li><li><p><a
href="http://www.memorandom.fr/php/definir-une-base-de-donnees-pour-notre-application-yii/">Defining Databases for the Yii Application</a></p></li><li><p><a
href="http://www.memorandom.fr/php/creer-les-modeles-les-vues-et-les-controleurs-dans-yii/">Creating Models, Views, and Controllers in Yii</a></p></li></ul><p>The posted translation should hopefully help expand Yii&#8217;s international influence. My thanks to Nico for the nice words on my series and for the work in translating it!</p><h2 id="blog1">On the Blog => Creating Forms with the Yii Framework</h2><p>HTML forms are one of the key pieces of any Web site, providing an easy way to get data from the user. But, as is the case with many things, creating forms while using a framework such as Yii is significantly different than creating forms using standard HTML alone. <a
href="http://www.larryullman.com/2011/01/20/creating-forms-with-the-yii-framework/">In a recent post</a>, I covered what you need to know to get started creating HTML forms when using the Yii framework.</p><h2 id="blog2">On the Blog => Markdown and MultiMarkdown</h2><p>In previous newsletters I&#8217;ve made reference to Markdown and MultiMarkdown, two of my favorite new technologies (well, new to me). The one is an extension of the other and both allow you to write more naturally, without concern for formatting, and then output that text in HTML and other formats. I&#8217;ve been using Markdown for my newsletter for a couple of months now and plan on using MultiMarkdown when I begin self-publishing books this year.<br
/> You can read a quick introduction to both technologies, and see where to head for more information, <a
href="http://www.larryullman.com/2011/01/08/markdown-and-multimarkdown/">in this blog post</a>.</p><h2 id="qa1">Q&amp;A => What happened to Ruby on Rails?</h2><p>Jason sent me this question, pointing out that &#8220;It was all the rage a while back&#8221;. True, true. So what did happen?</p><p>First, I&#8217;ll say that I adore <a
href="http://www.ruby-lang.org/">Ruby</a>. It&#8217;s a beautiful language, odd as that may sound. If I need to create non-graphical utilities or scripts to be executed via a command line, Ruby is my language of choice. Ruby has great power yet simplicity, and is more object-oriented than most (e.g., any number in Ruby is itself an object). And <a
href="http://rubyonrails.org/">Rails</a> is a great framework for doing Web development. It does a lot of the work for you and has outstanding features. In fact, Rails recently came out with version 3, which was a major revamping, integrating features that cropped up in Ruby-based alternatives to the Rails framework.</p><p>Anyway, I suspect part of the reason that Rails doesn&#8217;t get the attention it once did is that it&#8217;s no longer &#8220;new&#8221;. Secondarily, I think the impression of Rails was severely damaged by what happened with Twitter. Twitter was originally written using Ruby on Rails but Twitter got to a point where the site wasn&#8217;t able to handle its demand. Rightly or not (probably some of both), Ruby on Rails took the brunt of the bad press for the outages. I would argue that one can&#8217;t use Twitter as a reasonable benchmark, though, as very few—perhaps only a handful—of sites have the same level of activity as Twitter. I suspect that most sites would crash if they started seeing that kind of demand. Poor scalability is not a problem of Ruby on Rails. In fact, honestly, I don&#8217;t know that <em>any</em> technology has inherently poor scalability, but that all technologies will degrade under high loads, if not optimized for demanding conditions.</p><p>To be fair, performance is a concern whenever you use a framework. Framework-based applications, by definition, are going to be more bloated and slower than non-framework applications. That&#8217;s just the way it is and will be. In turn, one gets much faster development with a framework. In any case, I know Twitter eventually replaced their Ruby on Rails code with something else (written in <a
href="http://www.scala-lang.org/">Scala</a>, I believe), but Groupon and Hulu use Ruby on Rails, and these are also very demanding sites.</p><p>Finally, as for myself, despite my affection for Ruby and Ruby on Rails, the reason I don&#8217;t regularly use RoR for Web sites is because there&#8217;s now a good, comparable PHP framework (for me, that&#8217;s <a
href="http://www.yiiframework.com">Yii</a>). I had been programming with PHP for several years before learning Ruby and Rails. When I came across RoR, there was no PHP framework like it. But I&#8217;ve since found, and grown quite fond of, Yii, so my need for a quick development Web framework has been met, allowing me to use PHP, the language that I&#8217;m still most comfortable with.</p><h2 id="qa2">Q&amp;A => What is the Benefit of the Model in MVC?</h2><p>The MVC design pattern, short for &#8220;Model, View, Controller&#8221;, has become an extremely common way to write software and is used by most, if not all, major frameworks. But the MVC approach is not necessarily intuitive and can be confusing, or simply hard to properly implement, for beginners. Brett, for example, sent in this very reasonable question:</p><blockquote><p>&#8220;Views and Controllers make sense to me, but have a Model to pull out data and then to have a<br
/> View call it, doesn&#8217;t seem to flow that well in my head. What are the benefits of using Models?&#8221;</p></blockquote><p>In case you&#8217;re not familiar with MVC, the View is what the user sees and interacts with. On a Web site, this means HTML, with a dab of PHP embedded as necessary (e.g., to echo the value of a given variable). The Model represents a set of data. Often a Model corresponds to a particular database table, with an instance of the Model representing a particular row from that table. Models can also represent data sets not being permanently stored, such as the contents of a contact form, which get emailed instead. The Controller is the agent between the View and the Model. The Controller responds to user actions, such as requesting a specific page (in which case the Controller loads any necessary Model and then renders the proper View) or handling a form submission (in which case the Controller may create a new instance of a Model based upon the submitted data, then save the Model, and then render a different View). An important aspect of MVC is that Controllers should actually be lightweight, in terms of code. The applicable adage is &#8220;thin Controllers, fat Models.&#8221; The most common design error by beginning MVC-ers (?) is to put too much logic and functionality into the Controller, instead of in the Model where it belongs. But why?</p><p>Let&#8217;s quickly think about the Controller. The Controller responds to user actions and quite frequently then loads an instance of a Model which the Controller then passes to the View. Much of the Controller logic is not really particular to a given application, but rather slight variations on common themes. With a site for managing employees, the Controller&#8217;s actions would entail: listing all employees, viewing a particular employee, searching for employees, adding a new employee, updating an existing employee, and deleting a particular employee. Now say the site is for managing an inventory of products (like on an e-commerce site). In that case, the Controller&#8217;s actions include: listing all products, viewing a particular product, searching for products, adding new products, updating existing products, and deleting existing products, among others. As you can see, there&#8217;s a lot of repetition here, the only difference being the swap of &#8220;employee&#8221; for &#8220;product&#8221;. This is to say, the only difference is the Model itself. And that&#8217;s why the Model is so critical: because it is the heart of an application. When you&#8217;re deciding what a site is about, and when you&#8217;re designing the database, you&#8217;re dealing with the Model. The same Model will be used by many different Controller actions and View files. So let&#8217;s look at the Model in detail&#8230;</p><p>The Model represents the data, but what does that mean? It means, for one, that a Model defines the properties for an object, like a &#8220;user&#8221; object has a first name, last name, email address, password, etc. The Model also defines the validation routines that any data set must pass: the email address must be a valid email address, the user level must be an integer, the date entered value is the current moment upon insert, etc. Whether a new Model is being created or an existing Model is being updated, the same validation rules will apply.</p><p>Models also sometimes have custom functions for returning formatted properties. Models shouldn&#8217;t output HTML, but a user Model might have a function that returns the user&#8217;s name in the format <em>Last Name, First Name MI.</em>. Or a user Model might have a &#8220;member since&#8221; function that returns the user&#8217;s registration date in a particular format (not the database timestamp). By putting this functionality in the Model, any View can make use of it. If that functionality were defined in a Controller or View, then only that Controller or View could benefit.</p><p>Just as the majority of Controller code may be the same from site to site, some of the Models can be exactly the same from one site to another, or just slightly different. If you&#8217;ve created a user Model that does everything you need it to do, it&#8217;s likely that the same Model can be used on multiple sites (this, of course, is a benefit of object-oriented programming in general). With the MVC architecture, the biggest differences from one project to the next are therefore the Models you define and the corresponding Views.</p><p>Coincidentally, the Yii framework&#8217;s site just posted a nice article titled <a
href="http://www.yiiframework.com/doc/guide/1.1/en/basics.best-practices">Best MVC Practices</a>, which you may benefit from reading, whether you use Yii or not.</p><h2 id="thinking">What is Larry Thinking => Becoming a Better Programmer</h2><p>How one becomes a good programmer is one of the most common questions I see, especially from those just getting started. A reader purchases one of my books because they want to learn X, and then they want to know how long before they&#8217;re an expert programmer. The answer to that particular question—how long—is short and sweet: I have no idea. It really depends upon who you are, what you already know, how you learn, and so forth. But many people, when they ask you a question, don&#8217;t care for the &#8220;I have no idea&#8221; answer, even if, or especially, if that&#8217;s the correct answer. So rather than answer <em>that</em> question, I thought I&#8217;d take a moment to discuss the more appropriate question of &#8220;How do I become a better programmer?&#8221; The key is &#8220;better&#8221; as opposed to &#8220;good,&#8221; &#8220;expert,&#8221; &#8220;master,&#8221; and the like.</p><p>Perhaps it&#8217;s merely semantics, but one shouldn&#8217;t aspire to be a good programmer, but rather a <em>better</em> programmer. Like, well, almost every job, a programmer does not have a fixed end that one gets to. I&#8217;ve been programming actively for going on 12 years now and, whether I&#8217;m currently a good programmer or not, my hope is that next month I&#8217;ll be a better programmer than I am today. So how do I, or anyone, work towards being a better programmer?</p><h3>Read. Do. Review.</h3><p>Pithy things are easier to remember and just sound more true, so I&#8217;ve assembled all my thoughts into those three words: Read. Do. Review.</p><h4>Read.</h4><p>There are plenty of tasks you can pull off without reading a thing, such as changing a tire or unclogging a sink, but you can&#8217;t learn to program without reading something: a book, a manual, articles, whatever. Programming simply does not allow for blind guesses. Now clearly, my books are the best way to learn anything and should always be your first stop on a new path. This cannot be denied. (I really am joking.) But even after reading all of my books multiple times over, there&#8217;s probably a benefit of reading other writers&#8217; books (blasphemy), to get a different perspective. Assuming you&#8217;re a book-reader type, that is.</p><p>Books do three things well. First, they can teach beginners effectively. Second, they can show how to apply knowledge. Third, they provide a cohesive body of information. I&#8217;m a book person and a book writer, so I&#8217;m completely biased, but I think that reading books about programming is always for the best. I still read books by other writers, even if they&#8217;re on the same subject and targeting the same audience as some of my books. Always good to see what others are thinking!</p><p>I mention manuals second for three reasons. First, not all programming languages or technologies have actual manuals, let alone good ones (the PHP manual is pretty good, in my opinion). Second, manuals tend to promote syntax and functionality above real-world implementation. Third, manuals tend to be written by committee, thereby lacking cohesion. On the other hand, in theory, manuals will always be the most up to date of the available options.</p><p>Articles are a great way to learn new tricks, of course. You might think this means reading an article on a specific subject only if you want to learn about that subject, but you might get some value by seeing tangential code. For example, say an article is on creating an RSS feed using PHP and MySQL. You might not need to do this, but in reading the article, you could learn something about PHP and MySQL, about XML, and so forth. And again, you&#8217;d get a different writer&#8217;s perspective and approach.</p><h4>Do.</h4><p>The second step is to simple: program. You can&#8217;t really learn or improve without doing. If you don&#8217;t have actual programming work to do, then come up with your own idea and implement it. In a way, programmers, Web developers, and the like are quite fortunate, as they can practice, learn new things, create functional projects, etc., without spending a dime (or without spending much money). Many other professions, such as architects, don&#8217;t have that luxury. So take advantage of that freedom!</p><h4>Review.</h4><p>I suspect most programmers focus on the &#8220;doing&#8221; and spend very little time on the &#8220;reviewing,&#8221; which I believe is probably more important in the long run. I don&#8217;t mean testing, which is necessary, too, but actual code reviews. Are the comments still thorough and accurate? Does the code make assumptions? Are errors handled gracefully? Is the code properly formatted? Is it consistent in terms of formatting, syntax, variable names, and the like? Most programmers, in time, can make things work. It&#8217;s these other points that differentiate the average programmer from a better one. But don&#8217;t stop after reviewing your code&#8230;</p><p>You should review other people&#8217;s code. See what they did. Does it make sense? Does it adhere to the same principles just outlined? What does that code do differently than the code you&#8217;d write? Is one approach better? If so, why? I&#8217;ve become a better programmer (and a better writer) by providing support in <a
href="http://www.larryullman.com/forum/">my forums</a>. In looking at what other people did, and helping them solve problems, I&#8217;ve learned a ton. And I know that the handful of other people that are kind enough to donate their time to assist feel this way as well (and my unending gratitude to them).</p><p>A key learning tool when reviewing code is explaining what code does. There&#8217;s a related debugging approach called <a
href="http://www.larryullman.com/2010/12/04/rubber-duck-debugging/">rubber duck debugging</a> that&#8217;s similar to what I&#8217;m suggesting here. One level of programming knowledge is getting something to work. A higher level is understanding <em>why</em> it works. An even higher level is being able to <em>explain why</em> it works. I know I&#8217;ve become a better programmer by writing books, although that&#8217;s a pretty steep and unreasonable step for many to take! A few times, though, as I write a book I&#8217;m explaining why I used such and such code, and in the process of explaining, I realized that the approach could be improved. You don&#8217;t actually have to write a book or sit someone down, but go through code some time and try to explain why it&#8217;s doing what it&#8217;s doing. You&#8217;ll learn a lot.</p><h4>And&#8230;</h4><p>In a subsequent newsletter, I&#8217;ll write a bit about what general and specific skills are critical to being a better programmer, but I wanted to just focus on the process of improving here. What did I omit? Formal training and certification. Formal training, be it a school course or not, is a great way to become a better programmer, which I think goes without saying. Or it should be a great way, as not all classes or teachers are alike (true for books, as well). As for certifications, I understand they can help you get a job, but I don&#8217;t put much faith in passing a certification test as a way of becoming a better programmer. You can certainly learn some technicalities that way, but I doubt you&#8217;ll learn that much in terms of real-world knowledge and the ability to apply information.</p><h2 id="news">Larry Ullman&#8217;s Book News => &#8220;PHP for the Web&#8221;, &#8220;PHP and MySQL for Dynamic Web Sites&#8221;, and More!</h2><p>As mentioned in my previous two newsletters, I&#8217;ve been writing some articles and blog posts for <a
href="http://www.Peachpit.com">Peachpit Press&#8217;s Web site</a>, all supporting my <a
href="http://www.larryullman.com/books/effortless-e-commerce-with-php-and-mysql/">Effortless E-Commerce with PHP and MySQL</a> book. I&#8217;ll post links to them on my Web site, and in future newsletters, as they go live.</p><p>I&#8217;ve wrapped the first draft of the the fourth edition of &#8220;PHP for the Web: Visual QuickStart Guide&#8221; and am almost through with the rewrites. Along with fixing any minor problems, updating the code for the latest version of PHP, and adding a &#8220;Review and Pursue&#8221; section to the end of each chapter, I&#8217;ve been able to add a new chapter. That chapter will replace the original Chapter 13, &#8220;Regular Expressions,&#8221; as the <strong>ereg()</strong> function has been deprecated in PHP 5.3. The new chapter is called &#8220;Putting It All Together&#8221; and will show how to use everything covered in the book to assemble a mini-Web application, with authentication and full <em>CRUD</em> (Create, Retrieve, Update, and Delete) functionality. The chapter is similar to the three popular example chapters in my &#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide&#8221; book, although using a different example.</p><p>In February, I start writing the fourth edition of my &#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide.&#8221; It will also have a &#8220;Review and Pursue&#8221; section added to the end of each chapter. I&#8217;m also going to clean it up a bit, and remove references to PHP 6, which, in the time from when I started writing the third edition to started writing the fourth edition, went from about 50% complete to limbo to non-existent. So that&#8217;s the last time I&#8217;m going to try to be that far out ahead of the curve.</p><p>I am also planning on working on my self-published JavaScript book starting in February as well. I&#8217;ll try to dedicate some time to it and, as I&#8217;m publishing it myself and writing it using MulitMarkdown, I&#8217;ll be able to post free, HTML sections from the book online as I go. Thanks to everyone for their continued support and interest on this new book!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/02/01/what-is-larry-thinking-36-becoming-a-better-programmer-and-more/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Understanding MVC: Coding</title><link>http://www.larryullman.com/2009/10/15/understanding-mvc-part-3/</link> <comments>http://www.larryullman.com/2009/10/15/understanding-mvc-part-3/#comments</comments> <pubDate>Thu, 15 Oct 2009 19:11:02 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[mvc]]></category> <category><![CDATA[yii]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=523</guid> <description><![CDATA[In the on this series about the MVC (Model-View-Controller) design pattern, I discuss the individual parts and what they represent. In the , I layout some common conventions of MVC frameworks. Both of those posts lead up to this one, in which I want to talk about actual code. In my opinion, it&#8217;s not too [...]]]></description> <content:encoded><![CDATA[<p>In the <a
href="http://www.larryullman.com/2009/10/08/understanding-mvc/">first part</a> on this series about the MVC (Model-View-Controller) design pattern, I discuss the individual parts and what they represent. In the <a
href="http://www.larryullman.com/2009/10/10/understanding-mvc-part-2/">second part</a>, I layout some common conventions of MVC frameworks. Both of those posts lead up to this one, in which I want to talk about actual code. In my opinion, it&#8217;s not too hard to understand what MVC means, in theory, or to follow a framework&#8217;s naming rules, but then you start developing a project and can quickly become confused as to <em>where you actually put your code</em>.</p><p><span
id="more-523"></span>The problem in properly executing the MVC architecture for many people is that it runs contrary to what they&#8217;ve done thus far. If you&#8217;re a PHP programmer creating a page that lists every department (in an employees-departments application), you&#8217;d likely have a PHP script that:</p><ol><li>Generates the initial HTML, including the HEAD and the start of the BODY</li><li>Connects to the database</li><li>Queries the database</li><li>(Hopefully) confirms that there are query results</li><li>Retrieves the query results in a loop</li><li>Prints the query results within some HTML, perhaps a table or a list</li><li>Frees the query results and closes the database connection (maybe, maybe not)</li><li>Completes the HTML page.</li></ol><p>And that&#8217;s what&#8217;s required in a rather basic page. Even if you use included files for the database connection and the HTML template, there&#8217;s still a lot going on. And if you link those department pages to another page that shows more information about the department, passing along the department ID in the URL, that other page will need to add some data validation steps. And if you have a page that both displays and handles a form, like for adding an employee, there&#8217;s way, way more code and logic to add. Not that there&#8217;s anything wrong with this, mind you—I still program this way  as warranted—but it&#8217;s the antithesis of what MVC programming is about. You can think of MVC programming like a pyramid, with the Model at the bottom, the Controller in the middle, and the View at the top. The code should be distributed appropriately, with most of it in the Model, some in the Controller, and very little in the View.</p><p><a
href="http://cloudfront.larryullman.com/wp-content/uploads/2009/10/mvc_pyramid.png"><img
class="aligncenter size-medium wp-image-529" title="MVC Pyramid" src="http://cloudfront.larryullman.com/wp-content/uploads/2009/10/mvc_pyramid-300x257.png" alt="MVC Pyramid" width="300" height="257" /></a></p><p>From a programming standpoint, a View should do very little, mostly just echo out the values of variables. The most logic a View should have is using a conditional to confirm that a variable has a value before attempting to print it or creating a loop to print out all the values in an array. The View generates what the user sees, that&#8217;s it. The Controller has more logic and code to it, as it responds to user actions, and acts as an interface between Models and Views. But it&#8217;s a common mistake to put code in a Controller that should really go in a Model. A guiding principle of MVC design is &#8220;fat model, thin (or skinny) controller&#8221;. This means you should keep pushing your code down to the foundation of the application (aka, the pyramid&#8217;s base, the Model). <a
href="http://blog.astrumfutura.com/archives/353-An-Example-Zend-Framework-Blog-Application-Part-2-The-MVC-Application-Architecture.html">In a post I saw about the MVC architecture</a>, they describe the Model as &#8220;maintaining state&#8221; between HTTP requests. I think that&#8217;s a good way of describing it because it encompasses both stored data and processed data that doesn&#8217;t necessarily get stored. So a departments Model represents stored data that is added, updated, and retrieved in multiple requests, while a contact Model represents data entered by a user in a form, validated, and sent in an email.</p><p>(As a a complete aside, there are some <a
href="http://railsenvy.com/tag/videos">very well done, very funny videos</a> on MVC available at <a
href="http://www.railsenvy.com">RailsEnvy.com</a>. In particular, watch the ones called &#8220;Controller Obesity&#8221; and &#8220;Keeping Views Stupid&#8221;.)</p><p>So what does this mean in actual code? Well, to start, if your View contains more than echo/print, and the occasional control structure, you&#8217;re possibly doing something wrong. If you&#8217;re creating new variables in a View, you&#8217;re probably doing something wrong. In fact, so little PHP code goes into a View, that even printing out something in a loop is normally done like this, with the emphasis on the HTML:</p><pre>&lt;?php foreach($departments as $n=&gt;$dept): ?&gt;
&lt;li&gt;&lt;?php echo $dept-&gt;something; ?&gt;&lt;/li&gt;
&lt;?php endforeach; ?&gt;</pre><p>This is opposed to what one might do in a common PHP approach, with the emphasis on the PHP:</p><pre>&lt;?php
foreach($departments as $n=&gt;$dept) {
    echo '&lt;li&gt;' . $dept-&gt;something . '&lt;/li&gt;';
}
?&gt;</pre><p>Now the code in the Controller is largely about&#8230;um&#8230;controlling the action, i.e., delegating responsibilities and reactions, responding to user input, etc. Controllers are classes, filled with methods that do the actual work. The work is largely retrieving specific Models (e.g., one record from a table or every record), calling upon a Model to be inserted, updated, or deleted, and calling upon a View to be rendered. The Model does everything else, like running the actual queries, validating the data, and so forth. However, in a framework, most of that code is built into the framework itself, so you can call a save or delete method on a Model, but the Model itself doesn&#8217;t have any such method defined (the Model inherits those methods from a framework class on which it&#8217;s derived).</p><p>Going back to an employees-departments example, say you want the page that lists the departments to also display each department head&#8217;s name. Presumably the employee ID of the person that is the department head would be stored in the department Model, like employee #14 is the head of Human Resources. To start, the Controller retrieves all the departments using that Model (this is Yii framework syntax):</p><pre>$departments = Departments::model()-&gt;findAll();</pre><p>The <strong>$departments</strong> variable gets passed along to the View so it can print them all out. This is basic MVC using Yii where, again, the departments Model doesn&#8217;t actually define a <strong>findAll()</strong> method, it just inherits one.</p><p>Now you also need to find the department head&#8217;s name for each department so that the View can display that. To find that person&#8217;s name, you&#8217;d need to fetch an employee Model whose employee ID matches the stored ID in the department Model. Using the <a
href="http://www.yiiframework.com">Yii PHP framework</a>, that code is</p><pre>$emp = Employees::model()-&gt;findByPk($dept-&gt;departmentHeadId);</pre><p>There you&#8217;re saying that you want to find the employee Model whose primary key value is the same as the <strong>departmentHeadId</strong> value in a given department Model.</p><p>What you absolutely don&#8217;t want to do is run that code or any similar query in the View. Very bad! Now, you might be inclined to put that code in the Controller, but in order to do that, you&#8217;d need to loop through each retrieved department, fetch the <strong>departmentHeadId</strong>, find the employee with that primary key value, and then associate the retrieved info with the department. Or you could retrieve all the employees and have the View find the corresponding employee record. In either case, it&#8217;s way too much code and logic to be outside of the Model.</p><p>To be clear, Yii, and other frameworks, support joins across Models, so in Yii, you&#8217;d do this (after identifying the relationship between the models):</p><pre>$departments = Departments::model()-&gt;with('employees')-&gt;findAll();</pre><p>But if that wasn&#8217;t an option in your framework, or if the two Models didn&#8217;t have a real, defined relationship, you could add this method to the department Model:</p><pre>function getDepartmentHead() {
    $emp = Employees::model()-&gt;findByPk($this-&gt;departmentHeadId);
    if ($emp) {
        return "$emp-&gt;lastName, $emp-&gt;firstName";
    } else {
        return 'unknown';
    }
}</pre><p>Once this is defined, you still wouldn&#8217;t need to add any code to the Controller, you could just do this in the View, within the foreach loop:</p><pre>echo $dept-&gt;getDepartmentHead;</pre><p>As another example, say you want to display employees names in the format <em>LastName, FirstName</em>, or something more elaborate. If you write a method that does that, defined in the employees Model, you can call that method anywhere that uses an employees Model and that might require showing the person&#8217;s name. This would include the page that lists all employees, the page that shows the information for just one employee, and the page that shows the head of a department. For example, in the above <strong>getDepartmentHead()</strong> method, you could return <strong>$emp-&gt;getFormattedName()</strong>.</p><p>Whew! So, per my usual habits, this post has become far longer than I expected. I hope that I achieved my goal of explaining MVC using real-world examples, in a way that illuminates and clarifies this approach. If I haven&#8217;t, let me know and I&#8217;ll expand upon this in a subsequent post. As a postscript, a few hours after originally posting this, I touched up the last few paragraphs, adding more code to better illustrate the point (perhaps).</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2009/10/15/understanding-mvc-part-3/feed/</wfw:commentRss> <slash:comments>44</slash:comments> <series:name><![CDATA[Understanding MVC]]></series:name> </item> <item><title>JetBrains&#8217;s RubyMine IDE</title><link>http://www.larryullman.com/2009/04/28/jetbrainss-rubymine-ide/</link> <comments>http://www.larryullman.com/2009/04/28/jetbrainss-rubymine-ide/#comments</comments> <pubDate>Tue, 28 Apr 2009 13:42:45 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Ruby]]></category> <category><![CDATA[ide]]></category> <category><![CDATA[rails]]></category> <category><![CDATA[software]]></category><guid
isPermaLink="false">http://blog.dmcinsights.com/?p=404</guid> <description><![CDATA[JetBrains just released version 1 of a new Ruby and Ruby on Rails IDE called RubyMine. It features everything you&#8217;d expect in an IDE, like code completion, project navigation, HTML/CSS/JS editing, version control software (VCS) support, plus lots of Ruby and Rails-specific features. Version 1.1 of RubyMine is expected in May, with support for version [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://www.jetbrains.com">JetBrains</a> just released version 1 of a new <a
href="http://www.ruby-lang.org/">Ruby</a> and <a
href="http://rubyonrails.org/">Ruby on Rails</a> IDE called <a
href="http://www.jetbrains.com/ruby/index.html">RubyMine</a>. It features everything you&#8217;d expect in an IDE, like code completion, project navigation, HTML/CSS/JS editing, version control software (VCS) support, plus lots of Ruby and Rails-specific features. Version 1.1 of RubyMine is expected in May, with support for version 2.3 of Rails (a significant upgrade). The software is available under two licenses, one (free) for open-source projects and another commercial license ($99 US at the time of this writing).</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2009/04/28/jetbrainss-rubymine-ide/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Benchmarking Web Sites using Siege</title><link>http://www.larryullman.com/2009/01/11/benchmarking-web-sites-using-siege/</link> <comments>http://www.larryullman.com/2009/01/11/benchmarking-web-sites-using-siege/#comments</comments> <pubDate>Sun, 11 Jan 2009 16:58:01 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[performance]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=130</guid> <description><![CDATA[Benchmarking a Web site is the simple act of measuring its performance. Measurements may look at how long it takes a page to load in the client (see my post on the YSlow Firefox plug-in). This can be a reflection of the page itself—the amount of images, HTML, JavaScript, CSS, and other media—and a reflection [...]]]></description> <content:encoded><![CDATA[<p>Benchmarking a Web site is the simple act of measuring its performance. Measurements may look at how long it takes a page to load in the client (<a
href="http://www.larryullman.com/2009/01/06/speeding-up-web-sites-using-yahoo-yslow/">see my post on the YSlow Firefox plug-in</a>). This can be a reflection of the page itself—the amount of images, HTML, JavaScript, CSS, and other media—and a reflection of the client: their download speed, their computer speed, the browser they&#8217;re using, etc. Because of the client-side factors, this kind of benchmarking is best, I feel, to just analyze the amount of information being downloaded and how efficiently that&#8217;s taking place (again, <a
href="http://www.larryullman.com/2009/01/06/speeding-up-web-sites-using-yahoo-yslow/">see YSlow for more on this</a>).</p><p>On the other side of the equation, you can perform benchmarks on the server. Finding, and later improving upon, these measurements will improve the experience for all clients, regardless of download speed, computer, or browser type. This is particular important when using server-side technologies like <a
href="http://www.php.net">PHP</a>.</p><p>Among the many utilities available to benchmark a Web site is <a
href="http://www.joedog.org/index/siege-home">Siege</a>, from <a
href="http://www.joedog.org/">Joe Dog Software</a>. One of the nice things about Siege, besides it being free, is that it tests a Web server under duress, something that&#8217;s impossible for a single individual to replicate. So you can tell Siege to access your site using X number of simulataneous connections and then see the result. On the downside, you have to compile it on Unix-like systems, including Mac OS X, in order to use it. For more, see the Siege Web site and it&#8217;s simple-to-follow manual.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2009/01/11/benchmarking-web-sites-using-siege/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Rails and Merb Ruby Frameworks to Merge</title><link>http://www.larryullman.com/2008/12/30/rails-and-merb-ruby-frameworks-to-merge/</link> <comments>http://www.larryullman.com/2008/12/30/rails-and-merb-ruby-frameworks-to-merge/#comments</comments> <pubDate>Tue, 30 Dec 2008 21:58:56 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Ruby]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[rails]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=116</guid> <description><![CDATA[A couple of months ago I started hearing about the Merb framework, an alternative to the Rails framework for creating Web sites in Ruby. As you may know, Rails came under some fire for not scaling well; Twitter, in particular, had several problems. (Although I would argue that the demands of a site like Twitter [...]]]></description> <content:encoded><![CDATA[<p>A couple of months ago I started hearing about the <a
href="http://www.merbivore.com/">Merb framework</a>, an alternative to the <a
href="http://rubyonrails.org/">Rails framework</a> for creating Web sites in Ruby. As you may know, Rails came under some fire for not scaling well; <a
href="http://www.twitter.com">Twitter</a>, in particular, had several problems. (Although I would argue that the demands of a site like Twitter are probably in the top 0.1% of all sites, so this concern may not be an issue for most Web sites.) Version 2 of Rails specifically addressed these concerns, but still, people started to look around for alternatives, including not using Ruby at all. This is where Merb came in: a smaller and faster Ruby framework. I hadn&#8217;t yet gotten to play with Merb but was going to add it to my framework-comparison homework. That may be a moot point now, as it was just announced that Merb and Rails will work together on the next version of both frameworks. Version 3 of Rails will incorporate some of Merb&#8217;s best attributes, resulting in a better Ruby framework for Web development and ending a minor feud within the Ruby community. So the next version of Merb will be Rails 3.0 and the next version of Rails will be influenced by Merb: what does this mean?<span
id="more-116"></span>For starters, Rails will ship in a more modular format, with a core version and extra features that can be enabled. This will improve the performance of a Rails site by not including code and functionality that&#8217;s not required. Other features in Merb that will be incorporated include a public API and test suite, as well as some architectural choices. Some of the key players in the framework will be more flexible. For example, you&#8217;ll be able to use the default ActiveRecord <a
href="http://en.wikipedia.org/wiki/Object-relational_mapping">ORM</a> or use another. And you&#8217;ll be able to use different JavaScript libraries.</p><p>The hope is to have a beta of Rails 3 ready by the <a
href="http://en.oreilly.com/rails2009/">May 2009 RailsConf in Las Vegas</a>, although the developers think that&#8217;s &#8220;probably-overly-0ptimistic&#8221;. The next minor release of Rails, 2.3, will come out in January 2009, and Merb will continue to be supported for those currently using it.</p><p>For more information from the people behind both frameworks, and to get a sense of how big this is in the Ruby community, see:</p><ul><li><a
href="http://yehudakatz.com/2008/12/23/rails-and-merb-merge/">http://yehudakatz.com/2008/12/23/rails-and-merb-merge/</a></li><li><a
href="http://weblog.rubyonrails.org/2008/12/23/merb-gets-merged-into-rails-3">http://weblog.rubyonrails.org/2008/12/23/merb-gets-merged-into-rails-3</a></li><li><a
href="http://brainspl.at/articles/2008/12/23/merb-is-rails">http://brainspl.at/articles/2008/12/23/merb-is-rails</a></li><li><a
href="http://splendificent.com/2008/12/the-merb-rails-merger-announcement-an-inside-opinion/">http://splendificent.com/2008/12/the-merb-rails-merger-announcement-an-inside-opinion/</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2008/12/30/rails-and-merb-ruby-frameworks-to-merge/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Ruby, PHP, and Frameworks</title><link>http://www.larryullman.com/2008/11/30/ruby-php-and-frameworks/</link> <comments>http://www.larryullman.com/2008/11/30/ruby-php-and-frameworks/#comments</comments> <pubDate>Sun, 30 Nov 2008 21:19:08 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[about]]></category> <category><![CDATA[framework]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=13</guid> <description><![CDATA[I began my computer consulting career in 1999 as a PHP programmer. For several years, all of the Web sites I created were written in PHP. (I have done a couple of ASP.NET sites, and although I find the technology and the development tools to be impressive, the requirements that you develop and run ASP.NET [...]]]></description> <content:encoded><![CDATA[<p>I began my computer consulting career in 1999 as a <a
href="http://www.php.net">PHP</a> programmer. For several years, all of the Web sites I created were written in PHP. (I have done a couple of <a
href="http://www.asp.net">ASP.NET</a> sites, and although I find the technology and the development tools to be impressive, the requirements that you develop and run ASP.NET on Windows is a non-starter for me.) In 2005, while at the <a
href="http://developer.apple.com/wwdc/">Apple Worldwide Developer Conference</a>, I first played with the <a
href="http://www.rubyonrails.org">Ruby on Rails</a> framework, released a couple of months earlier. So, like many people, I came to Ruby after seeing how brilliant the Rails framework was. At that time, there really were no PHP frameworks that were comparable, although perhaps the <a
href="http://framework.zend.com">Zend Framework</a>, among others, are close enough today. I wanted to talk a bit about how I see PHP and Ruby, but first, a discussion of frameworks&#8230;<span
id="more-13"></span></p><p>Some people have asked if Ruby on Rails really is better than PHP. This isn&#8217;t an appropriate question, however. PHP is a programming language that can be used for many purposes, by far the most common of which is development of dynamic Web sites. (PHP can be used for other purposes, including creating command-line utilities or even graphical applications; it&#8217;s just not used for those purposes nearly as often.) Ruby is also a programming language that can be used for many purposes, perhaps most commonly for command-line and system utilities. In part thanks to eRuby (Embedded Ruby), Ruby can also be used for Web sites. Conversely, Ruby on Rails is a framework written in Ruby. A framework is simply a library of existing code that can be used to facilitate application development. Ruby on Rails is Ruby&#8217;s most popular Web development framework, although not the only one. For PHP, popular frameworks include <a
href="http://pear.php.net">PEAR</a> and <a
href="http://pecl.php.net">PECL</a> (depending upon how you define &#8220;framework&#8221;), <a
href="http://www.symfony-project.org/">Symphony</a>, <a
href="http://cakephp.org/">Cake</a>, and Zend. So any comparisons to be made aren&#8217;t between PHP and Rails but rather PHP and Ruby or the Zend Framework and Ruby on Rails. Over time I&#8217;m going to make this second comparison myself and post the results here.</p><p>As for PHP versus Ruby, I&#8217;ll say that subjectively, PHP is my first love and is still the language I turn to for updating existing Web sites (rather than rewrite them in Ruby) and for creating simple Web pages. I think PHP is really easy to learn and use, especially for those purposes, and both writing in it and debugging it is rather easy.</p><p>Ruby is kind of amazing. It&#8217;s a pretty impressive language with lots of great features. As an object-oriented language, PHP can&#8217;t really compare. The ability to alter existing classes&#8211;even those built into Ruby, like String or Array&#8211;on the fly is fantastic. And I find installing and using <a
href="http://www.rubygems.org/">RubyGems</a> to be easier than PHP&#8217;s PEAR or PECL. When I&#8217;m working with PHP, one thing I miss is Ruby&#8217;s irb, the command-line Ruby interpreter that can be used to test small bits of code.</p><p>I&#8217;ll add some more specifics in future postings but I wanted to put this basic info out there immediately. I will also say that I put little faith in discussions of security or performance when making comparisons. A bad programmer can make really insecure applications using a very secure technology so I think that saying any language or technology is more or less secure is inappropriate. As for performance, there are so many variables there that, again, just saying X is faster than Y is not often meaningful. One of the argument&#8217;s for using Ruby is that it&#8217;s very quick for you, the developer, to use, and your time is far more critical than the computer&#8217;s.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2008/11/30/ruby-php-and-frameworks/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> </channel> </rss>
<!-- Served from: www.larryullman.com @ 2012-02-09 14:36:59 by W3 Total Cache -->
