<?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; JavaScript</title> <atom:link href="http://www.larryullman.com/category/javascript/feed/" rel="self" type="application/rss+xml" /><link>http://www.larryullman.com</link> <description>Translating Geek Into English</description> <lastBuildDate>Mon, 21 May 2012 11:03:07 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>What is Larry Thinking? #55 =&gt; Good Companies, Books, and Answers</title><link>http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/</link> <comments>http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#comments</comments> <pubDate>Mon, 21 May 2012 11:03:07 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[book]]></category> <category><![CDATA[hosting]]></category> <category><![CDATA[newsletter]]></category> <category><![CDATA[oop]]></category> <category><![CDATA[regex]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3199</guid> <description><![CDATA[In this edition… About This Newsletter What Were You Thinking? =&#62; Ajax and Search Engines On the Web =&#62; My Web Host, ServInt On the Web =&#62; 37 Tested PHP, Perl, and JavaScript Regular Expressions On the Blog =&#62; Review of &#8220;Technical Blogging&#8221; by Antonio Cangiano Q&#38;A =&#62; Have You Changed Your Opinion of OOP? [...]]]></description> <content:encoded><![CDATA[<p>In this edition…</p><ul><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#about">About This Newsletter</a></li><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#you">What Were You Thinking? =&gt; Ajax and Search Engines</a></li><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#web1">On the Web =&gt; My Web Host, ServInt</a></li><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#web2">On the Web =&gt; 37 Tested PHP, Perl, and JavaScript Regular Expressions</a></li><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#blog">On the Blog =&gt; Review of &#8220;Technical Blogging&#8221; by Antonio Cangiano</a></li><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#qa1">Q&amp;A =&gt; Have You Changed Your Opinion of OOP?</a></li><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#qa2">Q&amp;A =&gt; Why does false equal 0?</a></li><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#news">Larry Ullman&#8217;s Book News =&gt; &#8220;PHP Advanced and Object-Oriented Programming</a></li></ul><p><span
id="more-3199"></span></p><h2 id="about">About This Newsletter</h2><p>So, in case you hadn&#8217;t noticed (or are new to the newsletter), it now has a new template. It&#8217;s a bit more involved than the previous template (two columns instead of just one), but is simpler in other ways, too. The new look will more closely match the updated scheme for <a
href="http://LarryUllman.com">LarryUllman.com</a>, whenever I get around to putting that online (aka, July). Basically what I&#8217;m going with for the updated site is a white background, minimum of images, blue for headings, and, above all, a clear presentation of content.</p><p>To create this newsletter template, I used the template builder from <a
href="http://campaignmonitor.com.">Campaign Monitor</a>, whom I use for these newsletters. Campaign Monitor costs me $30/month (US), but I really think it&#8217;s worth it. They have a good product, and the user interface they&#8217;ve created is tremendous. In any case, I&#8217;m hoping that since I used their system, the resulting template will look reasonably good on most systems and devices.</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="you">What Were You Thinking? =&gt; Ajax and Search Engines</h2><p>In my <a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#qa1">previous newsletter</a>, I answered a question about making Ajax-derived content available to search engines. Yogesh was kind enough to share a link at <a
href="https://developers.google.com/webmasters/ajax-crawling/">Google Developers</a> in which Google explains what else you can do to make Ajax-derived content indexable. Thanks, Yogesh!</p><h2 id="web1">On the Web =&gt; My Web Host, ServInt</h2><p>Since I&#8217;m dishing out accolades (e.g., Campaign Monitor), I&#8217;d like to recognize the company I use for Web hosting: <a
href="http://www.servint.net">ServInt</a>. I&#8217;ve been using ServInt for my Web hosting for almost five years now and I&#8217;m so, so happy with their service. They only provide Virtual Private Servers (VPS) and dedicating hosting, so ServInt is not for everyone. But I think their packages are reasonably priced and their customer service is excellent. Their customer service is excellent! I&#8217;m paying $50 (USD) per month and am happily doing so. I have complete control over my little area of the server and don&#8217;t have to worry about what someone else might have done that would bring my site down. I have a few sites on the server, which garner between 500,000 and 1 million page views per month, and the lowest-level Essential VPS setup handles that easily.</p><p>There are two reasons I&#8217;m mentioning ServInt now. One is that I get asked this question a lot. Although if you&#8217;re not interested in a VPS account, these companies have also been recommended in my <a
href="http://www.larryullman.com/forums/index.php?/topic/132-web-hosting-recommendation/">forums</a>:</p><ul><li><a
href="http://www.dreamhost.com">Dreamhost</a></li><li><a
href="http://www.hostduplex.com">HostDuplex</a></li><li><a
href="http://hostgator.com">HostGator</a></li></ul><p>Besides letting you all know about a good hosting company, if you&#8217;re looking for one, I wanted to thank the people that have used me as a reference when creating his or her own account with ServInt. I don&#8217;t know who has done so, but a couple of people have signed up with ServInt and mentioned me in the past few months, which gives me a small credit on my account. Thanks for that!</p><h2 id="web2">On the Web =&gt; 37 Tested PHP, Perl, and JavaScript Regular Expressions</h2><p>Some time ago I stumbled upon <a
href="http://www.virtuosimedia.com/dev/php/37-tested-php-perl-and-javascript-regular-expressions">37 Tested PHP, Perl, and JavaScript Regular Expressions</a>. This is just a list of 37 Perl-Compatible Regular Expressions (PCRE) that you can use for common purposes: credit card numbers, dates, postal codes, URLs, email addresses, and more. A good resource to have around!</p><h2 id="blog">On the Blog =&gt; Review of &#8220;Technical Blogging&#8221; by Antonio Cangiano</h2><p>I <a
href="http://www.larryullman.com/2012/05/07/review-of-technical-blogging-by-antonio-cangiano/">just recently reviewed</a> the book &#8220;<a
href="http://amzn.to/H6gFcE">Technical Blogging</a>&#8221; by <a
href="http://antoniocangiano.com/">Antonio Cangiano</a>. It&#8217;s a very good book, and one that I&#8217;m happy that I read. For more, check out the <a
href="http://www.larryullman.com/2012/05/07/review-of-technical-blogging-by-antonio-cangiano/">review on my blog</a>.</p><h2 id="qa1">Q&amp;A =&gt; Have You Changed Your Opinion of OOP?</h2><p>In response to my previous newsletter, Marten asked if I have changed my opinion about procedural vs. object-oriented programming. I suspect the question was raised in part because I&#8217;m currently working on &#8220;<a
href="http://amzn.to/M6yvzg">PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide</a>&#8220;. This is something I&#8217;ve discussed in the past, and am happy to go through again. The short answer is no, I have not changed my opinion. And here is what that opinion is:</p><blockquote><p>Procedural programming is better in some situations and OOP is better in some situations.</p></blockquote><p>This is an interesting debate, because PHP is one of the few programming languages that allows you to work procedurally or objectively. You can&#8217;t do procedural code with Java, JavaScript, or Ruby, and you can&#8217;t use objects with C. In PHP, you can <em>choose</em> to use objects or not use objects.</p><p>As for myself, obviously if I&#8217;m using JavaScript, Ruby, or ActionScript, I&#8217;m going to use objects. If I&#8217;m doing C, I&#8217;m not. On some PHP projects, I&#8217;ll use procedural code. On other PHP projects, I&#8217;ll use objects. Obviously any project I do that uses the <a
href="http://www.yiiframework.com">Yii framework</a> will use objects, as most frameworks are OOP in nature. So I&#8217;m totally comfortable with both approaches and I have no preference for one over the other, I always just try to choose the right tool for the job.</p><p>That, of course, is what we should all be doing as developers. There are very few absolutes when it comes to programming; there&#8217;s mostly just opinions. I&#8217;m sure that part of the reason it may have seemed like I didn&#8217;t care for OOP is that I don&#8217;t care for the presumption that OOP is better than procedural programming. OOP has its strengths and weaknesses, as does procedural programming. One is not categorically better or worse than the other. In PHP, which allows for both, there&#8217;s a very strong argument to being comfortable with both approaches so that you, too, can choose the right tool for each job.</p><p>This belief of mine also applies to frameworks. People who are really intro frameworks sometimes assert that programming with frameworks is vastly superior. It&#8217;s not. Not all the time, that is. For some developers, with some projects, a framework is the better choice. For some developers, with some projects, a framework would be the worse choice.</p><p>I like analogies, so I&#8217;ll end this with one: I like tools, I like working around the house and being handy. I have probably about 30 screwdrivers and four electric drill/drivers, including a relatively new, and quite powerful, impact driver. The analogy is that this impact driver (OOP) is the better way to drive a screw, but that&#8217;s patently false. The driver was much more expensive than any screwdriver, and it&#8217;s much heavier, and I need to go looking for the right bit, and I need to keep the batteries charged. And aside from all that, if I had to put a small screw into the back of a picture frame, the impact driver would be a <em>terrible</em> choice. But the same goes for the screwdriver (procedural): if I had to drive a three-inch lag bolt into a post, trying to do that with a screwdriver would be a decision I&#8217;d regret for a long, long time.</p><p>Do away with the assumptions, learn as much as you can, and always try to choose the right tool for the job.</p><h2 id="qa2">Q&amp;A =&gt; Why does false equal 0?</h2><p>Matti sent me this question via Twitter, specifically wondering what the difference is between 0 and 1 and true and false in PHP, and why false equals 0. This is a common point of confusion and cause of many bugs. However, the issue isn&#8217;t with the differences between these values but rather with how conditionals are evaluated and what equality is.</p><p>When you write any conditional in PHP, PHP needs to determine whether that conditional is true or false. For many conditionals, such as comparison, it&#8217;s pretty easy to identify true/false: is <strong>$x</strong> greater than 5 or no? Other conditionals are more subjective, though, and the language needs to define its rules for these situations. For example, <code>if ($x) {</code>. Is that conditional true or false? Well, it depends upon the value of <strong>$x</strong>, of course.</p><p>Obviously, if <strong>$x</strong> has a value of <strong>true</strong>, then the conditional is true. The same goes for <strong>$x</strong> having a value of &#8220;something&#8221;. It&#8217;s also pretty easy to decide that null is going to be treated as false. Things get tricky, though, when you have values such as 0 and an empty string. If <code>$x = 0;</code>, then should that conditional be true or false? The variable has been deliberately assigned a value, but the value is 0. Again, these are the kinds of choices that creators of a language have to make. In PHP, 0, an empty string, false, and null are all considered <em>empty</em> values, which get evaluated as false when used as the basis of a conditional.</p><p>Similarly, language designers have to make decisions as to what constitutes equality. If you compare two values of the same type—a string against a string, a number against a number, it is again easy to evaluate equality. It gets complicated when you compare values of different types: <code>if (2 == "2")</code>. That conditional compares the number 2 against the string &#8220;2&#8243;. These two values are not <em>identical</em> because of their different types, but are they equal?</p><p>To compare two different types, languages have to cast (i.e., forcibly convert) one type to the other. Generally, casting converts a value down to a simpler type. In that conditional, PHP will convert the string &#8220;2&#8243; to its numeric equivalent, which is 2. When you compare a Boolean against a non-Boolean, the non-Boolean has to be casted to a Boolean. As we&#8217;ve already seen, the empty values are treated as false in a conditional, so those values—0, an empty string, null, and false—are cast to the Boolean <strong>false</strong>. Hence, 0 does equal <strong>false</strong>.</p><p>Fortunately, programming languages tend to be pretty consistent in what gets treated as false (JavaScript also equates 0, an empty string, null, and false). The bugs arise in situations where your code tests for &#8220;truthiness&#8221; when it shouldn&#8217;t. For example, the conditional <code>if ($x) {</code> is fine unless one of the empty values is a valid value for <strong>$x</strong>. If it&#8217;s okay for <strong>$x</strong> to have a value of an empty string, you&#8217;d need to change your conditional accordingly. In PHP, the <strong>empty()</strong> function can discern between a variable just being set (i.e., assigned a value), and having a non-empty value. As another example, the <strong>strpos()</strong> function in PHP looks for a needle in a haystack, returning the starting indexed position where the needle is found. If the needle is found at the very beginning of the haystack, then the function will return 0. If you were to do this, you&#8217;d have a bug:</p><blockquote><p><code>if (strpos($haystack, $needle)) {</code></p></blockquote><p>The assumption is that the condition will be true if the needle is found in the haystack, but as written, the condition will only be true if the needle is found in the haystack <em>but not as the first thing in the haystack</em>. The proper way to write that conditional is:</p><blockquote><p><code>if (strpos($haystack, $needle) !== false) {</code></p></blockquote><p>Also note that it&#8217;s an identity comparison to false, because using != contains the same bug, as 0 does equal false.</p><p>Thanks to Matti for the good question. I hope this has clarified the issue and please, anyone, let me know if you have more questions or comments about this or similar matters.</p><h2 id="news">Larry Ullman&#8217;s Book News =&gt; &#8220;PHP Advanced and Object-Oriented Programming&#8221;</h2><p>First, I continue to receive a lot of positive feedback on the &#8220;<a
href="http://www.larryullman.com/books/modern-javascript-develop-and-design/">Modern JavaScript: Develop and Design</a>&#8221; book, which makes me very happy. I&#8217;ve posted a couple of the comments <a
href="http://www.larryullman.com/books/modern-javascript-develop-and-design/reviews/">on my Web site</a>, and currently the book has received five reviews on <a
href="http://amzn.to/wsdmkq">Amazon</a>, all for five stars. The book seems to be selling well, too, which is great, but knowing that I was able to do what I set out to do—and that my intention actually did match up with what readers wanted—is paramount. My continued thanks to everyone for their interest in the book and for the nice words on it.</p><p>Right now, I&#8217;m continuing to chug away on the third edition of my PHP advanced book, titled &#8220;<a
href="http://amzn.to/M6yvzg">PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide</a>&#8220;. I&#8217;ve written four chapters thus far and hope to get another two written before I head off to Istanbul (in 10 days!).</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Interview with Douglas Crockford</title><link>http://www.larryullman.com/2012/05/11/interview-with-douglas-crockford/</link> <comments>http://www.larryullman.com/2012/05/11/interview-with-douglas-crockford/#comments</comments> <pubDate>Fri, 11 May 2012 11:00:21 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[crockford]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3193</guid> <description><![CDATA[SmashingMagazine recently published an interview with Douglas Crockford. Crockford, in case you&#8217;re not familiar, is one of the key proponents of JavaScript. One of JavaScript&#8217;s &#8220;founding fathers&#8221;, if you will. His Master Class video series on JavaScript and the history of programming is really quite illuminating. The interview is part of a new SmashingMagazine series called &#8220;How I Work&#8221;. [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://smashingmagazine.com">SmashingMagazine</a> recently <a
href="http://coding.smashingmagazine.com/2012/04/27/yahoos-doug-crockford-on-javascript/">published an interview</a> with <a
href="http://www.crockford.com">Douglas Crockford</a>. Crockford, in case you&#8217;re not familiar, is one of the key proponents of JavaScript. One of JavaScript&#8217;s &#8220;founding fathers&#8221;, if you will. His <a
href="http://my.safaribooksonline.com/video/programming/javascript/9781449379759">Master Class video series</a> on JavaScript and the history of programming is really quite illuminating.</p><p>The interview is part of a new SmashingMagazine series called &#8220;How I Work&#8221;. As they describe it:</p><blockquote><p>These interviews revolve around how thinkers and creators in the Web world design, code, and create. The goal is not to get into the specific nuances of their craft (as that information already exists online), but rather step back and learn a bit about their habits, philosophies, and workflow for producing great work.</p></blockquote><p>For that reason, the interview is useful whether or not you do any JavaScript programming, as Crockford has great insights into programming in general. Just two things that caught my attention&#8230;</p><blockquote><p><strong>WHAT WERE THE TRAITS OF THE WEAK PROGRAMMERS YOU’VE SEEN OVER YOUR CAREER?</strong><br
/> That’s an easy one—lack of curiosity. They were so satisfied with the work that they were doing was good enough (without an understanding of what ‘good’ was) that they didn’t push themselves.</p></blockquote><p>and &#8230;</p><blockquote><p><strong>HOW MUCH OF A LANGUAGE DO YOU NEED TO KNOW?</strong><br
/> Virtually every programming language is too big. Language standards have difficulty removing unnecessary features but as users we can choose not to use it.<br
/> I would say you can do 100% with knowing 50% of the language.</p></blockquote><p>As for the first, the greatest thing about working for myself is the ability to learn whatever I want. I&#8217;m not pigeonholed into one subject or career. I can see what interests me and expand my knowledge as I see fit. (On the other hand, I&#8217;d certainly make more money if I specialized but there&#8217;s more to life than making money, they say.)</p><p>As for the second, that&#8217;s an interesting suggestion, and one I&#8217;ve not heard before. To be fair, when I write a book on a language, I have to make decisions about what to discuss and what not to (e.g., never cover goto!), but I wouldn&#8217;t have put that number at 50% or in that area. Still, it&#8217;s great that an expert on a language admits that much of it isn&#8217;t necessary, at least not most of the time.</p><p>After the interview, which isn&#8217;t too long, there are two video clips worth checking out. Both are around an hour long, but will give you a sense of what Crockford does in his Master Class videos. One of those videos, and many more, can be found in Yahoo!&#8217;s excellent <a
href="http://yuilibrary.com/theater/">YUI Theater</a>.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/05/11/interview-with-douglas-crockford/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>What Is Larry Thinking? #54 =&gt; Salt, Pepper, 99designs, and Ajax</title><link>http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/</link> <comments>http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#comments</comments> <pubDate>Mon, 30 Apr 2012 11:00:06 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[99designs]]></category> <category><![CDATA[ajax]]></category> <category><![CDATA[newsletter]]></category> <category><![CDATA[phpvqp3]]></category> <category><![CDATA[security]]></category> <category><![CDATA[travel]]></category> <category><![CDATA[yii]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3190</guid> <description><![CDATA[In this edition… About This Newsletter On the Web? =&#62; Properly Salting Passwords, The Case Against Pepper On the Road =&#62; Istanbul and Silicon Valley On the Blog =&#62; My New Logo and Business Card from 99designs On the Blog =&#62; Five Ways to Lose Work On the Blog =&#62; Yii and Me (aka, the [...]]]></description> <content:encoded><![CDATA[<p> In this edition…</p><ul><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#about">About This Newsletter</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#web">On the Web? =&gt; Properly Salting Passwords, The Case Against Pepper</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#road">On the Road =&gt; Istanbul and Silicon Valley</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#blog1">On the Blog =&gt; My New Logo and Business Card from 99designs</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#blog2">On the Blog =&gt; Five Ways to Lose Work</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#blog3">On the Blog =&gt; Yii and Me (aka, the Yii Book)</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#qa1">Q&amp;A =&gt; How Do I Make Ajax Content Available to Search Engines</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#qa2">Q&amp;A =&gt; Can You Use .html Instead of .php?</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#news">Larry Ullman&#8217;s Book News => &#8220;PHP 5 Advanced: Visual QuickPro Guide&#8221; (3rd Edition)</a></li></ul><p> <span
id="more-3190"></span></p><h2 id="about">About This Newsletter</h2><p>To repeat what I&#8217;ve said in the past two newsletters, I am now officially on <a
href="http://twitter.com">Twitter</a>. Hopefully next month, I&#8217;ll get the Twitter &#8220;follow me&#8221; link on my main site and add it to this newsletter template. But in the meantime, you can follow me using <a
href="https://twitter.com/#!/LarryUllman">@LarryUllman</a>. I&#8217;m doing better about sending out tweets, and I do retweet things that I think are notable or useful. In fact, I sent out a tweet a couple of days ago asking for good newsletter questions, and I received a few, one of which I answer here. Even an old dog can learn a new trick, I guess.</p><p>Also, I would love to have more questions to answer in forthcoming newsletters. I tend to get the most questions when I do a book giveaway, and I haven&#8217;t had one of those in a while, so the well is running a bit dry.</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="web">On the Web => Properly Salting Passwords, The Case Against Pepper</h2><p>Anthony Ferrara, creator of the PHP <a
href="https://github.com/ircmaxell/PHP-PasswordLib">PasswordLib</a> library,&nbsp;just recently <a
href="http://blog.ircmaxell.com/2012/04/properly-salting-passwords-case-against.html">posted a discussion of using salts and pepper</a> to improve the security of a stored password. Mostly, the article is a discussion of why a pepper is unnecessary (and if you don&#8217;t know what a &#8220;pepper&#8221; is, just read the article), but the posting also does a good job of explaining the purpose of a salt, and why the salt does not need to be a secret. The posting is relatively short, and is something I think everyone can benefit from reading.</p><p>The posting ends with the most important security fact:</p><blockquote><p>Remember, the most dangerous kind of security is a false sense of it. Thinking you&#8217;ve made your application more secure, when in fact you&#8217;ve weakened it, is the worst thing you could possibly do.</p></blockquote><h2 id="road">On the Road => Istanbul and Silicon Valley</h2><p>For the first time in a long time, I&#8217;m going to do some work-related traveling. I used to travel somewhat regularly for conferences and training seminars and the like. But then I had kids and other personal issues came up, so I cut back. I <em>think</em> the last time I travelled for work was when I spoke at a Voices That Matter conference in Nashville, TN in 2008!</p><p>My first trip is to Istanbul, Turkey, at the end of May. I&#8217;ll be speaking at the <a
href="http://e-commerceexpo.com/">E-commerce Expo</a> on May 30th (the site is in Turkish, so you&#8217;ll want to use a browser like Chrome that will translate the page for you). I will have about two other days to see what I can of the city, so if anyone has any recommendations of what to see and do, or where to eat, please let me know. I&#8217;ve heard nothing but great things about Istanbul and am really looking forward to it. Oh, and my speech—<strong>Building a Successful E-commerce Venture, or Failing Gracefully</strong>—should be good, too.</p><p>At the end of June, I&#8217;ll be doing two days of training on JavaScript and jQuery at the Mid-Pacific ICT Center Summer 2012 Faculty Development Week in Fremont, California. I&#8217;m tentatively thinking about making myself available for drinks or dinner on Thursday, June 28th, although I haven&#8217;t thought it through, yet. If you&#8217;re in the area and think you&#8217;d like to meet, let me know and I&#8217;ll see what makes sense from there. Thanks!</p><h2 id="blog1">On the Blog => My New Logo and Business Card from 99designs</h2><p>In March, I finally got around to having a new logo and business card created, using <a
href="http://99designs.com">99designs</a>. It wasn&#8217;t a driving need for me, but it was about time. I wrote about <a
href="http://www.larryullman.com/2012/04/18/my-99designs-logo-and-business-card-contest/">the contest experience</a> in one blog post. In another blog post, I show <a
href="http://www.larryullman.com/2012/04/16/my-new-logo-and-business-card/">the end results</a>, and also some of the terrible logos and business cards I&#8217;ve had along the way (i.e., the ones I designed).</p><p>I&#8217;ve since hired a designer to modify my CSS to use the new logo and colors. This is going to go with a new WordPress theme, which I&#8217;m hoping to get online in May. Hoping. After that I&#8217;ll also update this newsletter template.</p><h2 id="blog2">On the Blog => Five Ways to Lose Work</h2><p>In <a
href="http://www.larryullman.com/2012/04/02/what-is-larry-thinking-53-writing-and-working/#thinking">the previous newsletter</a>, I wrote about competing for work. Getting work is a frequent topic of conversation I have with readers, and between that question, and my recent experiences with 99designs, I wrote a blog post titled &#8220;<a
href="http://www.larryullman.com/2012/04/11/five-ways-to-lose-work/">Five Ways to Lose Work</a>&#8221;. Although some of the examples in that post come from my 99designs experience, it&#8217;s not really about 99designs, but more about the common mistakes people make when trying to get a project. My intent is that by recognizing these mistakes, you&#8217;ll be less likely to make them, and therefore have a better chance of getting work.</p><h2 id="blog3">On the Blog => Yii and Me (aka, the Yii Book)</h2><p>Many people have appreciated my <a
href="http://www.larryullman.com/series/learning-the-yii-framework/">Learning the Yii Framework</a> series and are awaiting a formal Yii book written by me. This is something I have been hoping to do for sometime. It looks like that time will be the latter half of 2012. Almost definitely. In <a
href="http://www.larryullman.com/2012/04/23/yii-and-me-aka-the-yii-book/">a recent blog post</a>, I announced my current plans and thinking about the book. I was also very pleased to say that Qiang Xue, the creator of Yii, has generously agreed to act as the technical editor for the book. Now it&#8217;s just a matter of writing it!</p><h2 id="qa1">Q&amp;A => How Do I Make Ajax Content Available to Search Engines?</h2><p>I&#8217;m digging way through the archives to find questions to answer, and I came across this one sent in by Richard back in October of 2008. It&#8217;s probably way too late to help Richard, but perhaps my answer can be of use to others. Here&#8217;s the prompt (summarized by me):</p><blockquote><p>I have a discussion board that pulls posts via Ajax, which means that posts aren&#8217;t being indexed by search engines. I updated the system so that all posts are displayed by PHP, to make them search engine visible, and then use Ajax for new posts since the user got online, but are there other places where Ajax presents this sort of problem?</p></blockquote><p>This brings up a very good point that every Web developer ought to be aware of. It&#8217;s obvious that if someone disables JavaScript, they can&#8217;t see the JavaScript functionality on a site. Statistically, only around 1-3% of all <em>users</em> have JavaScript disabled. However, <en>all search engine bots</en> are unable to see JavaScript-derived content. This means that all content on your site that&#8217;s created by JavaScript will not appear in search engines. This is especially ironic as many sites use JavaScript for the most important content. So what&#8217;s the solution?</p><p>The solution is actually the same solution for all JavaScript-based sites. Unless the site absolutely has to require JavaScript, you should always start with a non-JavaScript version first. A non-JavaScript version will be accessible by all search engines and by, well, anyone. The non-JavaScript version may not be pretty or cool, but it will be functional, which is most important. Then you can add the JavaScript layer to implement the cool, or more interactive, version. This process is called &#8220;progressive enhancement&#8221; and is a cornerstone of modern JavaScript, as explained in my &#8220;<a
href="http://www.larryullman.com/books/modern-javascript-develop-and-design/">Modern JavaScript: Develop and Design</a>&#8221; book.</p><p>If, for whatever reason, you don&#8217;t want to take this approach, then simply create alternative versions of your content that would be available for search engines. This could be as simple as a site map that links to non-dynamic versions of the content.</p><h2 id="qa2">Q&amp;A => Can You Use .html Instead of .php?</h2><p>This question came in from @enxaneta_info via Twitter:</p><blockquote><p>Is it possible to replace the <strong>.php</strong> extension with <strong>.html</strong>?</p></blockquote><p>The short answer is yes. A file&#8217;s extension just tells the computer what application should be used to execute that file. With Web files, the extension tells the Web server how to treat that file. Normally, the <strong>.php</strong> extension indicates that the code therein should be run through the PHP module. If you wanted to use <strong>.html</strong>, you&#8217;d just need to tell the Web server to send all files with a <strong>.html</strong> extension through the PHP module. (This is done via an AddType directive in the Apache configuration file.)</p><p>One benefit of doing this is that it allows you to hide what type of server-side tool is being used. On the other hand, there is certain to be a performance hit as the Web server will send every page through the PHP module. But if you have a site that only contains PHP scripts and has no HTML files, this is a reasonable change to make.</p><h2 id="news">Larry Ullman&#8217;s Book News => &#8220;PHP 5 Advanced: Visual QuickPro Guide&#8221; (3rd Edition)</h2><p>I&#8217;ve formally started writing the third edition of my &#8220;<a
href="http://www.larryullman.com/books/php-5-advanced-visual-quickpro-guide-2nd-edition/">PHP 5 Advanced: Visual QuickPro Guide</a>&#8221; book. You can view the initial <a
href="http://www.larryullman.com/2012/04/09/php-5-advanced-visual-quickpro-guide-3rd-edition-table-of-contents/">Table of Contents</a> on my Web site, along with some discussion of my approach to this edition. The new edition is tentatively titled &#8220;Advanced PHP and Object-Oriented Programming: Visual QuickPro Guide&#8221;, to better reflect the book&#8217;s focus.</p><p>If you have any thoughts on the book&#8217;s table of contents, please share them on that blog posting page. As I said, I&#8217;m writing the book now, and it will be my primary focus for the next two months. Ideally the first submitted draft will be completed by the end of May (although that will be a stretch), and the book will come out by the end of summer.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Great JavaScript Resources by Addy Osmani</title><link>http://www.larryullman.com/2012/04/06/great-javascript-resources-by-addy-osmani/</link> <comments>http://www.larryullman.com/2012/04/06/great-javascript-resources-by-addy-osmani/#comments</comments> <pubDate>Fri, 06 Apr 2012 13:04:25 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3170</guid> <description><![CDATA[In the beginning of March, I blogged about an excellent resource titled &#8220;Essential JavaScript Design Patterns&#8220;, written by Addy Osmani. Mr. Osami is a JavaScript developer for AOL, a member of the jQuery core team, among other roles, and is an excellent writer. “Essential JavaScript Design Patterns” is a book-length document, available for free online, that does a [...]]]></description> <content:encoded><![CDATA[<p>In the beginning of March, I blogged about an excellent resource titled &#8220;<a
href="http://addyosmani.com/resources/essentialjsdesignpatterns/book/">Essential JavaScript Design Patterns</a>&#8220;, written by <a
href="http://addyosmani.com/">Addy Osmani</a>. Mr. Osami is a JavaScript developer for AOL, a member of the jQuery core team, among other roles, and is an excellent writer. “Essential JavaScript Design Patterns” is a book-length document, available for free online, that does a great job of explaining not just design patterns in JavaScript, but also the concept of design patterns in general.</p><p>If you liked that resource, Mr. Osmani has several others you may appreciate, beginning with <a
href="http://addyosmani.com/largescalejavascript/">Patterns for Large-Scale JavaScript Application Architecture</a>. The topic itself may be too specific for many developers, and I do disagree with his definition of what a large-scale JavaScript application is (Osami&#8217;s definition is non-quantifiable, and therefore a vague non-defintion), but the writing and suggestions are strong and concrete. The article begins with discussions of design theory, and then goes into the implementations of specific patterns that would be used in the underlying architecture. Each section also includes links to other good resources. There&#8217;s a corresponding <a
href="http://speakerdeck.com/u/addyosmani/p/large-scale-javascript-application-architecture">presentation</a> you can read, if you&#8217;d prefer just the bullet points.</p><p>Towards that end, you may want to check out Mr. Osmani&#8217;s <a
href="http://speakerdeck.com/u/addyosmani">other speeches</a>, which primarily focus on performance issues, scaling JavaScript, and jQuery.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/04/06/great-javascript-resources-by-addy-osmani/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>What is Larry Thinking? #53 =&gt; Writing and Working</title><link>http://www.larryullman.com/2012/04/02/what-is-larry-thinking-53-writing-and-working/</link> <comments>http://www.larryullman.com/2012/04/02/what-is-larry-thinking-53-writing-and-working/#comments</comments> <pubDate>Mon, 02 Apr 2012 11:02:50 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[article]]></category> <category><![CDATA[book]]></category> <category><![CDATA[jsdd]]></category> <category><![CDATA[mamp]]></category> <category><![CDATA[newsletter]]></category> <category><![CDATA[phpvqp3]]></category> <category><![CDATA[twitter]]></category> <category><![CDATA[writing]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3167</guid> <description><![CDATA[In this edition… On the Web =&#62; Follow Me on Twitter! Redux On the Web =&#62; Three JavaScript Articles I wrote On the Blog =&#62; MAMP without MAMP Q&#38;A =&#62; Can I Make a Living as a Writer? What is Larry Thinking =&#62; Competing for Work Larry Ullman&#8217;s Book News =&#62; “Modern JavaScript: Develop and [...]]]></description> <content:encoded><![CDATA[<p>In this edition…</p><ul><li><a
href="http://www.larryullman.com/2012/04/02/what-is-larry-thinking-53-writing-and-working/#web1">On the Web =&gt; Follow Me on Twitter! Redux</a></li><li><a
href="http://www.larryullman.com/2012/04/02/what-is-larry-thinking-53-writing-and-working/#web2">On the Web =&gt; Three JavaScript Articles I wrote</a></li><li><a
href="http://www.larryullman.com/2012/04/02/what-is-larry-thinking-53-writing-and-working/#blog">On the Blog =&gt; MAMP without MAMP</a></li><li><a
href="http://www.larryullman.com/2012/04/02/what-is-larry-thinking-53-writing-and-working/#qa">Q&amp;A =&gt; Can I Make a Living as a Writer?</a></li><li><a
href="http://www.larryullman.com/2012/04/02/what-is-larry-thinking-53-writing-and-working/#thinking">What is Larry Thinking =&gt; Competing for Work</a></li><li><a
href="http://www.larryullman.com/2012/04/02/what-is-larry-thinking-53-writing-and-working/#news">Larry Ullman&#8217;s Book News =&gt; “Modern JavaScript: Develop and Design” and “PHP 5 Advanced: Visual QuickPro Guide” (3rd Edition)</a></li></ul><p><span
id="more-3167"></span></p><h2 id="web1">On the Web =&gt; Follow Me on Twitter! Redux</h2><p>To reiterate something I said in the <a
href="http://www.larryullman.com/2012/03/12/what-is-larry-thinking-52-twitter/#web1">previous newsletter</a>, I am now officially on <a
href="http://twitter.com">Twitter</a>. You can follow me using <a
href="https://twitter.com/#!/LarryUllman">@LarryUllman</a>. In the three-ish weeks since I started using it, I’ve only sent out maybe a dozen group tweets (not counting the ones directly to specific people), but at least there have been no “I am now having a sandwich.”-type tweets. Not by me anyway.</p><p>So far, a nice ego bump when it comes to Twitter is seeing people mention me (yes, yes, I am an idiot regarding Twitter; I didn’t know about that aspect at all). The annoying and stunning thing is that I’m occasionally getting hit up for technical support. It really quite amazes me that one would think I could provide free, instant tech support, and within 140 characters! Of course, I’m happy to provide free tech support, which is why I created my <a
href="http://www.larryullman.com/forums/">support forums</a>, but I just don&#8217;t think Twitter is the best medium for it.</p><h2 id="web2">On the Web =&gt; Three JavaScript Articles I Wrote</h2><p>In support of my “<a
href="http://www.larryullman.com/books/modern-javascript-develop-and-design/">Modern JavaScript: Develop and Design</a>” book, I wrote three articles to be published online by <a
href="http://peachpit.com">Peachpit Press</a>. All three are now available:</p><ul><li><a
href="http://www.peachpit.com/articles/article.aspx?p=1843879">The Five Biggest JavaScript Misconceptions</a></li><li><a
href="http://www.peachpit.com/articles/article.aspx?p=1847299">The 10 Best JavaScript Development and Design Habits</a></li><li><a
href="http://www.peachpit.com/articles/article.aspx?p=1851233">5 Ways to Improve Your Ajax Performance</a></li></ul><p>The articles don’t require that you have the book. And, of course, they’re free, so check them out when you get the chance. Thanks!</p><h2 id="blog">On the Blog =&gt; MAMP without MAMP</h2><p>For a couple of years now, I’ve used, and advocated using, the <a
href="http://mamp.info/en/index.html">MAMP application</a> as the easiest way to run a Web server on a Mac. I’ve started to change my thinking about that, as discussed in a <a
href="http://www.larryullman.com/2012/02/24/mamp-without-mamp/">recent blog post</a>.</p><h2 id="qa">Q&amp;A =&gt; Can I Make a Living as a Writer?</h2><p>“Can I make a living as a writer?” is one of the more common questions I get, and one I never mind answering. Both Helmut and Scott recently asked me about the logistics of being a writer, so it seems like a good time to rehash the topic.</p><p>In terms of hard numbers, how lucrative writing a book is all depends upon how well the book sells. As a reasonable basis number, assume you can get $10,000 (USD) to write a book, which is the <strong>advance</strong>. Some publishers will pay more, some will pay less. It also depends upon who you are and what the book is. But $10,000 is fair. And that money is yours to keep, no matter what happens (assuming you complete the book to the publisher’s satisfaction). If you can write two books per year, that’s $20,000. If you can write three, that’s $30,000. In the past, there have been years in which I wrote three books in a single year, and it’s really hard to do, not just because you have to have three good ideas and enough expertise on three subjects, but because writing a single book is quite draining.</p><p>Added to that, write an article a month, just to get some extra income and to help promote the books. Let’s say you’re paid $500 each for those. Most of the articles I write pay less than that, but the occasional article pays dramatically more. One article per month at $500 per is another $6,000. Keep in mind that, as with the books, you have to have the ideas, have the knowledge, and then put forth the effort to get someone to buy the article. That’s all time consuming, but the actual act of writing an article isn’t that hard. It’s really just a professional blog posting.</p><p>So now, with a fair amount of work and effort, you’ve managed to bring in $26,000. At least in the United States, from this income you have to pay all the taxes and such, so the actual net may be more like $20,000. Does that constitute a living for you? I’m sure some of you would be losing a lot of money to take that deal and others would be fine with it. But I think that’s what you could reasonably expect as a bottom line if you’re a good writer and put in the necessary work. The other end of the spectrum depends upon how well your books sell.</p><p>A good seller in computer books is around 10,000 copies. Different titles have different expectations, but my understanding is that if you sell 10,000 copies, you’ve done well. This number varies greatly, but a decent expectation is that you, the writer, will make $2 per copy sold. If you sell 10,000 copies, that’s $20,000 on that one book. Minus the $10,000 advance, there’s another $10,000 for you. But that $10k will be spread out over some years. In my last statement, I received $11.19 in royalties for my first book published over a decade ago (with three new editions since then). The best part is that you’ve done no extra direct work for that money above and beyond the advance, but you can’t count on it, and you’ll likely have to do a lot of marketing work to help make that happen. Still, by earning advances for writing new titles and hopefully getting royalties on existing titles, you might be able to bring your total yearly writing income up to $30,000 to $40,000. Eventually.</p><p>In terms of harder numbers, you could probably consider me to be fairly successful as a computer writer (I mean in terms of actual sales, not necessarily the quality of the books, which is a different criteria). My first book came out almost exactly 11 years ago and I’ve now written 22 books, including revisions. I’ve sold approximately 325,000 copies in sum, for approximately $577,000. That may seem like a grand sum of money (and, to be clear, I’m happy to have earned it), but that’s over 11 years, which is about $52,000 per year during that time. Again, many of you would probably be thrilled with that number (and I’m okay with it), but remember that taxes have to come out of that and I get no benefits whatsoever. In the United States, benefits are normally estimated to be equivalent to the salary itself (i.e., if you’re being paid $40,000 per year, the company is probably spending another $40,000 for your retirement, medical, and other benefits). So one could look at that $52,000 per year as really being more like $26,000 per year, gross, plus benefits. And, again, I do fairly well for a writer. I’ll add that I’m just starting to make money through my blog, but right now that’s a few hundred dollars per year. Perhaps one day I’ll get that to a few hundred dollars a month, but I don’t envision this avenue to be a significant form of income.</p><p>There are some very hard numbers for what it might mean to make a living as a writer. For some people, the idea of making, say, $30,000 to $40,000 (USD) per year as a writer would be great. And there are intangible benefits. I work for myself, at home. I don’t commute. I don’t do many meetings. I learn and write about things I’m interested in. And there’s a lot of flexibility in my schedule which helps out tremendously considering the personal demands that I have. For other people, the idea of making that amount of money, with no guarantees, regular paychecks, or benefits would send them screaming to the nearest stable job.</p><p>I should add that writing does allow you to make good money doing related things. For example, I also do Web development and other programming, consulting, training, and speaking. My writing does act as a marketing agent for these avenues, meaning it’s easier for me to get work and I can charge a premium for those services.</p><p>All things considered, the general advice I have is: while it is possible to make money writing books (and/or articles), I wouldn’t recommend anyone to go into writing for that purpose. The odds of making money, let alone sufficient money, are slim. There’s a lot of competition, the publishing industry is definitely down, and the best payoffs are definitely in the long term. Also, in case I didn’t make this clear, writing a book is really quite hard. If you’re looking to go into business for yourself, there are certainly more stable, lucrative routes. It’d be much better to pursue writing only because you like to write and share what you’ve learned. And I’m not just saying that to cut down on the competition!</p><h2 id="thinking">What is Larry Thinking? =&gt; Competing for Work</h2><p>Some time back, William asked for my thoughts on how to compete for work, considering foreign competition and a tough economy. Two weeks ago, I was on the other side of the equation for the first time, as I ran a <a
href="http://99designs.com/">99designs</a> contest to have a new logo and business card created for me. I’ve been sketching out a blog posting tentatively titled “How Not To Get Work” about that experience, but I’ll toss out some thoughts here, too. (As an aside, the contest went great and I’ll post the details about it on my site soon. I got a great logo and business card, which are currently being used as the basis for a revamping of my Web site.)</p><p>This problem—a bad economy and competing with foreign developers who can offer bargain prices—is not new, although it may be new to those who haven’t been freelancing for that long. Just after I started in this line of work, the “dot com” bubble burst. At the time I was getting work through online freelancing sites like elance and guru, sometimes losing out to people that drastically undercut my price. For example, there was a big banking job that I lost out to a company in India that underbid me. That project would have been huge for me—around $22,000, I think, when I didn’t make that in a year, but on the other hand, I wasn’t really prepared or qualified to do that job at that time, so it was probably for the best. In any case, how does one compete?</p><p>In my opinion, you have to first accept two facts:</p><ul><li>Just because a competitor is in X country and is willing to do the job for much cheaper, it doesn’t mean that developer won’t do as good as a job as you.</li><li>For the person buying the services, price is logical, significant factor.</li></ul><p>I mention these two ideas because you can’t succeed if you get bogged down in excuses. The cost of living in X country may be a fraction of what it is in your country, which makes it possible for developers in X to offer what seem like cut-rate prices. But that doesn’t mean that developer can’t do the job. So the arguments for hiring you instead of those cheaper developers can’t be based upon that assumption. Second, while it is often true that you get what you pay for, it’s also true that business fail when they spend more than they have to. Accepting a cheaper bid doesn’t mean the client is cheap, it means the client is making a sound business decision (hopefully). So what can you do?</p><p>There’s only one thing you can control when competing for work: you. <em>Focus on what you can do</em>, not what’s wrong with the other developers or the client’s thought process. Towards that end:</p><ul><li><strong>Above all, be professional in every way.</strong> Every single thing you do should demonstrate professionalism on the highest level. This includes how well you handle not getting a job. You never know: your ability to handle failure professionally may just be the reason that the client comes back to you for a future project.</li><li><strong>Communicate well, both in quality and in timeliness.</strong> Be prompt, responsive, and literate.</li><li><strong>Offer the best, most appropriate price you can.</strong> Be aware of what other prices the client may see, but base your price on what you think is appropriate for the job. Do factor in how much you need the job, how much you want the job, and so forth, but try to strike a balance between asking enough that you won’t be annoyed if you get the job while still being as affordable as you can be.</li><li><strong>Stress and demonstrate your less obvious strengths.</strong> While money is a mitigating factor for the client, it’s not the only one. If you can’t compete on a pure cost basis, work on other angles. For example, a developer in X country might be cheaper but may also be 12 hours away; a simple Q&amp;A could take a whole day in that case. Or, if you will be available via IM or Skype, that’s a bonus.</li><li><strong>Do the work in advance.</strong><strong> The absolute best way to demonstrate that you’re capable of doing a job, and on time, is to do the job ahead of time. My second client ever, for whom I’m still doing work, was one I got when I did a bit of JavaScript for an elance project he was hiring for. During the bidding process, as part of my bid, I linked to a page where the client could see the finished work. It was <em>easy</em> for that client to hire me at that point. Yes, this means I did work for free, and because it was JavaScript, anyone could have stolen my code, but I had the free time and needed the money, so I went out on a limb. I did that many times when I first started and my success rate was high because of it.</strong></li></ul><p>William had also specifically asked about how to convince small business owners to start or revise a Web site. I will say that I’m pretty good at convincing someone to hire me to do a project, but I have no skill when it comes to convincing someone that a project is necessary. In short, I wouldn’t have the vaguest idea how to proceed here. I would <strong>guess</strong> that it’d be more effective if you tie some of your payment into the site’s success (i.e., establish quantifiable goals that trigger payments or bonuses). That would clearly convey that you believe in the project, but it is risky.</p><p>As a final piece of advice, I’ll add that getting the job (and the money) isn’t the only benefit to be gained from trying to get work. There’s a lot to be said for the experience gained by being involved in the process. Certainly that’s a “silver lining” perspective, but if you can handle the failure to win the job, you can learn a ton from just participating. With open eyes, you can see what clients are looking for and what winning developers are doing right. In thinking about my 99designs contest, which had approximately 100 designers, about a third of the designers really didn’t have the skill set to compete. But those designers did get to see what a winning designer does, how a client behaves, and how to manage the interaction. In my opinion, that’s all quite valuable experience.</p><h2 id="news">Larry Ullman’s Book News =&gt; “Modern JavaScript: Develop and Design” and “PHP 5 Advanced: Visual QuickPro Guide” (3rd Edition)</h2><p>The <a
href="http://www.larryullman.com/books/modern-javascript-develop-and-design/">JavaScript book</a> is done and available at a store near you. The early reviews seem to be good, for which I’m quite grateful. I already gave away half of the copies I had to people that replied to previous newsletters, so right now I’m not planning on doing another dedicated “Modern JavaScript: Develop and Design” giveaway. I <strong>might</strong> have a couple more copies to give away later in the year. We shall see.</p><p>Next week I begin writing the third edition of my “PHP 5 Advanced: Visual QuickPro Guide”, which will come out this summer. I’m finished the new table of contents and I’ll put that online soon. The current plan is to cut four chapters that contain material since covered in my other books. I’m adding four new chapters, too:</p><ul><li>Debugging, Testing, and Performance</li><li>Design Patterns</li><li>A chapter that creates a complete example using OOP</li><li>Using the Zend Framework</li></ul><p>There are also some minor cuts and additions. The general thrust in this rewrite is to expand the book largely in the areas of Object-Oriented Programming and advanced Web development. The OOP additions include design patterns, implementing MVC, using the <a
href="http://www.php.net/spl">Standard PHP Library</a>, and an example application writing in OOP. For the latter, Im specifically thinking about things like using <a
href="http://www.phpdoc.org/">phpDocumentor</a>, <a
href="http://www.php.net/pdo">PDO</a>, caching, and unit testing.</p><p>If you have any thoughts or suggestions, I would love to hear them. Thanks!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/04/02/what-is-larry-thinking-53-writing-and-working/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Two More JavaScript Articles Posted Online!</title><link>http://www.larryullman.com/2012/03/30/two-more-javascript-articles-posted-online/</link> <comments>http://www.larryullman.com/2012/03/30/two-more-javascript-articles-posted-online/#comments</comments> <pubDate>Fri, 30 Mar 2012 11:19:01 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[article]]></category> <category><![CDATA[jsdd]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3163</guid> <description><![CDATA[Peachpit Press has published the second and third articles I wrote in support of my “Modern JavaScript: Develop and Design” book. The second is &#8220;The 10 Best JavaScript Development and Design Habits&#8220;. In it, I spell out ten specific recommendations. Many of them apply to using any programming language, while a couple are specific to JavaScript. The third, and final, [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://peachpit.com/">Peachpit Press</a> has published the second and third articles I wrote in support of my “<a
href="http://www.larryullman.com/books/modern-javascript-develop-and-design/">Modern JavaScript: Develop and Design</a>” book. The second is &#8220;<a
href="http://www.peachpit.com/articles/article.aspx?p=1847299">The 10 Best JavaScript Development and Design Habits</a>&#8220;. In it, I spell out ten specific recommendations. Many of them apply to using any programming language, while a couple are specific to JavaScript.</p><p>The third, and final, article is &#8220;<a
href="http://www.peachpit.com/articles/article.aspx?p=1851233">5 Ways to Improve Your Ajax Performance</a>&#8220;. Ajax is critical to today&#8217;s Web applications, so knowing how to use Ajax requests more optimally is valuable knowledge.</p><p>Although both articles are written to support my &#8220;Modern JavaScript: Develop and Design&#8221; book, neither require that you have the book. And, of course, they&#8217;re free, so check them out when you get the chance. Thanks!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/03/30/two-more-javascript-articles-posted-online/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>35% Off &#8220;Modern JavaScript: Develop and Design&#8221; at Peachpit.com</title><link>http://www.larryullman.com/2012/03/29/35-off-modern-javascript-develop-and-design-at-peachpit-com/</link> <comments>http://www.larryullman.com/2012/03/29/35-off-modern-javascript-develop-and-design-at-peachpit-com/#comments</comments> <pubDate>Thu, 29 Mar 2012 15:18:49 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[book]]></category> <category><![CDATA[jsdd]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3162</guid> <description><![CDATA[I&#8217;m not sure for how long this will be good, but Peachpit Press just sent out a coupon code for 35% of my &#8220;&#8221;. The code is MODERNJS. Here&#8217;s the direct link to the book at Peachpit&#8217;s site: http://www.peachpit.com/store/product.aspx?isbn=0321812522&#38;WT.mc_id=2012_Mar_28_PP_PBM_ModernJavaScript.]]></description> <content:encoded><![CDATA[<p>I&#8217;m not sure for how long this will be good, but <a
href="http://www.peachpit.com">Peachpit Press</a> just sent out a coupon code for 35% of my &#8220;<a
href="http://www.larryullman.com/books/modern-javascript-develop-and-design/">Modern JavaScript: Develop and Design</a>&#8220;. The code is MODERNJS. Here&#8217;s the direct link to the book at Peachpit&#8217;s site: <a
href="http://e.pearson.info/pub/cc?_ri_=X0Gzc2X%3DWQpglLjHJlTQGNJzac7pfEF0yzam9uzc6gze4tws9o1CeSOcGUHzaPRVXtpKX%3DSRDTWCAW&amp;_ei_=Ema9CtfOgebgIFCmMQD2kWzdk75weai79Q7-a-HNmHC7D0blL7FAk0Xm1C5ZvWRjqGRW1JR-koe78I8I3ftIC3NDY8hl9dCXp08ysIwySLgy9PXkZyHCCM.">http://www.peachpit.com/store/product.aspx?isbn=0321812522&amp;WT.mc_id=2012_Mar_28_PP_PBM_ModernJavaScript</a>.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/03/29/35-off-modern-javascript-develop-and-design-at-peachpit-com/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Testing for Strict Mode in JavaScript Using this</title><link>http://www.larryullman.com/2012/03/28/testing-for-strict-mode-in-javascript-using-this/</link> <comments>http://www.larryullman.com/2012/03/28/testing-for-strict-mode-in-javascript-using-this/#comments</comments> <pubDate>Wed, 28 Mar 2012 11:09:06 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[jsdd]]></category> <category><![CDATA[strict]]></category> <category><![CDATA[strict mode]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3009</guid> <description><![CDATA[The this variable is an important concept in JavaScript and in many Object-Oriented languages. (Technically this is a keyword, but that&#8217;s a minor point in understanding it.) The simplest way to think of this is that it references the object whose method is currently being called. (The harder, but more accurate, way of thinking of this is [...]]]></description> <content:encoded><![CDATA[<div><p>The <strong>this</strong> variable is an important concept in JavaScript and in many Object-Oriented languages. (Technically <strong>this</strong> is a keyword, but that&#8217;s a minor point in understanding it.) The simplest way to think of <strong>this</strong> is that it references the object whose method is currently being called. (The harder, but more accurate, way of thinking of <strong>this</strong> is as a representation of the <em>execution context</em>, but I find that definition makes a person blink a lot while simultaneously scratching his or her head.) The brilliant <a
href="http://www.quirksmode.org/about/">Peter-Paul Koch</a> describes <strong>this</strong> as <a
href="http://www.quirksmode.org/js/this.html">the &#8220;owner&#8221; of the current method</a>, which also works.</p><p>To put this into a context (double pun), take the following JavaScript code, which defines a custom object, representing a rectangle:</p><pre class="brush: jscript; title: ; notranslate">var r = {
    side1: 10,
    side2: 20,
    isSquare: function() {
        return this.side1 == this.side2;
    }
};</pre><p>That code defines an object with two attributes and one method. The method, called using the code <strong>r.isSquare()</strong>, returns a Boolean value indicating if the rectangle is also a square or not. Since the <strong>isSquare()</strong> method is defined as part of the <strong>r</strong> object, within that method, <strong>this</strong> refers to <strong>r</strong>.</p><p><a
href="http://cloudfront.larryullman.com/wp-content/uploads/2012/03/js_this1.png"><img
class="aligncenter size-medium wp-image-3159" title="this in JavaScript" src="http://cloudfront.larryullman.com/wp-content/uploads/2012/03/js_this1-300x34.png" alt="this in JavaScript Example" width="300" height="34" /></a></p><p>Now take this code:</p><pre class="brush: jscript; title: ; notranslate">function returnThis() {
    return this;
}</pre><p>In JavaScript running within the Web browser, any function defined outside of any object becomes a method of the global <strong>window</strong> object. Thus, in that code, <strong>this</strong> refers to the global <strong>window</strong> object.</p><p><a
href="http://cloudfront.larryullman.com/wp-content/uploads/2012/03/js_this2.png"><img
class="aligncenter size-medium wp-image-3160" title="this in JavaScript Example 2" src="http://cloudfront.larryullman.com/wp-content/uploads/2012/03/js_this2-300x26.png" alt="this in JavaScript Example 2" width="300" height="26" /></a></p><p>Those two examples explain the simplest implications of the <strong>this</strong> keyword. However, as of ECMAScript 5, JavaScript now has a <a
href="https://developer.mozilla.org/en/JavaScript/Strict_mode">strict mode</a>, triggered by adding the string <em>use strict</em> to a page or function:</p><pre class="brush: jscript; title: ; notranslate">function someFunction() {
    'use strict';
}</pre><div>It is recommended that you use strict mode, and I certainly do in my &#8220;<a
href="http://www.larryullman.com/books/modern-javascript-develop-and-design/">Modern JavaScript: Develop and Design</a>&#8221; book.  But when  you run JavaScript in strict mode, <strong>this</strong> behaves a bit differently. The specific difference occurs within functions that are not associated with objects, as in the <strong>returnThis()</strong> example. In non-strict mode, <strong>this</strong> represents the global object in such cases, as just shown. In strict mode, <strong>this</strong> will be <em>undefined</em>, as the association between the function and the global object is not meaningful, even though it exists:</div><pre class="brush: jscript; title: ; notranslate">function returnThis() {
    'use strict';
    return this;
}</pre><div><p
style="text-align: center;"><a
href="http://cloudfront.larryullman.com/wp-content/uploads/2012/03/js_this3.png"><img
class="size-medium wp-image-3161 aligncenter" title="this in JavaScript Example 3" src="http://cloudfront.larryullman.com/wp-content/uploads/2012/03/js_this3-300x21.png" alt="" width="300" height="21" /></a></p></div><div>This change in behavior is fine, though, as a function that&#8217;s not overtly associated with an object really shouldn’t be called obliquely on the global object via <strong>this</strong> anyway. Put more simply: it&#8217;s best that code not rely upon the assignation of functions to the global object. If a function <em>needs</em> to use a global object, it should do so overtly, such as referring to <strong>window</strong>. And strict mode is really geared towards fixing these kinds of oddities and inconsistencies.</div><p>Taking this knowledge one step further, because <strong>this</strong> is <em>undefined</em> in strict mode in functions not associated with objects, you can use that fact to test whether or not your JavaScript is working in strict mode. To do so, just create a function not associated with any object and have it return a Boolean indicating whether or not <strong>this</strong> is undefined:</p><pre class="brush: jscript; title: ; notranslate">function isStrict() {
    return (typeof this == 'undefined');
}</pre><div><p>This can be shortened to just returning the oppposite of <strong>this</strong>:</p></div><pre class="brush: jscript; title: ; notranslate">function isStrict() {
    return !this;
}</pre><div><p>If <strong>this</strong> is undefined, which translates to <strong>false</strong>, then <strong>true</strong> (the opposite) is returned. If <strong>this</strong> refers to an actual object, that translates to the Boolean <strong>true</strong>, so <strong>false</strong> is returned.</p><p>If your code might need to know the strict mode in several places, you can assign that status to a variable, thereby only invoking the function once:</p><pre class="brush: jscript; title: ; notranslate">var strict = isStrict();</pre><p>Or you can turn this all into an immediately-executed anonymous function:</p><pre class="brush: jscript; title: ; notranslate">var strict = (function() { return !this; }());</pre><p>Obviously, using a function to report on the strict mode only works if the entire JavaScript file is or is not invoking strict mode.</p><p>And that&#8217;s how the this keyword behaves differently in JavaScript&#8217;s strict mode, and how you can use that modified before to test for strict mode, too.</p></div></div> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/03/28/testing-for-strict-mode-in-javascript-using-this/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>&#8220;The Five Biggest JavaScript Misconceptions&#8221; Article Published Online</title><link>http://www.larryullman.com/2012/03/19/the-five-biggest-javascript-misconceptions-article-published-online/</link> <comments>http://www.larryullman.com/2012/03/19/the-five-biggest-javascript-misconceptions-article-published-online/#comments</comments> <pubDate>Mon, 19 Mar 2012 11:25:33 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[article]]></category> <category><![CDATA[jsdd]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3152</guid> <description><![CDATA[Peachpit Press has published online an article I wrote titled &#8220;The Five Biggest JavaScript Misconceptions&#8220;. This is one of three articles I wrote in support of my &#8220;&#8221; book. In the article, as the title states, I discuss what I believe are the five biggest JavaScript misconceptions, and by &#8220;biggest&#8221;, I mean both &#8220;popular&#8221; and &#8220;egregious&#8221;. It&#8217;s [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://peachpit.com">Peachpit Press</a> has published online an article I wrote titled &#8220;<a
href="http://www.peachpit.com/articles/article.aspx?p=1843879">The Five Biggest JavaScript Misconceptions</a>&#8220;. This is one of three articles I wrote in support of my &#8220;<a
href="http://www.larryullman.com/books/modern-javascript-develop-and-design/">Modern JavaScript: Develop and Design</a>&#8221; book. In the article, as the title states, I discuss what I believe are the five biggest JavaScript misconceptions, and by &#8220;biggest&#8221;, I mean both &#8220;popular&#8221; and &#8220;egregious&#8221;. It&#8217;s a quick read, so check it out. Thanks!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/03/19/the-five-biggest-javascript-misconceptions-article-published-online/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>What is Larry Thinking? #52 =&gt; Twitter and More!</title><link>http://www.larryullman.com/2012/03/12/what-is-larry-thinking-52-twitter/</link> <comments>http://www.larryullman.com/2012/03/12/what-is-larry-thinking-52-twitter/#comments</comments> <pubDate>Mon, 12 Mar 2012 17:13:55 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Mac OS X]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[99designs]]></category> <category><![CDATA[book]]></category> <category><![CDATA[books]]></category> <category><![CDATA[ecom]]></category> <category><![CDATA[jsdd]]></category> <category><![CDATA[newsletter]]></category> <category><![CDATA[paypal]]></category> <category><![CDATA[phpvqp3]]></category> <category><![CDATA[twitter]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3151</guid> <description><![CDATA[In this edition… On the Web =&#62; Follow Me on Twitter! On the Web =&#62; Facebook and MySQL On the Web =&#62; 99Designs Contest for My Logo and Business Card On the Blog =&#62; Autographed Copies of “Modern JavaScript: Develop and Design” Now Available On the Blog =&#62; Using PayPal’s WebSite Payments Pro with “Effortless [...]]]></description> <content:encoded><![CDATA[<p>In this edition…</p><ul><li><a
href="http://www.larryullman.com/2012/03/12/what-is-larry-thinking-52-twitter/#web1">On the Web =&gt; Follow Me on Twitter!</a></li><li><a
href="http://www.larryullman.com/2012/03/12/what-is-larry-thinking-52-twitter/#web2">On the Web =&gt; Facebook and MySQL</a></li><li><a
href="http://www.larryullman.com/2012/03/12/what-is-larry-thinking-52-twitter/#web3">On the Web =&gt; 99Designs Contest for My Logo and Business Card</a></li><li><a
href="http://www.larryullman.com/2012/03/12/what-is-larry-thinking-52-twitter/#blog1">On the Blog =&gt; Autographed Copies of “Modern JavaScript: Develop and Design” Now Available</a></li><li><a
href="http://www.larryullman.com/2012/03/12/what-is-larry-thinking-52-twitter/#blog2">On the Blog =&gt; Using PayPal’s WebSite Payments Pro with “Effortless E-Commerce with PHP and MySQL”</a></li><li><a
href="http://www.larryullman.com/2012/03/12/what-is-larry-thinking-52-twitter/#qa">Q&amp;A =&gt; Does It Make Sense To Use a Code Generator?</a></li><li><a
href="http://www.larryullman.com/2012/03/12/what-is-larry-thinking-52-twitter/#news">Larry Ullman&#8217;s Book News =&gt; “Modern JavaScript: Develop and Design” and “PHP 5 Advanced: Visual QuickPro Guide” (3rd Edition)</a></li></ul><p><span
id="more-3151"></span></p><h2 id="web1">On the Web =&gt; Follow Me on Twitter!</h2><p>Sometimes it’s tough being such a pioneer, but, yes, I am now officially on <a
href="http://twitter.com">Twitter</a>. Only about 500 million people and organizations beat me to the punch.</p><p>I’ve obviously been aware of Twitter for years now, but have avoided all forms of “social media”, despite the fact that many readers, and even my <a
href="http://www.peachpit.com">publisher</a>, have kept suggesting that I create an account. Well, I finally accepted that “I don’t wanna” isn’t really a good reason for <em>not</em> having a Twitter account. And, I reminded myself that I could use Twitter the way I want, that it doesn’t have to be a stereotypical (and inane) series of “I am eating a sandwich.” tweets.</p><p>So I’m now officially <a
href="https://twitter.com/#!/LarryUllman">@LarryUllman</a> (clever handle, no?), although I have yet to actually tweet. Rest assured that I will start tweeting within a day or two of this newsletter going out. My thanks in advance to everyone for following me, and to those that gently nudged me in this direction.</p><h2 id="web2">On the Web =&gt; Facebook and MySQL</h2><p>Some time ago, I came across an article titled <a
href="http://gigaom.com/cloud/facebook-trapped-in-mysql-fate-worse-than-death/">“Facebook trapped in ’MySQL fate worse than death’”</a>. It’s a purposely overdramatic title, to be sure, but the article does a good job of discussing the problems that a very popular site such as Facebook has in scaling its database backend. The article also introduces some possible solutions to that problem. You may also find this to be an interesting read, although I would caution not to take away from the article that you shouldn’t be using MySQL. Facebook is probably the most active site online, and any one of us would be lucky to create a site that’s one-hundredth as popular (and therefore, technically demanding).</p><h2 id="web3">On the Web =&gt; 99Designs Contest for My Logo and Business Card</h2><p>On Friday, I created a <a
href="http://99designs.com/logo-design/contests/logo-business-card-larry-ullman-126632" class="broken_link">logo and business card design contest</a> at <a
href="http://99designs.com/">99designs</a>. If you’re not familiar with 99designs, it’s a <a
href="http://en.wikipedia.org/wiki/Crowdsourcing">croudsourcing</a> site that’s getting a lot of press these days. At the site, you create a “contest”, indicating what you want and how much you’re going to pay. For example, you may offer $200 for a business card or $150 for a t-shirt (all prices in USD). That price is set in stone, and is what the final winner will get. Designers then submit entries. The great thing is that you can see the entries as they come in and provide feedback. Designers can then submit new designs, based upon that feedback; not just on their designs, but on the others, too. My contest is restricted to 99design users, but you can see other examples <a
href="http://99designs.com/logo-design">here</a>. After the qualifying round (four days, in my case), you can select the finalists and move towards the final round (three days). Then select a winner who will be paid the designated amount.</p><p>With this system, the more you’re willing to pay, the more submissions you’ll get. I decided upon (with help from the 99designs “create a contest” wizard), a total of $644 for a logo and business card. As of this writing, three days in, I’ve had 118 entries from 35 designers. On the first day, most of the entries were amateurish: the kind of thing I could have created in Photoshop myself. On the second day, better designs came in. Then I <em>guaranteed</em> the contest, which means I’m saying that I’ll definitely pay for one of the designs. Once I did that, the number of entries ballooned from around 30 to 118.</p><p>A year or so ago, I spoke with a local company about designing a logo and business card. I believe the estimate they gave me was around $6,000, which included hours of research (at $180/hour or so). To be clear, having a good logo and business card really isn’t important to me, but I’d like one that I’m not embarrassed about. Six thousand dollars for something I don’t feel that strongly about is completely impossible, let alone not something I can afford. But the 99designs contest will give me a logo and a business card that looks nice, without breaking the bank.</p><p>To be fair, there are some that don’t like the idea of crowdsourcing, as all but one of the designers will get paid nothing for their work. This really doesn’t bother me, and not just because I’m a buyer and not a seller here. First of all, no vendor has to participate (i.e., if you don’t like the risk of not getting paid, don’t do it). Second, if you’re just starting out, crowdsourcing provides access to a slew of jobs and clients, which you wouldn’t otherwise have. Third, and most importantly, I would see crowdsourcing as an extremely valuable learning tool for vendors. By participating in these contests, or by just watching them, you can really learn a lot about the design process and about what customers want. In short, this is free and easy access to valuable experience.</p><p>Well, since I wrote this yesterday, a lot more entries have come in. The current count is 189 designs from 62 designers. I’ll be sure to share the winning design when all is said and done.</p><h2 id="blog1">On the Blog =&gt; Autographed Copies of “Modern JavaScript: Develop and Design” Now Available</h2><p>In response to several reader requests, I can now directly sell autographed copies of Modern JavaScript: Develop and Design. I only have the original, printed book in English available. I cannot sell you an ebook or a translated version. To cover my own costs (i.e., I have to buy copies of the book to sell to you), the base price is $40 (USD), plus shipping. This is about $6 more than if you were to buy the book at <a
href="http://amzn.to/wsdmkq">Amazon</a>, but the book you buy will be autographed and inscribed however you want. For international recipients, this will undoubtedly be the fastest way to get a copy of the book.</p><p>In order to get this option up as quickly as possible, I just set up a simple PayPal system. Head <a
href="http://www.larryullman.com/2012/02/27/autographed-copies-of-modern-javascript-develop-and-design-now-available/">here</a> to start that process. The shipping cost within the United States is $5.00 for priority mail, which gets it to you within a couple of business days. The shipping cost for international recipients is $17.00. This is also priority, and means the book should arrive within about a week, more or less. (Shipping rates have really gone up lately, and it’s a heavy book because it’s full color.) I’ll ship out books within two business days from receipt of payment. Note that for the time being, you can only order a single copy of this one book at a time. For multiple copies or to buy other books, please contact me directly.</p><p>If you have any questions or comments, let me know. Thanks!</p><h2 id="blog2">On the Blog =&gt; Using PayPal’s WebSite Payments Pro with “Effortless E-Commerce with PHP and MySQL”</h2><p>In Part 3 of 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 use <a
href="http://www.authorize.net/">Authorize.net</a> to process payments for a site that sells physical goods. Authorize.net accepts credit cards and can be directly integrated into your site, so that the customer never leaves (unlike, for example, PayPal’s Website Payments Standard, used in Part 2 of the book, which goes through PayPal’s site). The code in the book was written in a very modular style, with the intent that you can use the components you need, and swap others in and out. A long time ago, a reader specifically wanted to know how you would use PayPal’s Website Payments Pro instead of Authorize.net, and so I finally explained how to do that <a
href="http://www.larryullman.com/2012/03/07/using-paypals-website-payments-pro-with-effortless-e-commerce-with-php-and-mysql/">in a blog post</a>.</p><h2 id="qa">Q&amp;A =&gt; Does It Make Sense To Use a Code Generator?</h2><p>Tim had recently sent me this question, stating</p><blockquote><p>At times I feel overwhelmed with all the logic, syntax and complex structure of some scripts. Does it make sense to use a code generator to do the “heavy lifting” and then go into the code and “massage” it to suit your needs?</p></blockquote><p>In many situations, it absolutely makes sense to use a code generator. In fact, one of the reasons I like the <a
href="http://www.yiiframework.com">Yii framework</a> is that it generates a lot of the basic code for you. A code generator, in case you’re not familiar with the concept, is a tool that will generate the physical file, and the code itself, for you. You would then edit the generated code to be more specific for the goal. Of course, a code generator is a program, perhaps even written in another language. The complexity of the generator itself can vary, resulting in code that’s more or less specific.</p><p>With this in mind, you’ll need to balance the amount of work required to create the code generator vs. how much time you actually save using one. With PHP in particular, which isn’t that complex, using a good text editor or IDE, which will perform autocompletion for you, may be sufficient. Or, for that matter, just using a template in your text editor or IDE, can suffice. For example, if your application has the ability to create templates, it might create a PHP file template, with the opening and closing tags, the inclusion of a configuration file, a header, and a footer, and many comments. You might then use your application&#8217;s autocomplete or bundling tools to quickly drop in code for function definitions or database queries. Taking the time to customize and maximize the use of your text editor or IDE may be more efficient for something as simple as many PHP scripts.</p><h2 id="news">Larry Ullman’s Book News =&gt; “Modern JavaScript: Develop and Design” and “PHP 5 Advanced: Visual QuickPro Guide” (3rd Edition)</h2><p>So the JavaScript book is done and available at a store near you. Assuming, of course, that a book store still exists near you (my local Barnes and Noble is constantly taking out bookshelves to sell more games and toys; troubling as a writer). Many people have started receiving their copies already.</p><p>I should mention that the book is in full color (my first). This also means the book is heavier, and explains its higher price. The book has a clean, open design in a single-column format, not the two-column format of my Visual QuickStart/Pro Guides.</p><p>Some articles supporting the book will be going online soon, and I’ll post those links as I have them.</p><p>I’m currently in the process of revamping my Web site, but this month I also start the third edition of my “PHP 5 Advanced: Visual QuickPro Guide”, which will come out this summer. I’m planning on expanding my coverage of OOP and related topics like design patterns. I’ll also remove some of the deadwood and create new chapters. If you have any thoughts or suggestions, I would love to hear them. Thanks!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/03/12/what-is-larry-thinking-52-twitter/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Served from: www.larryullman.com @ 2012-05-21 13:42:00 by W3 Total Cache -->
