<?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; book</title> <atom:link href="http://www.larryullman.com/tag/book/feed/" rel="self" type="application/rss+xml" /><link>http://www.larryullman.com</link> <description>Translating Geek Into English</description> <lastBuildDate>Sun, 05 Feb 2012 17:48:42 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>What Is Larry Thinking? #49 =&gt; A New Year</title><link>http://www.larryullman.com/2012/01/07/what-is-larry-thinking-49-a-new-year/</link> <comments>http://www.larryullman.com/2012/01/07/what-is-larry-thinking-49-a-new-year/#comments</comments> <pubDate>Sat, 07 Jan 2012 16:55:27 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[bonus]]></category> <category><![CDATA[bonus content]]></category> <category><![CDATA[book]]></category> <category><![CDATA[debug]]></category> <category><![CDATA[jsdd]]></category> <category><![CDATA[newsletter]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2967</guid> <description><![CDATA[In this edition… About This Newsletter What Are You Thinking? =&#62; Bimonthly Newsletters On the Web =&#62; How To Read a PHP Function Definition On the Blog =&#62; Finding Book Bonus Content Q&#38;A =&#62; Do You Use Any Tools to Debug Your PHP Scripts? What is Larry Thinking =&#62; Testing Your PHP Knowledge Larry Ullman&#8217;s [...]]]></description> <content:encoded><![CDATA[<p>In this edition…</p><ul><li><a
href="http://www.larryullman.com/2012/01/07/what-is-larry-thinking-49-a-new-year/#about">About This Newsletter</a></li><li><a
href="http://www.larryullman.com/2012/01/07/what-is-larry-thinking-49-a-new-year/#you">What Are You Thinking? =&gt; Bimonthly Newsletters</a></li><li><a
href="http://www.larryullman.com/2012/01/07/what-is-larry-thinking-49-a-new-year/#web">On the Web =&gt; How To Read a PHP Function Definition</a></li><li><a
href="http://www.larryullman.com/2012/01/07/what-is-larry-thinking-49-a-new-year/#blog">On the Blog =&gt; Finding Book Bonus Content</a></li><li><a
href="http://www.larryullman.com/2012/01/07/what-is-larry-thinking-49-a-new-year/#qa">Q&amp;A =&gt; Do You Use Any Tools to Debug Your PHP Scripts?</a></li><li><a
href="http://www.larryullman.com/2012/01/07/what-is-larry-thinking-49-a-new-year/#thinking">What is Larry Thinking =&gt; Testing Your PHP Knowledge</a></li><li><a
href="http://www.larryullman.com/2012/01/07/what-is-larry-thinking-49-a-new-year/#news">Larry Ullman&#8217;s Book News =&gt; &#8220;Modern JavaScript: Develop and Design&#8221;</a></li></ul><p><span
id="more-2967"></span></p><h2 id="about">About This Newsletter</h2><p>Happy New Year! I hope you are doing well and had pleasant holidays, for those of you that celebrate holidays around this time. I’m going to get right to the newsletter, without any big introduction. I will say in advance that this is going to be a shorter newsletter, for reasons I’m about to explain.</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 Are You Thinking? =&gt; Bimonthly Newsletters</h2><p>First of all, how difficult is the English language? The term “bimonthly” means <em>both</em> every two weeks and every two months. Seriously? Yikes. Well, the reason I bring it up is that I’m thinking of changing the frequency of the newsletter. Right now, I try to send out the newsletter every 3-4 weeks, and target keeping it under 3,000 words (which I often don’t do). I’m debating putting it out every two weeks (-ish), but cutting the length by about half (as a point of reference this newsletter is the approximate new length). I’d also have to change some of the structure a bit. For example, I’d probably drop the “About This Newsletter” section, and only do some sections some times. What do you think?</p><p>You can reply to this email with your thoughts, or quickly vote at <a
href="http://www.larryullman.com/2012/01/06/newsletter-opinion-poll/">this online poll</a>. Thanks in advance for your input!</p><h2 id="web">On the Web =&gt; How To Read a PHP Function Definition</h2><p>It was recently pointed out to me by a couple of readers that they found my explanation for how to read the PHP manual, presented in Chapter 1 of my <a
href="http://www.larryullman.com/books/php-for-the-web-visual-quickstart-guide-4th-edition/">“PHP for the Web: Visual QuickStart Guide”</a> book, to be confusing. I think that learning how to read the manual is quite important, but I can see now that my presentation of that subject was a bit much at that early stage of the game, at least for absolute beginners. In any case, in that forum discussion, someone shared a link to a page in the PHP manual titled <a
href="http://www.php.net/manual/en/about.prototypes.php">“How to Read a Function Definition”</a>, which they found to be useful. So I thought I’d share it here!</p><h2 id="blog">On the Blog =&gt; Finding Book Bonus Content</h2><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’s not clear for everyone how to access this bonus material, I recently <a
href="http://www.larryullman.com/2011/12/20/finding-book-bonus-content/">posted instructions for finding bonus material</a> on my blog.</p><h2 id="qa">Q&amp;A =&gt; Do You Use Any Tools to Debug Your PHP Scripts?</h2><p>Daniel had asked me this question and the truthful answer is that I generally don’t, crazy as that sounds. Mostly this is because I primarily write PHP code using a text editor, <a
href="http://macromates.com">TextMate</a>, that does not have a built-in debugger. That leaves me with using echo statements as my primary debugging tool. I know I <em>can</em> get <a
href="http://xdebug.org/">XDebug</a> working with TextMate on my Mac, I just haven’t felt the need.</p><p>On the other hand, I’ve used <a
href="http://www.zend.com/en/products/studio/">Zend Studio</a> some, mostly for Flex+PHP development, in conjunction with Flash Builder, and Zend Studio does have a built-in debugger. Debuggers are nice—they report the values of variables, let you walk through code, and so forth, I just haven’t been driven to force myself to use one yet. Certainly if I were to use an IDE more frequently, I would get myself into the debugger habit.</p><h2 id="thinking">What is Larry Thinking? =&gt; Testing Your PHP Knowledge</h2><p>A friend of mine recently went on a job interview for a position as a PHP programmer and was given this prompt:</p><blockquote><pre>$a = 4;
$b = 5;
$c = --$b + $a++;</pre><p>What is the value of $c?</p></blockquote><p>This is just annoying. The question is trying to test knowledge of the impact that using the postfix and prefix versions of the increment and decrement operators have. In other words, will <strong>$b</strong> be decremented and then added to <strong>$a</strong> or will <strong>$b</strong> be added to <strong>$a</strong> and then decremented (and, of course, the same goes for the <strong>$a</strong> value, too)?</p><p>Besides being a meaningless example, in no way does this test one’s actual skills as a PHP programmer. It only tests one’s ability to memorize the rules of precedence. I, for one, always considered memorizing the precedence rules to be a waste of time. The list contains many esoteric operators that aren’t commonly used. More importantly, memorizing the list is only useful if you always remember the precedence list accurately. As soon as you slip up, you’ve created a bug. And even if you don’t slip up, relying upon precedence will lead to code that’s not clearly understood (i.e., that doesn’t clearly convey the programmer’s intent). That, to me, is bad code. When I look at that prompt, I don’t wonder what the value of <strong>$c</strong> is, but rather what the original programmer intended it to be. I know it undercuts the point of the test, but a real PHP programmer should have coded:</p><blockquote><pre>$c = (--$b) + $a;
$a++;</pre></blockquote><p>That code assigns the same answer to <strong>$c</strong>—8—and then increments <strong>$a</strong>, but is much, much cleaner. And, of course, some comments wouldn’t hurt!</p><p>It probably would not have gotten me the job, but that’s what my answer would have been. To me it comes down to whether the company is looking for someone that can memorize arcane rules, or someone that actually knows how to program. This is also why I don’t personally put much stock into certifications. Those are just exams that tests one’s ability to memorize and regurgitate rules. Certification exams have little reflection of real-world programming. For example, I might be asked on a certification test the order of the arguments for PHP’s <strong>explode()</strong> function, which I can never remember for whatever reason. On the test, I’d have a 50-50 shot of getting that question right, but in the real-world, there is a 100% guarantee that I’ll use the function correctly, because I’ll just look up its definition.</p><p>Years ago, I was a trainer for Borders Bookstores. As part of the training process, we’d have the new employee go on a treasure hunt to find a slew of books. Inevitably some trainee would get stumped and tentatively ask another, more seasoned employee for help. I loved that, because it accurately reflects the job: when you got stuck, you asked the person next to you.</p><p>Many books, tests, and even these simple employee tests put way too much emphasis on knowing facts. Being able to answer a question about a rule or function is not that important in the grand scheme of things. <em>Being able to find answers to questions is far, far more critical.</em> If you rely only on what you know, there will be a time when you won’t know, and then you’ll really be stuck.</p><h2 id="news">Larry Ullman’s Book News =&gt; “Modern JavaScript: Develop and Design”</h2><p>I just submitted Chapter 14, “Advanced JavaScript,” about two days ago, which means I only have two chapters left (whohoo!). One chapter will be on frameworks, in which I introduce both <a
href="http://jquery.com">jQuery</a> and <a
href="http://developer.yahoo.com/yui/">YUI</a>, probably the two most commonly used frameworks. The other chapter will be an example chapter using JavaScript with PHP (and HTML and CSS, of course). I’m thinking right now of doing an auction-like system, which would entail timers and Ajax and DOM manipulation and all sorts of goodies.</p><p>I will have those chapters done in the next two weeks, at the latest. I’ve also done the rewrites on the first 8 chapters, and have a few more of those to go. There will be supporting video screencasts to go with the book, and probably a couple of articles to be published online. The end is nigh!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/01/07/what-is-larry-thinking-49-a-new-year/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>My January 2012 Non-Resolutions List</title><link>http://www.larryullman.com/2012/01/03/my-january-2012-non-resolutions-list/</link> <comments>http://www.larryullman.com/2012/01/03/my-january-2012-non-resolutions-list/#comments</comments> <pubDate>Wed, 04 Jan 2012 04:12:41 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[book]]></category> <category><![CDATA[phpvqp3]]></category> <category><![CDATA[textmate]]></category> <category><![CDATA[writing]]></category> <category><![CDATA[yii]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2947</guid> <description><![CDATA[I&#8217;ve never been much of a New Year&#8217;s Resolution person: if something is important enough to do, start today, not on some arbitrary date that happens to be the first day of the year. (Or, you know, January 2nd, because the first is a holiday and all.) But this year I happen to have quite [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve never been much of a New Year&#8217;s Resolution person: if something is important enough to do, start today, not on some arbitrary date that happens to be the first day of the year. (Or, you know, January 2nd, because the first is a holiday and all.) But this year I happen to have quite a long non-resolutions list. The timing is entirely coincidental: I just happen to be almost done with my <em>Modern JavaScript: Develop and Design</em> book, and I always have a long list of things to do between books. I only have two more chapters to write on this book, and the end is in site!</p><p>In a recent newsletter, I <a
href="http://www.larryullman.com/2011/11/20/what-is-larry-thinking-47-random-monkey-appearances/#qa2">answered a question about how I spend my time between projects</a>. For me, the biggest projects I have, in terms of stress and time consumption, are the books I write. The client projects&#8211;Web development and such, no matter how big or complicated, never seem to be that much of a burden. Mostly this is because I find programming to be much easier than writing about programming, and because it&#8217;s fun to make things happen, to implement new concepts. Over the course of a year, I&#8217;ll work on any number of projects, ranging from consulting a couple of hours here or there (i.e., helping to steer the actual developers) to doing all of the development myself. When these bigger projects are done, I&#8217;m pleased to have them off of my list, but there&#8217;s never the huge sigh of relief that I have when I&#8217;ve finished a book. And that sigh says: now I can do these other 20 things that have been waiting for me!</p><p>With the completion of the JavaScript book on the horizon, I&#8217;ve been making my January to-do list, and salivating over all the things I&#8217;ll be getting done. Certainly, what I will actually do won&#8217;t be nearly as long as this list, but one can dream, no? My next deadline isn&#8217;t until this summer, which is when I have to turn in the third edition of my <em>PHP 5 Advanced: Visual QuickPro Guide</em> book. Although I&#8217;d like to, for a change, get that book done well in advance! Still, I have a bit of time to really put a dent in my &#8220;someday&#8221; to-do list.</p><p>First on my list is to exercise more often. I feel like I&#8217;ve gained five pounds for every book I&#8217;ve written (all that sitting), and while I&#8217;ve exercised more than never over the past few months, I&#8217;d like to do much, much better. We could all probably use more exercise!</p><p>After exercise, which is a daily and on-going goal, I&#8217;ve grouped my dream tasks into four categories:</p><ul><li>Things to work on</li><li>Books to read</li><li>Work things I really should get done</li><li>Personal things I really should get done</li></ul><p>The last category is of little interest to you, I imagine, or wouldn&#8217;t mean much regardless (mostly construction projects around the house). The work things I really should get done are those things that don&#8217;t get done during my books and big projects. For January, this primarily means creating an HTML5 version of this site&#8217;s design, plus a corresponding version for my forum. Before I redid this site in October of 2010, the site had become woefully outdated and I want to insure that doesn&#8217;t happen again. If time allows, I&#8217;ll do a mobile version, too, and make sure everything is performing as well as can be.</p><p>The books to read are both personal and work related. I want to read one or two parenting books, a novel, and some work-related books. I&#8217;m specifically looking to read <em><a
href="http://www.amazon.com/Pragmatic-Programmer-Journeyman-Master/dp/020161622X/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1325649567&amp;sr=1-1">The Pragmatic Programmer</a></em> by Hunt and Thomas first. I&#8217;ve heard good things about it. Then, coincidentally, I have a couple of ebooks from <a
href="http://pragprog.com/">The Pragmatic Bookshelf</a> on my computer awaiting a few moments of time. As I read these, I&#8217;ll no doubt be posting my thoughts about them here.</p><p>Finally, there&#8217;s my &#8220;things to work on&#8221; category, which is a broad category of topics without definitive targets or concrete tasks. Normally these items are a matter of improving my skills in specific areas. Right now I&#8217;m thinking honing my abilities and knowledge with respect to <a
href="http://www.obdev.at/products/launchbar/index.html">Launchbar</a> and <a
href="http://macromates.com/">TextMate</a>, two Mac apps I use all the time. I know for a fact that I&#8217;m underutilizing both. The time I spend improving my skills with them now will pay dividends over the rest of the year. As time allows, I also plan on continuing to write my Yii book, although I&#8217;ll probably do that as blog posts, too.</p><p>So there are my January 2012 non-resolutions. Which will likely also be my February 2012 non-resolutions. Sadly, at least a quarter of them will end up on my September 2012 resolutions, too!</p><p><strong>UPDATE</strong>: I just literally finished all the work on the <em>Modern JavaScript: Develop and Design</em> book yesterday, so thus far, I&#8217;ve done pretty much none of the things on my list, including exercise more. Ugh. But how about that February list&#8230;</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/01/03/my-january-2012-non-resolutions-list/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Why There Are Few (No?) Good JavaScript Books</title><link>http://www.larryullman.com/2011/10/18/why-there-are-few-no-good-javascript-books/</link> <comments>http://www.larryullman.com/2011/10/18/why-there-are-few-no-good-javascript-books/#comments</comments> <pubDate>Tue, 18 Oct 2011 16:28:02 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[book]]></category> <category><![CDATA[books]]></category> <category><![CDATA[jsdd]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2832</guid> <description><![CDATA[I&#8217;m working on a JavaScript book these days, titled Modern JavaScript: Develop and Design, to be published by Peachpit Press around the end of the year/beginning of 2012. In all modesty, readers have been asking that I write a JavaScript book for a decade now, as there seems to be a lack of good JavaScript [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m working on a JavaScript book these days, titled <em>Modern JavaScript: Develop and Design</em>, to be published by Peachpit Press around the end of the year/beginning of 2012. In all modesty, readers have been asking that I write a JavaScript book for a decade now, as there seems to be a lack of good JavaScript books out there (a JavaScript book recommendation is another common request). I believe I&#8217;ve read three JavaScript books in the 12 years since I first started using the language:</p><ul><li><em><a
href="http://www.amazon.com/gp/product/0596805527/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&amp;tag=larrullm09-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0596805527">JavaScript: The Definitive Guide</a></em>, by David Flanagan (O&#8217;Reilly)</li><li><em><a
href="http://www.amazon.com/gp/product/0596517742/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&amp;tag=larrullm09-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0596517742">JavaScript: The Good Parts</a></em>, by Doug Crockford (O&#8217;Reilly)</li><li><em><a
href="http://www.amazon.com/gp/product/1590597273/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&amp;tag=larrullm09-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1590597273">Pro JavaScript Techniques</a></em>, by John Resig (Apress)</li></ul><p>These are all recommendable books, with their own strengths and weaknesses (I always think of O&#8217;Reilly books being technically thorough and excellent, but not great to learn from for beginners.) In skimming some other JavaScript books, not to be named, and working on my own, I&#8217;ve been thinking more analytically about why there aren&#8217;t more good JavaScript books out there. I&#8217;ve come up with two reasons.<span
id="more-2832"></span><span
class="Apple-style-span" style="font-size: 15px; font-weight: bold;">How JavaScript Used to be Used</span></p><p>When JavaScript first started to be used, what was expected of Web pages was thoroughly different than today. The &#8220;World Wide Web&#8221; was quite new, and people were just starting to get online. As with most new technologies, the emphasis was on <em>cool</em> over <em>useful</em>. JavaScript, and HTML, were used to demonstrate what <em>could</em> be done, more than what <em>should</em> be done. With HTML, this meant things like the hideous <strong>blink</strong> tag (if you never saw a <strong>blink</strong> tag in use, consider yourself lucky). With JavaScript, this meant embedding sounds (ugh!), status bar tickers, popup windows, alerts, changing the cursor, and so forth. At best, JavaScript was used for image manipulation (e.g., rollovers) and minor form validation. Books written at the time, therefore, focused on these things. In other words, by comparison, if everyone wants to use paper shredders to make confetti, books about shredders will show how to make confetti!</p><p>Besides how JavaScript was used, there was the issue of <em>who</em> used it. Being a client-side language, JavaScript was primarily the domain of client-side developers: graphic design people, generally without formal programming training, ability, or even interest. With that intended audience, JavaScript books written at the time focused more on how to use JavaScript for specific applications, not how to learn JavaScript as a programming language in its own right. Which, you know, it is. Recipe books are fine, of course, but aren&#8217;t effective as a way to learn a language outright.</p><p>Also, JavaScript is a comparatively easy language to use, albeit not an easy language to use with absolute reliability. Because of this quality, there may have been less incentive to write books that fundamentally teach the language, as opposed to just showing people how to do the little tricks they think they want to do.</p><p>I never wrote a JavaScript book in the time period I&#8217;m talking about (the first time I formally wrote about JavaScript was in 2003), but my theory is that how JavaScript was used when most books were first being written is partially responsible for the lack of quality titles. This is a theory. Over time, as these writers did new editions, perhaps they didn&#8217;t do such a good job of updating the book to reflect how JavaScript usage has changed. It&#8217;s hard to make big changes to a book&#8217;s organization in subsequent editions, but, on the other hand, that is part of the job of being a writer. As an example, I was just looking at the fifth or sixth edition of a JavaScript book and noticed that it still has separate chapters on image manipulation (i.e., rollovers and such), cookies, and frames, but only one chapter on Ajax. This isn&#8217;t reflective of today&#8217;s JavaScript. I&#8217;m not saying that JavaScript isn&#8217;t still used in these ways, but writing a book is largely about making decisions and prioritizing. Spending one-fifth or one-sixth of a book on these subjects means more important content is being shorted.</p><h3>What One Needs to Know</h3><p>The second problem I&#8217;ve identified is what one needs to know to use JavaScript. This is still a problem today, one I wrestled with in writing my book. Take a relatively simple and common use of modern JavaScript: form validation. In order to perform form validation in JavaScript, one has to know about:</p><ul><li>Browser events and event handlers</li><li>Writing functions</li><li>Grabbing form element values</li><li>Validating data by type</li><li>DOM manipulation</li></ul><p>That&#8217;s a lot of information, and some of it (specifically involving events) is browser specific. To highlight why this is a problem as a writer, let&#8217;s look at how one can write a PHP book:</p><ol><li>This is an HTML page.</li><li>Viola! This is now a PHP page (i.e., file extension and PHP tags).</li><li>Here&#8217;s how to print something using PHP.</li><li>Here&#8217;s how to create a variable.</li><li>And so forth.</li></ol><p>A book on PHP can be written in a linear way because how the language works allows for that. But that&#8217;s not possible with a JavaScript book. In fact, <a
href="http://www.larryullman.com/2011/03/17/my-forthcoming-javascript-book-table-of-contents/">in my book</a>, event handling is Chapter 8, writing functions is Chapter 7, form interactions is Chapter 10, and DOM manipulation is part of Chapter 9. But the reader has to be able to do something well before he or she gets to Chapter 10, so what&#8217;s the solution?</p><p>One option is to encourage use of a browser console to execute bits of JavaScript. I do this in the book, but that&#8217;s not an approach that gets relied upon as a teaching tool, as it&#8217;s really not how you&#8217;ll use JavaScript in the real world. Chapter 3, which is the last chapter before getting into the heart of the language, explains how to use a console to execute a single line or several lines of code, and later chapters use that interface to demonstrate concepts, but the book never relies on that route for you to practice new ideas. The actual JavaScript programming you do won&#8217;t be in a console interface.</p><p>The other solution I came up with is clearly a cheat, but sometimes one has to cheat. In Chapter 2, I demonstrate and discuss the bare minimum of things:</p><ul><li>Two events: <em>onload</em> and <em>onsubmit</em></li><li>Creating a simple function</li><li>How to reference a form element</li></ul><p>This is enough essential information in order to create forms the user can interact with, and have JavaScript do some teachable and demonstrable stuff in response. Plus, I justify the early introduction with the thinking that: A) most readers have probably dabbled a bit with JavaScript before picking up the book anyway, and, B) it provides a target to work towards.</p><p>By comparison, in some of the other books I&#8217;ve browsed through, <strong>prompt()</strong> is used to get input from the user and <strong>document.write</strong> is used to output results. I don&#8217;t know if this is legacy code or the writer&#8217;s way of addressing this complication, but it&#8217;s bad code, bad JavaScript. One never uses <strong>prompt()</strong> anymore and almost never uses <strong>document.write</strong>. It&#8217;s stunning, really. In many books, lots of information is conveyed partially using code one would never use. And these are books published within the last year or two.</p><p>I have a lot of sympathy for my fellow writers, as writing a book is hard, and JavaScript poses its own particular complications. But hopefully the choices I&#8217;m making will result in a good book that does a lovely little language the justice it deserves, and so rarely gets.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/10/18/why-there-are-few-no-good-javascript-books/feed/</wfw:commentRss> <slash:comments>15</slash:comments> </item> <item><title>Modern JavaScript: Develop and Design Status</title><link>http://www.larryullman.com/2011/10/01/modern-javascript-develop-and-design-status/</link> <comments>http://www.larryullman.com/2011/10/01/modern-javascript-develop-and-design-status/#comments</comments> <pubDate>Sat, 01 Oct 2011 14:03:47 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[book]]></category> <category><![CDATA[books]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2816</guid> <description><![CDATA[I haven&#8217;t been posting as actively lately because all of my time is being spent on my new book, Modern JavaScript: Develop and Design. The progress is going more slowly than I would like, but it&#8217;s going, which is something. For those of you interested in the book, here&#8217;s a quick status update&#8230; The book [...]]]></description> <content:encoded><![CDATA[<p>I haven&#8217;t been posting as actively lately because all of my time is being spent on my new book, <em>Modern JavaScript: Develop and Design</em>. The progress is going more slowly than I would like, but it&#8217;s going, which is something. For those of you interested in the book, here&#8217;s a quick status update&#8230;</p><p>The book has three parts (you can see <a
href="http://www.larryullman.com/2011/03/17/my-forthcoming-javascript-book-table-of-contents/">a rough TOC here</a>), with Part 1 laying out the core information, Part 2 teaching the language in itself, and Part 3 introducing more advanced and newer uses of the language (frameworks, HTML5, server-side JS, advanced OOP stuff, etc.). The first draft of Part 1 is done. Chapter 1 explains what JS is and provides some context for using it in today&#8217;s environment. Chapter 2 includes a preview of what you&#8217;ll learn, and introduces some of the key concepts for using JS in an HTML page (the script tag, handling a simple event, etc.). Chapter 3 introduces the key software you&#8217;ll use: text editors and IDEs, browsers, and debugging tools.</p><p>Yesterday I submitted Chapter 4, which is the first chapter in Part 2. In it, I talk about how to create variables and assign values to them, and then explain the &#8220;simple&#8221; types: numbers, strings, and Booleans. The chapter ends with a discussion on type conversion, primarily from strings to numbers, as that can be a common cause of bugs. Tomorrow I&#8217;ll start on Chapter 5, which is control structures: conditionals and loops.</p><p>Right now the book is slated to be published in January 2012 (yes, yes, sorry for the delay). It should be available to read online as I write it through Safari&#8217;s Rough Cuts system. I&#8217;ll post those details once I have them.</p><p>Thanks again to everyone interested in the book!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/10/01/modern-javascript-develop-and-design-status/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>What is Larry Thinking? #44 =&gt; Web Development</title><link>http://www.larryullman.com/2011/08/26/what-is-larry-thinking-44-web-development/</link> <comments>http://www.larryullman.com/2011/08/26/what-is-larry-thinking-44-web-development/#comments</comments> <pubDate>Fri, 26 Aug 2011 14:34:00 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[book]]></category> <category><![CDATA[html5]]></category> <category><![CDATA[newsletter]]></category> <category><![CDATA[nosql]]></category> <category><![CDATA[oop]]></category> <category><![CDATA[smush]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2750</guid> <description><![CDATA[In this edition… About This Newsletter On the Web =&#62; Build Seven Good Object-Oriented Habits in PHP On the Web =&#62; Improving Site Performance: &#8220;Smushing&#8221; Images On the Blog =&#62; Great Web Developer Resources On the Blog =&#62; More on Non-Relational Databases Q&#38;A =&#62; Uploading Images to Multiple Directories Q&#38;A =&#62; How Do You Price [...]]]></description> <content:encoded><![CDATA[<p> In this edition…</p><ul><li><a
href="http://www.larryullman.com/2011/08/26/what-is-larry-thinking-44-web-development/#about">About This Newsletter</a></li><li><a
href="http://www.larryullman.com/2011/08/26/what-is-larry-thinking-44-web-development/#web1">On the Web =&gt; Build Seven Good Object-Oriented Habits in PHP</a></li><li><a
href="http://www.larryullman.com/2011/08/26/what-is-larry-thinking-44-web-development/#web2">On the Web =&gt; Improving Site Performance: &#8220;Smushing&#8221; Images</a></li><li><a
href="http://www.larryullman.com/2011/08/26/what-is-larry-thinking-44-web-development/#blog1">On the Blog =&gt; Great Web Developer Resources</a></li><li><a
href="http://www.larryullman.com/2011/08/26/what-is-larry-thinking-44-web-development/#blo2">On the Blog =&gt; More on Non-Relational Databases</a></li><li><a
href="http://www.larryullman.com/2011/08/26/what-is-larry-thinking-44-web-development/#qa1">Q&amp;A =&gt; Uploading Images to Multiple Directories</a></li><li><a
href="http://www.larryullman.com/2011/08/26/what-is-larry-thinking-44-web-development/#qa2">Q&amp;A =&gt; How Do You Price a Freelance Project?</a></li><li><a
href="http://www.larryullman.com/2011/08/26/what-is-larry-thinking-44-web-development/#thinking">What is Larry Thinking =&gt; The JavaScript Problem</a></li><li><a
href="http://www.larryullman.com/2011/08/26/what-is-larry-thinking-44-web-development/#giveaway">Book Giveaway =&gt; &#8220;PHP for the Web: Visual QuickStart Guide&#8221; and &#8220;Effortless Flex 4 Development&#8221;</a></li><li><a
href="http://www.larryullman.com/2011/08/26/what-is-larry-thinking-44-web-development/#news">Larry Ullman&#8217;s Book News =&gt; &#8220;PHP and MySQL for Dynamic Web Sites&#8221; (4th Edition) and &#8220;Modern JavaScript&#8221;</a></li></ul><p> <span
id="more-2750"></span></p><h2 id="aboutthisnewsletter">About This Newsletter</h2><p>When it&#8217;s time for another newsletter to go out, about three weeks after the last one shipped, I take a look at my pool of possible newsletter links, questions, tidbits, and thoughts, and grab those I&#8217;m most intrigued by. As I organize them, sometimes a theme appears, sometimes not, and sometimes I can force a theme upon the newsletter. It turns out that this newsletter falls under the very broad theme of <em>Web Development</em>, covering the full range of HTML, CSS, JavaScript, PHP, and databases. This is where my professional IT career began, twelve years ago, and what most of my work and writing still orbits around today. I gather that <em>Web Development</em> is what most of you do, too. So for many of us involved on the two sides of this newsletter, this one could be titled <em>Doing What We Do</em>. I hope you&#8217;ll find a thing or two that piques your interest.</p><p>In the next newsletter, I think I might write about my experiences developing mobile applications using Flex 4.5 and Flash Builder 4.5 for PHP. And perhaps do a book giveaway for the fourth edition of my &#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide&#8221; book.</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 => Build Seven Good Object-Oriented Habits in PHP</h2><p>I recently <a
href="http://www.stumbleupon.com">StumbledUpon</a> a pretty good article titled &#8220;<a
href="http://www.ibm.com/developerworks/opensource/library/os-php-7oohabits/index.html">Build Seven Good Object-Oriented Habits in PHP</a>&#8220;. As the name states, the article presents seven key qualities of good OOP programming, specifically in PHP (although the principles apply to most OOP languages). The best feature of the article is that it demonstrates each point using both bad and good code, clearly making the case for each recommended habit. The article begins with some basic and specific OOP—for example, not making properties public—and moves on to more advanced and abstract OOP theory, such as cohesion and design patterns. All in all, well worth the read if you&#8217;re doing OOP in general and OOP in PHP more specifically.</p><h2 id="web2">On the Web => Improving Site Performance: &#8220;Smushing&#8221; Images</h2><p>In trying to improve my site&#8217;s performance, starting with using the <a
href="http://developer.yahoo.com/yslow/">YSlow!</a> Firefox extension, I came across the concept of &#8220;smushing&#8221; images. <a
href="http://www.smush.it">Smush.it</a> is a Yahoo! service (which is why it&#8217;s tied to YSlow!) that optimizes images in such a way as to reduce their size without adversely affecting image quality. I believe I reduced my site&#8217;s total image size by about 10-15%, which isn&#8217;t huge, but when you&#8217;re talking about Web site optimization, every little bit helps. The only thing to be aware of is that sometimes GIFs will get turned into more efficient PNGs, meaning you&#8217;ll need to change your HTML accordingly (e.g., from <b>image.gif</b><b> to </b><b>image.gif.png</b><b>).</b></p><h2 id="blog1">On the Blog => Great Web Developer Resources</h2><p>Earlier this month, I <a
href="http://www.larryullman.com">posted on my blog</a> a few really <a
href="http://www.larryullman.com/2011/08/09/great-web-developer-resources/">great Web developer resources</a> that I came across while doing a last wave of research before writing my JavaScript book. In particular, both <a
href="https://developer.mozilla.org/">Mozilla</a> and <a
href="http://dev.opera.com/">Opera</a> have excellent articles discussing the core components of Web development: HTML, CSS, and JavaScript. (Mozilla maintains JavaScript, so that site also has the official JavaScript language reference.) You can definitely get lost following all the threads, but there&#8217;s a lot of excellent information presented on just these two sites.</p><h2 id="blog2">On the Blog => More on Non-Relational Databases</h2><p>In <a
href="http://www.larryullman.com/2011/04/16/what-is-larry-thinking-39-how-i-got-here-and-the-future/#blog1">a newsletter a while back</a>, I posted a blip about <a
href="http://www.mongodb.org/">MongoDB</a>, one of several new non-relational (aka, no-SQL) databases that have come up in the past couple of years. <a
href="http://www.larryullman.com">On my blog</a>, I&#8217;ve <a
href="http://www.larryullman.com/2011/07/29/more-on-non-relational-aka-nosql-databases/">posted a few more resources</a>, including links to longer articles about several different non-relational databases and the concept as a whole.</p><h2 id="qa1">Q&amp;A => Uploading Images to Multiple Directories</h2><p>In his reply to my previous book giveaway, Steven had asked what benefits there are to using multiple directories and subdirectories to store file uploads (he had noticed that Facebook does this). The key benefit, to me, is that taking this approach doesn&#8217;t break the server! Most of us never encounter this problem, but there are actual limits as to how many files and folders can be in a single directory. The exact allowed value differs from operating system to operating system (and, depending upon the operating system, the selected file system format can also have an impact), and the value is normally quite large. However, if you take a site like Facebook, with a half a billion (or whatever) users, and if each user uploads just ten images, that&#8217;s five billion files! The simple fact of the matter is that if you expect a site to have more than a few hundred uploaded files, you <em>have to</em> store files within multiple directories.</p><p>The second reason for dividing where files are stored is it will improve the site&#8217;s performance and possibly some of the user interface aspects. Any page that has to list the contents of a directory would benefit from that directory being just one of many, storing a subset of the entire body of files.  On a project I worked on years ago, with the potential for thousands (or more) of users, we used a directory structure <strong>X/Y/name</strong>, where X was the first letter of the user&#8217;s last name, Y was the second, and name was a unique identifier, such as the person&#8217;s username. So, in that scheme, if I registered with a username of &#8220;trout&#8221;, my images directory would be <strong>u/l/trout</strong>. That particular site never lasted long enough to put this approach to the test, but I have reason to believe it would have held up.</p><p>A follow up question, then, is how to handle a lot of simultaneous file uploads. The HTTP protocol, through which most Web pages are loaded in the browser, is <em>not</em> a good protocol for transferring large amounts of data. A better solution is to embed a Java or Flash application in the Web page and have that application transfer the data (such applications can do so over other protocols).</p><h2 id="qa2">Q&amp;A => How Do You Price a Freelance Project?</h2><p>I was recently asked by someone via email how to go about pricing freelance projects. I don&#8217;t know if I&#8217;ve discussed this before, and I thought it worth some paragraphs here.</p><p>There are two broad factors for determining a rate: <em>global</em> and <em>personal</em>. The global subfactors include supply and demand, implied technical difficulty, regional considerations, and so forth. For example, Web development is still in high demand, but there are a lot of people doing it, so that lowers the general rate. Mobile app development is in high demand and there aren&#8217;t quite so many people doing that, so that raises the general rate. Oracle database administration and design is implicitly more technically difficult, and therefore pays better, than MySQL database administration and design. In theory, people in, say, England will charge more than those in, say, Vietnam. But due to a global economy, this consideration is far less binding for many jobs. All of these global factors create a range of rates, from $X to $Y. Before looking at your own situation, you should be aware of a reasonable global rate range (a little research should do it), as you probably don&#8217;t want to be charging less than $X or more than $Y, regardless of your personal details. (With some exceptions: when someone hires <a
href="http://meyerweb.com/">Eric Meyer</a> to do a CSS project, he can probably charge whatever he wants.)</p><p>The personal subfactors start with your own level of expertise and experience. If you&#8217;ve been doing, say, Web development for ten years, and have a nice portfolio, it&#8217;s reasonable to charge more than if you&#8217;re just starting out. If you&#8217;ve written a book on a particular subject, you can apparently charge more, whether that&#8217;s reasonable or not! Next, you need to factor in your own supply and demand: how busy you are, how badly you need the job, and so forth. One of the hard things about working independently is saying &#8220;No&#8221; to work, regardless of how busy you already are. But if you really need the work, it&#8217;s natural to charge less (in the hopes of improving the odds of getting the job), and if you don&#8217;t need the work so much, charge more (with the mentality of &#8220;if I am going to do this job, it has to be worth my while&#8221;). Finally, you may have to consider your business principles. For example, I get paid nothing for a fair amount of the work I do, such as answering questions in the <a
href="http://www.larryullman.com/forums/">support forums</a> or via email, or sending these newsletters (actually, those things all cost me some money, but there&#8217;s a marketing benefit to them), and I charge educational organizations and non-profits a fraction of my commercial rate. All of these personal factors go into tweaking the global rate to come up with your specific rate, and these personal factors differentiates the price you would quote for a job compared to the price that the person in the building next to you would estimate for the same job.</p><p>If there are two broad factors, there is one specific one: the project itself. I charge less if I&#8217;m interested in the project, if it&#8217;s in an area I&#8217;d like to get more involved with, if I feel good about the client (such as the likelihood of more work from that same client), and so forth. I charge more if the opposite is true. And, of course, the total amount has to be commensurate to the complexity and demands of the project itself. And when coming up with a project price, remember that projects almost always take more effort than you were expecting, and how much more effort is equal to how new the technologies and processes involved are to you (e.g., it&#8217;s taking me a few days to do my first mobile app using Flex but it&#8217;ll probably take me just a couple days to do the next one).</p><h2 id="thinking">What is Larry Thinking? => The JavaScript Problem</h2><p>I&#8217;m beginning to work full-time (or nearly full-time) on my next book, &#8220;Modern JavaScript: Develop and Design&#8221;. This book is based upon a proposal that I did about two and a half years ago (I think) for a different publisher. The goal of the book is not just to teach JavaScript but to address what I&#8217;m calling <em>The JavaScript Problem</em>. The JavaScript Problem is that the language&#8217;s design, capabilities, and history make it unlike any other language. Let&#8217;s look at these criteria in reverse order (Chapter 1 of the book, which is nearly written, discusses all of this in more detail).</p><p>JavaScript&#8217;s history is an ugly one and the end result is that today&#8217;s JavaScript is a vastly different beast than that created in 1996. In the late 1990&#8242;s, basically you had JavaScript for the Netscape Navigator browser and JScript (similar, but not the same) for Internet Explorer. Programming in JavaScript required lots of conditionals checking not only the browser type but its version, as there would be significant changes from versions 4 to 4.5 to 5. And, at best, JavaScript was used for form validation, but mostly it was used to create annoying alert messages, pop-up windows, and trivial applications of eye candy. Because JavaScript was used entirely within the Web browser, and because it wasn&#8217;t taken very seriously by &#8220;real&#8221; programmers, JavaScript was mostly the domain of client-side Web developers.</p><p>Thanks largely to Ajax, JavaScript today is a much more useful tool than it was fifteen years ago. And ironically, even though there are more types of browsers in use—Netscape became Firefox, Apple has Safari, Google has Chrome, and Opera still gets the occasional mention—and therefore more versions, programming to account for the variations has become much easier. Odd as that may sound, it&#8217;s due to a change in approach. In today&#8217;s JavaScript, instead of coding for the browser or version, one programs for <em>what the browser and version can support</em>. For example, instead of checking the browser version and knowing that these browsers can perform, say, DOM manipulation, JavaScript programmers now just run a test to see if the browser, regardless or type or version, can handle DOM manipulation:</p><blockquote><p> <code>if (document.getElementById) { // Go ahead!</code></p></blockquote><p>This change in approach is both simple and brilliant. If you want to see if it&#8217;s safe to use the <b>getElementById()<br
/> </b> method, just check if the Web browser supports it! Part of the reason this new approach works is that even though there are more browsers out there, they have come a long ways towards adopting standards (even Internet Explorer is better, albeit not where it should be).</p><p>JavaScript&#8217;s history is a problem for three reasons. First, people not up to date with what JavaScript can do, or how to program JavaScript properly, are inevitably misusing or underusing the language. Second, those of us who&#8217;ve been working with JavaScript since the early days have to undo our own bad habits. Third, those new to the language will no doubt run across older code, thereby running the risk of picking up their own bad habits, even when learning from fresh. I personally believe that part of the reason there aren&#8217;t more good JavaScript books out there is that most of these books are just updates upon updates of books written about the old, now thoroughly-outdated, JavaScript.</p><p>In terms of JavaScript&#8217;s capabilities, what used to be a language for playing sounds in the browser (ugh) or creating scrolling tickers (ugh), can now do dramatic and wonderful things: DOM manipulation, server-side requests via Ajax, <em>useful</em> animation, and more. &#8220;Web 2.0&#8243;—a term I despise—is largely JavaScript-based (Rich Internet Applications, RIAs, using Flash still use JavaScript, too). In fact, just a few of the ways that today&#8217;s JavaScript can be used, besides in a Web page, include:</p><ul><li>In PDFs</li><li>Internally in many of Adobe&#8217;s applications</li><li>To create desktop applications</li><li>As a server-side alternative to PHP or the like</li></ul><p>JavaScript is still mostly used as a Web browser enhancement, but what you <em>can</em> do with the language far exceeds that.</p><p>Finally, there&#8217;s JavaScript&#8217;s design. To start, JavaScript is an object-oriented language, but it&#8217;s not your typical object-oriented language. In fact, it&#8217;s a <em>prototypical</em> object-oriented language. What does that mean? In a typical OO language, which is to say almost all of them, programmers define classes and then create instances of those classes. The typical OO language also has its own defined classes, for common types like Strings, and common needs. JavaScript has its own defined classes, too, but programmers do not create their own classes. Instead, in JavaScript you can create your own object, with its own properties (variables) and methods (functions), and then use that. You can also, thanks to the <em>prototype</em> property, dynamically change the definition of any object, including the core JavaScript objects like String. In simple terms, this means you can alter what information an object can store and what that object can do on the fly (Ruby allows for this, too, although Ruby is not a prototyped language). This key difference in how JavaScript is designed is what makes it possible for true JavaScript wizards (such as <a
href="http://ejohn.org/">John Resig</a>, who created <a
href="http://jquery.com">jQuery</a> and worked for <a
href="http://www.mozilla.org">Mozilla</a> until recently, or <a
href="http://crockford.com/">Douglass Crockford</a>, a JavaScript expert at Yahoo!) to do the magic that they do. It&#8217;s also what makes modern JavaScript, on the high end, daunting for some new to the language.</p><p>The goal of &#8220;Modern JavaScript: Develop and Design&#8221; is to thoroughly teach today&#8217;s JavaScript, of course, so that readers can do what they want/need to do. But it&#8217;s important to me that the readers understand <em>why</em> that&#8217;s the way to do it, too. JavaScript as a language has plenty of baggage that comes with it, and that baggage needs to be opened and examined, and much of it tossed, in order to fully grasp and appreciate this lovely little language.</p><h2 id="giveaway">Book Giveaway => &#8220;PHP for the Web: Visual QuickStart Guide&#8221; and &#8220;Effortless Flex 4 Development&#8221;</h2><p>There was a nice response to the book giveaway announced in the previous newsletter, with equal interest in the &#8220;<a
href="http://www.larryullman.com/books/php-for-the-web-visual-quickstart-guide-4th-edition/">PHP for the Web: Visual QuickStart Guide</a>&#8221; (4th edition) and &#8220;<a
href="http://www.larryullman.com/books/effortless-flex-4-development/">Effortless Flex 4 Development</a>&#8221; books. (I suspect that Flex&#8217;s ability to create mobile apps, thanks to Flex 4.5 and Adobe AIR 2.6 has increased the interest in Flex.)</p><p>My thanks to everyone for their interest in the books. I will be giving away copies of the fourth edition of my &#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickStart Guide&#8221; in September, I expect.</p><h2 id="news">Larry Ullman&#8217;s Book News => &#8220;PHP and MySQL for Dynamic Web Sites&#8221; (4th Edition) and &#8220;Modern JavaScript&#8221;</h2><p>As of Thursday, August 18th, the fourth edition of my &#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide&#8221; book is at the printer, which means it should be available at a store (or online) soon. The estimated date I have from the publisher is September 9th.</p><p>Almost all of the planned extra material (i.e., the stuff new in this edition) did make it into the printed book.  This includes:</p><ul><li>Extra material on database design, JOINs, advanced SQL, and advanced MySQL functions</li><li>A new chapter introducing the <a
href="http://jquery.com">jQuery</a> JavaScript framework, walking through form validation, DOM manipulation, and Ajax</li><li>A new chapter introducing Object-Oriented Programming (OOP) in PHP, focusing on the basic syntax and principles, with examples recreating earlier MySQL-based scripts and another example performing date and time validation and manipulation</li></ul><p>And this edition has a &#8220;Review and Pursue&#8221; section at the end of each chapter. That section, as in the fourth edition of my &#8220;PHP for the Web: Visual QuickStart Guide&#8221; book, has review questions on the material just introduced and prompts for how you can extend the newfound knowledge.</p><p>Unfortunately, due to space constraints, it was decided to pull out the appendix and make that a freely available PDF, to be downloaded from the publisher&#8217;s Web site. As the appendix is mostly about installation, I don&#8217;t think that&#8217;s too much of a sacrifice. The appendix also includes in this edition about a dozen pages on server (i.e., <a
href="http://httpd.apache.org">Apache</a>) configuration and manipulation. But you can download the PDF to read that material. I don&#8217;t have any details as to how you go about finding the appendix on the publisher&#8217;s Web site, but will post that information when I have it.</p><p>For the first time ever, I&#8217;m doing screencasts to accompany the text. These videos will be embedded in some electronic versions of the book and made available separately (as I understand it). Most of the videos demonstrate and expand upon specific book content. I&#8217;m hoping to wrap up those videos in the next couple of days.</p><p>I&#8217;ve been wrapping up my initial extra research for my next book, &#8220;Modern JavaScript.&#8221; I&#8217;m looking forward to writing this and have a good sense of what the book will be. I&#8217;ve got a good bulk of the first two chapters written, and am hoping I&#8217;ll be able to make good progress in September.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/08/26/what-is-larry-thinking-44-web-development/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> <item><title>&#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide&#8221; (4th Edition) Off to the Printer!</title><link>http://www.larryullman.com/2011/08/18/php-and-mysql-for-dynamic-web-sites-visual-quickpro-guide-4th-edition-off-to-the-printer/</link> <comments>http://www.larryullman.com/2011/08/18/php-and-mysql-for-dynamic-web-sites-visual-quickpro-guide-4th-edition-off-to-the-printer/#comments</comments> <pubDate>Thu, 18 Aug 2011 15:00:47 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[book]]></category> <category><![CDATA[phpmysql4]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2732</guid> <description><![CDATA[I am very happy to say that the fourth edition of my &#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide&#8221; book is officially off to the printer today! That means it should be available for purchase soon. Update: I believe the &#8220;release date&#8221; is September 9th. The widget below shows Amazon&#8217;s current price [...]]]></description> <content:encoded><![CDATA[<p>I am very happy to say that the fourth edition of my &#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide&#8221; book is officially off to the printer today! That means it should be available for purchase soon.</p><blockquote><p><strong>Update: I believe the &#8220;release date&#8221; is September 9th.</strong></p></blockquote><p>The widget below shows Amazon&#8217;s current price for the book. Thanks to everyone in advance for their interest in this book (or any of them)!<br
/> <iframe
style="width: 120px; height: 240px;" src="http://rcm.amazon.com/e/cm?lt1=_blank&amp;bc1=FFFFFF&amp;IS2=1&amp;nou=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=larrullm09-20&amp;o=1&amp;p=8&amp;l=as1&amp;m=amazon&amp;f=ifr&amp;ref=tf_til&amp;asins=0321784073" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="320" height="240"></iframe></p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/08/18/php-and-mysql-for-dynamic-web-sites-visual-quickpro-guide-4th-edition-off-to-the-printer/feed/</wfw:commentRss> <slash:comments>14</slash:comments> </item> <item><title>What Is Larry Thinking? #43 =&gt; Future Tech</title><link>http://www.larryullman.com/2011/07/31/what-is-larry-thinking-43-future-tech/</link> <comments>http://www.larryullman.com/2011/07/31/what-is-larry-thinking-43-future-tech/#comments</comments> <pubDate>Sun, 31 Jul 2011 01:44:33 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Flex]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[app]]></category> <category><![CDATA[book]]></category> <category><![CDATA[css3]]></category> <category><![CDATA[flash]]></category> <category><![CDATA[flash builder]]></category> <category><![CDATA[html5]]></category> <category><![CDATA[mobile]]></category> <category><![CDATA[modernizr]]></category> <category><![CDATA[newsletter]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2692</guid> <description><![CDATA[In this edition… About This Newsletter What Were You Thinking? =&#62; Doing What I Do On the Web =&#62; Flash Builder 4.5 for PHP On the Web =&#62; The Modernizr JavaScript Library Q&#38;A =&#62; What Do You Think About HTML5, CSS3, and the Future? Q&#38;A =&#62; Where Are Your Thoughts on HTML5, Browsers, and Mobile [...]]]></description> <content:encoded><![CDATA[<p>In this edition…</p><ul><li><a
href="http://www.larryullman.com/2011/07/31/what-is-larry-thinking-43-future-tech/#about">About This Newsletter</a></li><li><a
href="http://www.larryullman.com/2011/07/31/what-is-larry-thinking-43-future-tech/#you">What Were You Thinking? =&gt; Doing What I Do</a></li><li><a
href="http://www.larryullman.com/2011/07/31/what-is-larry-thinking-43-future-tech/#web1">On the Web =&gt; Flash Builder 4.5 for PHP</a></li><li><a
href="http://www.larryullman.com/2011/07/31/what-is-larry-thinking-43-future-tech/#web2">On the Web =&gt; The Modernizr JavaScript Library</a></li><li><a
href="http://www.larryullman.com/2011/07/31/what-is-larry-thinking-43-future-tech/#qa1">Q&amp;A =&gt; What Do You Think About HTML5, CSS3, and the Future?</a></li><li><a
href="http://www.larryullman.com/2011/07/31/what-is-larry-thinking-43-future-tech/#qa2">Q&amp;A =&gt; Where Are Your Thoughts on HTML5, Browsers, and Mobile Devices?</a></li><li><a
href="http://www.larryullman.com/2011/07/31/what-is-larry-thinking-43-future-tech/#thinking">What is Larry Thinking =&gt; Quantum Computing</a></li><li><a
href="http://www.larryullman.com/2011/07/31/what-is-larry-thinking-43-future-tech/#giveaway">Book Giveaway =&gt; &#8220;PHP for the Web: Visual QuickStart Guide&#8221; and &#8220;Effortless Flex 4 Development&#8221;</a></li><li><a
href="http://www.larryullman.com/2011/07/31/what-is-larry-thinking-43-future-tech/#news">Larry Ullman&#8217;s Book News =&gt; &#8220;PHP and MySQL for Dynamic Web Sites&#8221; (4th Edition) and &#8220;Modern JavaScript&#8221;</a></li></ul><p><span
id="more-2692"></span></p><h2 id="about">About This Newsletter</h2><p>Hello, hello, hello. For those of you in the United States, I hope you&#8217;re reading this in a quiet, air conditioned room (it&#8217;s been a brutally hot summer here in the states)! The three weeks since the last newsletter went by quickly, so much so that it&#8217;s actually been about four weeks! This newsletter begins with a reader response to my extended &#8220;Careers in IT&#8221;/&#8221;Doing What I Do&#8221; series, posted in the <a
href="http://www.larryullman.com/tag/newsletter/">past several newsletters</a>. Next you&#8217;ll find references to a few interesting things online, followed by answers to some questions I&#8217;ve received (thanks for those!). At the conclusion of the newsletter, there&#8217;s a blip about <em>quantum computing</em>, stemming from a fascinating article in <em>The New Yorker</em> a couple months back. All in all, this newsletter is largely about <em>future tech</em>. And, per usual, the newsletter ends with news about my forthcoming books. Oh, and there&#8217;s a book giveaway, too, with another one to follow in about a month or so.</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; Doing What I Do</h2><p>Over <a
href="http://www.larryullman.com/tag/newsletter/">several issues of this newsletter</a>, I discussed careers in IT and doing what I do. Something I&#8217;ve mentioned before is that a great thing about working in IT is that you can imagine, and realize, your own projects. This is not something that architects or doctors can do (not ethically, at least!). Specifically I mentioned that you&#8217;re able to try to create your own Next Big Thing, and can often do so with little introductory cost. Ross replied with a good point about how &#8220;aiming for &#8216;The Next Big Thing&#8217; may skew the discussion a bit&#8221;. There are lots of levels of success, many of them far more attainable than trying to earn yourself billionaire status. Ross says that he tries to objectively analyze a project, determining the likelihood of making money and, at what level. Having a sense of that makes it easier for him to adjust the risk—financial and otherwise—he takes accordingly. The question Ross asks himself is &#8220;Can a creation be profitable and sustainable, and do the finances work [for the creator's] personal situation?&#8221;</p><p>My thanks to Ross for this input, and I hope I didn&#8217;t badly misrepresent his perspective. I agree that it&#8217;s important to look at projects not just in terms of how financially successful they can be, but also in terms of whether the reasonable estimate of success matches the amount of personal risk. And, Ross&#8217;s bigger point is that there are multiple goals one can shoot for, many of them far more attainable than others.</p><p>I would also point out that, so long as the personal risk and loss isn&#8217;t too great, there&#8217;s a lot of value that can be gained through failure. Not that I like it when projects fail, but as Walter Brunell said, &#8220;Failure is the tuition you pay for success.&#8221;</p><h2 id="web1">On the Web =&gt; Flash Builder 4.5 for PHP</h2><p>Version 4.5 of the <a
href="http://www.adobe.com/products/flex/">Flex framework</a> makes it easier to develop applications destined for mobile devices, but version 4.5 of the corresponding <a
href="http://www.adobe.com/products/flash-builder.html">Flash Builder IDE</a> also comes with a nice bonus: even better integration with <a
href="http://www.php.net">PHP</a>.</p><p>PHP is my Web programming language of choice, and in version 4 of the Flex framework and the Flash Builder IDE, <a
href="http://www.adobe.com">Adobe</a> made a purposeful attempt to increase usage of Flex among the PHP community (this is also when I really began embracing Flex). For example, Flash Builder 4 comes with a wizard for connecting to PHP scripts, including creation of boilerplate PHP code. The new Flash Builder 4.5 IDE, recently released, comes in a couple of versions: <em>Standard</em>, <em>Premium</em> (with extra wizards, debugging tools, and profiling utilities), <em>Flash Builder 4.5 for PHP Standard</em>, and <em>Flash Builder 4.5 for PHP Premium</em>. The Flash Builder 4.5 for PHP versions were created in conjunction with <a
href="http://www.zend.com">Zend</a>, and include an integrated version of <a
href="http://www.zend.com/en/products/studio/">Zend Studio 8</a>. As both Flash Builder and Zend Studio are built upon <a
href="http://www.eclipse.org/">Eclipse</a>, this is a natural fit. And Flash Builder 4 started using <a
href="http://framework.zend.com/download/amf">Zend AMF</a> to transmit data in Action Message Format between Flash applications and PHP scripts; the two companies have been working together for a while.</p><p>Needless to say, if you&#8217;re already doing Flex and PHP development (like I am), Flash Builder 4.5 for PHP is the perfect tool. The ability to do all the programming, both server-side PHP and client-side Flex, in one application, will save a lot of time. Just the debugging alone…Flash Builder 4.5 for PHP will let you debug both the PHP script and the Flash application without changing programs!</p><p>In terms of pricing, Flash Builder 4.5 Standard is $249.00, if purchased new, and Zend Studio is $299.00 (all prices are in US dollars and accurate as I write this). Flash Builder 4.5 for PHP Standard is $399.00, so there&#8217;s a decent price break compared to having the applications individually.</p><p>For a good, quick introduction to Flash Builder 4.5 for PHP, see <a
href="http://www.adobe.com/devnet/flash-builder/articles/introducing-flashbuilder45-php.html">this article at the Adobe Developer Connection</a>.</p><h2 id="web2">On the Web =&gt; The Modernizr JavaScript Library</h2><p>HTML5 and CSS3 add useful and cool new features, but, as always, browser support is still an issue. If you want to develop sites using cutting edge options, while still being backwards-compatible, a great tool to use is <a
href="http://www.modernizr.com/">Modernizr</a>. The concept is simple (and brilliant): Modernizr identifies what features the user&#8217;s browser supports and adds corresponding classes to the opening HTML tag. In your CSS, you can then add styling to just those classes. The result is that browsers that support, say, <strong>@font-face</strong> or <strong>canvas</strong>, will get the stylized version, and browsers that don&#8217;t, won&#8217;t. Modernizr also creates a JavaScript object that represents the browser&#8217;s capabilities. This object could be used to customize your JavaScript accordingly, too. And Modernizr has IE-specific tools, that add HTML5-like functionality to that browser.</p><p>For good, quick introductions, see the <a
href="http://www.modernizr.com/">Modernizr site</a>, <a
href="http://www.alistapart.com/articles/taking-advantage-of-html5-and-css3-with-modernizr/">this article at A List Apart</a>, and <a
href="http://webdesignernotebook.com/css/how-to-use-modernizr/">this article at Web Designer Notebook</a>. Modernizr just came out in version 2 and is open source.</p><h2 id="qa1">Q&amp;A =&gt; What Do You Think About HTML5, CSS3, and the Future?</h2><p>HTML5 has received a ton of press and talk over the past few months and it definitely needs to be on any Web developer&#8217;s radar. Martin wrote in, asking me</p><blockquote><p>Are you excited by HTML5, CSS3, the W3C&#8217;s direction of web standards and ultimately the future of where the web is going?  How do you perceive PHP and MySQL adapting within this ever changing environment?</p></blockquote><p>The two simple answers are, &#8220;I&#8217;m kind of excited&#8221; and &#8220;I don&#8217;t think these changes will have a huge impact on PHP and MySQL&#8221;. As for the first answer, I&#8217;m not trying to be cynical or jaded here, but we&#8217;ve got to keep in mind the glacial pace with which new standards are adapted by corporations. It will be years before HTML5 will be reliable for all the major browsers. And one must keep in mind that the version of HTML5 that will eventually be formalized will undoubtedly be different than the version being discussed today. There are some great new features suggested in HTML5, such as local storage, an email input type, support for regular expressions, and many new elements, but it&#8217;ll be eons before those features are going to be universally (or universally-enough) usable in your sites. Now, tools such as <a
href="http://www.modernizr.com/">Modernizr</a> (just mentioned) help, and going ahead and adopting HTML5 today, with the knowledge that the site won&#8217;t work the same in all browsers, is only a problem if universal support is a goal; cutting-edge sites quite blatantly insist that visitors use a good, modern browser.</p><p>But the HTML5 proposal is a good thing, as it acknowledges what today&#8217;s Web is compared to the Web that was envisioned when HTML was created. On the other hand, where will the Web be in years from now when HTML5 is finally adopted?</p><p>I&#8217;m intrigued by some of the additions in CSS3, but not being a designer, they don&#8217;t have as much of an impact on me as HTML5.</p><p>As for PHP and MySQL adapting to HTML5, I don&#8217;t see that being much of an issue. PHP and MySQL are server-side technologies; HTML5 is the very definition of a client-side technology. For the most part, switching a site to HTML5 will have no more impact on the server side of things than if you switched from HTML 4.01 to XHMTL 1.1. Now, HTML5 does support client-side storage, so that may affect how you do some things, but I don&#8217;t think the impact on PHP and MySQL will be significant.</p><h2 id="qa2">Q&amp;A =&gt; Where Are Your Thoughts on HTML5, Browsers, and Mobile Devices?</h2><p>On a similar note, Jorge sent in a question, asking me what I think of HTML5, both with respect to its impact on browsers and mobile devices (smart phones, tablets, etc.). In terms of browsers, I&#8217;ve just addressed that in reply to Martin&#8217;s question, but HTML5 for mobile devices is an intriguing prospect. The difference is this: the mobile platform itself means that mobile users will always have current, HTML5-capable Web browsers. I recently read an interesting article at the <a
href="http://www.chicagotribune.com">Chicago Tribune&#8217;s Web site</a> (my home town paper) about using HTML5 for mobile app development (the article does not seem to be currently available). <a
href="http://www.ft.com">The Financial Times</a> and <a
href="http://www.espn.com">ESPN</a> just released new applications for mobile devices, but instead of creating standalone apps, they used HTML5 to make Web apps. HTML5 provides all the functionality the apps needed, such as content storage for offline reading, video support, and the ability to respond to touch and gestures. By creating a Web app, one application can reliably work on all the platforms, and the proceeds from the app do not have to be split with Apple or the Android store.</p><p>In no way am I suggesting that HTML5 is the only smart way to create mobile apps—there&#8217;s still plenty HTML5 can&#8217;t do, but this is an interesting turn of events that I, for one, didn&#8217;t see coming.</p><h2 id="thinking">What is Larry Thinking? =&gt; Quantum Computing</h2><p>In the May 2, 2011 issue of <em>The New Yorker</em> (one of my longtime favorite periodicals), there was a fascinating article by Rivka Galchen, titled &#8220;<a
href="http://www.newyorker.com/reporting/2011/05/02/110502fa_fact_galchen">Dream Machine</a>&#8220;. The article discusses the topic of <em>quantum computing</em>, which I believe will—someday—have a huge impact on our lives. I&#8217;ll try to summarize the key points as best as I can, considering I have no science background, but you can check out the article at a library or pay to read it online if you want the full story. Note that text in quotation marks below come verbatim from the article, starting with this assertion:</p><blockquote><p>&#8220;With one millionth of the hardware of an ordinary laptop, a quantum computer could store as many bits of information as there are particles in the universe.&#8221;</p></blockquote><p>Computers being used today are binary: at the most basic, fundamental level, there are <em>bits</em>, each bit representing either 0 or 1. Everything you do on your computer comes down to zeros and ones. These computers are based upon classical mechanics, discovered by Isaac Newton, although few of us ever think of that when surfing the Web, I&#8217;m sure. Classical mechanics, also called <em>classical physics</em>, still accurately describe much of the physical world at large, but on an atomic level, classical mechanics don&#8217;t hold up so well. <em>Quantum mechanics</em>, or <em>quantum physics</em>, does a better job of explaining what&#8217;s going on in the atomic and sub-atomic levels.</p><p>One principle of <a
href="http://en.wikipedia.org/wiki/Quantum_mechanics">quantum mechanics</a> is that the same particle can exist in two places at once (this is referred to as <em>superposition</em>). A second principle is that two particles can be <em>entangled</em>: they can communicate with each other &#8220;regardless of their distance in space and time&#8221;. Whoa. Taking these two principles, a quantum computer is built using quantum bits, or <em>qubits</em>, instead of regular bits. Unlike a regular bit, which can represent 0 or 1, a qubit can also represent <em>0 and 1</em>, thanks to superposition. Whoa. Thanks to entanglement, qubits can &#8220;instantly share information&#8221;. Whereas data in a traditional computer must be transmitted from bit to bit, qubits will communicate instantly (and in an un-observable manner). Whoa.</p><p>This may all sound quite theoretical, too philosophical to be useful. But venture capital is going into this area, trying to build quantum computers for specific purposes, and Google&#8217;s been striving towards quantum-computing since 2006. Yale has already created a two-qubit computer, and Oxford an eight-qubit one. An estimate is that fifty to a hundred qubits would be as powerful as today&#8217;s laptop.</p><p>To test the capability of quantum computers, researchers try different tests, such as <a
href="http://en.wikipedia.org/wiki/Grover's_algorithm">Grover&#8217;s algorithm</a>, which is a quantum algorithm for searching an unordered database. A test of Grover&#8217;s algorithm can be as simple as four-card monte: four cards are face down, one is a queen, how many steps does it take to find the queen? A conventional computer using a straightforward algorithm finds the queen in an average of about 2.25 steps. (You could probably write that program yourself: check the first card; if that&#8217;s not it, check the second; if that&#8217;s not it, check the third; if that&#8217;s not it, then you know it&#8217;s the fourth. There are three steps, maximum, and sometimes you&#8217;ll get luckier.) <strong>A quantum computer can solve this puzzle in just one step.</strong> (The article explains how, but the explanation is complicated.)</p><p>That particular example may not sound that useful, so let&#8217;s turn to <a
href="http://en.wikipedia.org/wiki/Prime_factorization">prime factorization</a> (or <em>integer factorization</em>). Take two prime numbers and multiply them: say, 3 and 7 results in 21. You and I know looking at that number–21–that it is the product of 3 and 7. In an instant, most of us can reverse-engineer that calculation. But as the two original prime numbers get larger, it becomes exponentially harder to determine what two primes were used to make the resulting product. In 2009, researchers were able to determine the factors of a 232-digit number. It took hundreds of machines two years to do that. That particular number required 768-bits to be represented in the computer. The researchers estimated that just changing to a 1024-bit number would be about one thousand times harder. But why is this significant? Because prime factorization is the basis of modern cryptography, such as RSA. <strong>A conventional computer cannot reasonably break encryption schemes based upon prime factorization, but a quantum computer could break one in an afternoon.</strong></p><p>This article on quantum computing was a really fascinating read, in my opinion, and I encourage you to check it out. I hope that my synopsis has been intriguing enough and sufficiently accurate. The article goes into further details about some of the key people involved in these fields, the histories of computers and physics, and some of the technical challenges to quantum computers, like qubit <em>fidelity</em> (e.g., the two-qubit computer solves the four-card monte puzzle in one step, but is only correct 80% of the time). And I didn&#8217;t touch upon the <em>Many Worlds</em> theory, which suggests that perhaps quantum computers function by performing calculations in parallel universes! Whoa.</p><h2 id="giveaway">Book Giveaway =&gt; &#8220;PHP for the Web: Visual QuickStart Guide&#8221; and &#8220;Effortless Flex 4 Development&#8221;</h2><p><em>You must be subscribed to the newsletter to qualify for book giveaways.</em></p><p><strong>Larry Ullman&#8217;s Book News =&gt; &#8220;PHP and MySQL for Dynamic Web Sites&#8221; (4th Edition) and &#8220;Modern JavaScript&#8221;</strong></p><p>The complete draft of the fourth edition of my &#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide&#8221; book has now been submitted to the publisher and I&#8217;ve completed the rewrites on most of the book as well. Now I need to review the PDF layouts of each chapter, and then it&#8217;s off to the printer. Well, after the indexer and other important people take a crack at it first…</p><p>Some key new features in this edition will be:</p><ul><li>Extra material on database design, JOINs, advanced SQL, and advanced MySQL functions</li><li>About a dozen pages on server (i.e., <a
href="http://httpd.apache.org">Apache</a>) configuration and manipulation</li><li>A new chapter introducing the <a
href="http://jquery.com">jQuery</a> JavaScript framework, walking through form validation, DOM manipulation, and Ajax</li><li>A new chapter introducing Object-Oriented Programming (OOP) in PHP, focusing on the basic syntax and principles, with examples recreating earlier MySQL-based scripts and another example performing date and time validation and manipulation</li></ul><p>The final page count for the work I submitted isn&#8217;t in, but I <em>think</em> I should be able to get the extra material in there.</p><p>Along with the above, I&#8217;ve removed references to PHP 6 (my &#8220;Dewey Defeats Truman&#8221; moment, as <a
href="http://www.larryullman.com/forums/index.php?/topic/450-there-is-no-php-6-version-why-then-does-this-book-has-php6-as-title/">Paul so brilliantly named it</a>), changed a couple of the examples, fixed any minor problems, and added a &#8220;Review and Pursue&#8221; section to the end of each chapter. That section, as in the fourth edition of my &#8220;PHP for the Web: Visual QuickStart Guide&#8221; book, has review questions on the material just introduced and prompts for how you can extend the newfound knowledge.</p><p>For the first time ever, I&#8217;m doing screencasts to accompany the text. These videos will be embedded in some electronic versions of the book and made available separately (as I understand it). Most of the videos demonstrate and expand upon specific book content. I&#8217;m in the process of doing those videos over the next month.</p><p>The book should be available in a store near you, and online, within two months at the latest.</p><p>In August, I officially turn my full-time attention to my next book, &#8220;Modern JavaScript.&#8221; Whohoo!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/07/31/what-is-larry-thinking-43-future-tech/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>What is Larry Thinking? #42 =&gt; Doing What I Do, Part 3</title><link>http://www.larryullman.com/2011/07/04/what-is-larry-thinking-42-doing-what-i-do-part-3/</link> <comments>http://www.larryullman.com/2011/07/04/what-is-larry-thinking-42-doing-what-i-do-part-3/#comments</comments> <pubDate>Mon, 04 Jul 2011 21:02:19 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Adobe AIR]]></category> <category><![CDATA[Flex]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[app]]></category> <category><![CDATA[book]]></category> <category><![CDATA[ecom]]></category> <category><![CDATA[flash builder]]></category> <category><![CDATA[mobile]]></category> <category><![CDATA[newsletter]]></category> <category><![CDATA[phpmsyql4]]></category> <category><![CDATA[phpvqs4]]></category> <category><![CDATA[stored procedures]]></category> <category><![CDATA[writing]]></category> <category><![CDATA[yii]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2674</guid> <description><![CDATA[In this edition… About This Newsletter What Were You Thinking? =&#62; The JavaScript Book On the Web =&#62; Flash Builder 4.5/Flex 4.5 for Mobile Apps On the Blog =&#62; Cookies and Sessions in Yii On the Forum =&#62; FALSE Comparisons in PHP Q&#38;A =&#62; Could You Say More About Stored Procedures? What is Larry Thinking [...]]]></description> <content:encoded><![CDATA[<p>In this edition…</p><ul><li><a
href="http://www.larryullman.com/2011/07/04/what-is-larry-thinking-42-doing-what-i-do-part-3/#about">About This Newsletter</a></li><li><a
href="http://www.larryullman.com/2011/07/04/what-is-larry-thinking-42-doing-what-i-do-part-3/#you">What Were You Thinking? =&gt; The JavaScript Book</a></li><li><a
href="http://www.larryullman.com/2011/07/04/what-is-larry-thinking-42-doing-what-i-do-part-3/#web">On the Web =&gt; Flash Builder 4.5/Flex 4.5 for Mobile Apps</a></li><li><a
href="http://www.larryullman.com/2011/07/04/what-is-larry-thinking-42-doing-what-i-do-part-3/#blog">On the Blog =&gt; Cookies and Sessions in Yii</a></li><li><a
href="http://www.larryullman.com/2011/07/04/what-is-larry-thinking-42-doing-what-i-do-part-3/#forum">On the Forum =&gt; FALSE Comparisons in PHP</a></li><li><a
href="http://www.larryullman.com/2011/07/04/what-is-larry-thinking-42-doing-what-i-do-part-3/#qa">Q&amp;A =&gt; Could You Say More About Stored Procedures?</a></li><li><a
href="http://www.larryullman.com/2011/07/04/what-is-larry-thinking-42-doing-what-i-do-part-3/#thinking">What is Larry Thinking =&gt; Doing What I Do: Web Development</a></li><li><a
href="http://www.larryullman.com/2011/07/04/what-is-larry-thinking-42-doing-what-i-do-part-3/#news">Larry Ullman&#8217;s Book News =&gt; &#8220;PHP and MySQL for Dynamic Web Sites&#8221; (4th Edition) and &#8220;Modern JavaScript: Develop and Design&#8221;</a></li></ul><p><span
id="more-2674"></span></p><h2 id="about">About This Newsletter</h2><p>Another three weeks(-ish), another newsletter! It may only matter to me, but I&#8217;m happy to say that since I started using <a
href="http://www.literatureandlatte.com/scrivener.php">Scrivener</a> to write this newsletter (in late 2010), I&#8217;ve done a much better job in getting these out regularly. Although, since they only go out once a month, or slightly better, it may always seem to you that the newsletters come from out of the blue. Anyway&#8230;in this newsletter I present a random collection of stuff, including the conclusion of my on-going series on building a career in IT. In my next newsletter, I plan on speaking, briefly, about quantum computing, having recently read a <em>fascinating</em> article on the subject.</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; The JavaScript Book</h2><p>In the previous newsletter, I <a
href="http://www.larryullman.com/2011/06/09/what-is-larry-thinking-41-doing-what-i-do-part-2/#you">posted a question</a> about whether it matters to you if I self-publish my intended JavaScript book or if I use a traditional publisher. I also asked the general question as to what readers look for in a book, beyond the content and perhaps writer. There was an excellent response and I thank everyone for their thoughts.</p><p>The bottom line was that most people don&#8217;t care about the publisher. Some people specifically like, say, O&#8217;Reilly books or the Visual Quick* Series, but many don&#8217;t pay much attention to the publisher (I&#8217;ve always suspected that many readers don&#8217;t pay much attention to who the writer is either). The strongest feedback was just for it being made available in specific formats—PDF, print, what-have-you, and that it be of good quality.</p><p>It was also nice, and quite flattering, to hear many people express their interest in purchasing the book, regardless of whether I self-publish or use a traditional publisher. I am, indeed, fortunate to have the readership that I do.</p><p>Thanks again to everyone that responded and to those of you interested in this book. The actual decision regarding this JavaScript book can be found in the &#8220;Larry Ullman&#8217;s Book News&#8221; section at the end of this newsletter (this is called &#8220;burying the lead&#8221;!).</p><h2 id="web">On the Web =&gt; Flash Builder 4.5/Flex 4.5 for Mobile Apps</h2><p>Version 4.5 of both the Flex framework and the Flash Builder IDE just came out and the outlook is very exciting. As announced some time ago, the focus in Flex 4.5 is on developing for mobile apps. This means a new wave of components optimized for mobile platforms. That alone might sound &#8220;kind of cool&#8221;, but this release is much, much bigger than that.</p><p>Instead of using Flex to write Flash content that runs in a Web browser in a mobile device (but not on Apple devices), thanks to <a
href="http://www.adobe.com/go/air/">Adobe AIR 2.6</a>, <em>you&#8217;ll be able to write true mobile apps in Flex</em>. With the initial release, you&#8217;re able to create apps for the Google Android platform (the largest platform, in terms of sales of mobile devices today). Version 4.5.1 was just released, which adds support for iOS (iPod Touch, iPhone, and iPad) devices and the Blackberry Tablet OS. To summarize:</p><blockquote><p>If you know Flex, you can create mobile applications that run on all major mobile platforms in no time at all!</p></blockquote><p>This could not come at a better time for me. I have a couple of mobile app ideas that I want to develop and was planning on learning how to do so later this year (yes, yes, I&#8217;m totally on the cutting edge of the mobile app craze, eh?). I was still hemming and hawing over whether to pursue the iOS route, which would be natural for me (I primarily use Macs and am comfortable with the C family of languages), or go the Google Android route, which would be harder (Java is the default language there), but technically has a broader market. And now, thanks to Flex 4.5 and Adobe AIR, I won&#8217;t have to choose between them.</p><p>To see the development process, and the output, in action, check out <a
href="http://tv.adobe.com/watch/adobe-technology-sneaks-2011/sneak-peek-of-mobile-application-development-with-flex-and-flash-builder/">this sneak peek video at Adobe</a>. There&#8217;s also <a
href="http://www.adobe.com/devnet/flex/articles/mobile-development-flex-flashbuilder.html">this pretty good article</a> on mobile development using Flex and Flash Builder. It&#8217;s a very impressive concept and, as far as I know, the only &#8220;write once, run everywhere&#8221; development solution for mobile apps. This, of course, is the promise of Adobe AIR itself, which allows you to write one application that can run on multiple operating systems (I still seem to be a bigger fan of AIR than the world at large).</p><h2 id="blog">On the Blog =&gt; Cookies and Sessions in Yii</h2><p>In my ever-ongoing series on the <a
href="http://www.yiiframework.com">Yii framework</a>, I&#8217;ve recently written two postings on managing state using the framework. The <a
href="http://www.larryullman.com/2011/05/03/using-sessions-with-the-yii-framework/">first is on sessions</a>; the <a
href="http://www.larryullman.com/2011/06/04/using-cookies-in-the-yii-framework/">second on cookies</a>. Neither is particularly difficult to do using Yii, once you know the right code, of course. With cookies, Yii has built-in extra security measures you can take, for example, to help prevent Cross-Site Request Forgery (CSRF) attacks.</p><h2 id="forum">On the Forum =&gt; FALSE Comparisons in PHP</h2><p>I&#8217;m hoping that you&#8217;ll take this as a comfort, but you should be aware that we all, no matter how long we&#8217;ve been programming, are capable of creating bugs when programming. Through the <a
href="http://www.larryullman.com/forums/index.php?/topic/301-problems-with-ecommerce-example-2-demo-site/">keen testing of a reader</a>, a bug was caught in the second example site from my &#8220;<a
href="http://www.larryullman.com/books/effortless-e-commerce-with-php-and-mysql/">Effortless E-Commerce with PHP and MySQL</a>&#8221; book. It&#8217;s a common enough mistake that I should have caught it myself and yet&#8230; You can read my formal explanation regarding the specific code <a
href="http://www.larryullman.com/forums/index.php?/topic/301-problems-with-ecommerce-example-2-demo-site/page__pid__2163#entry2163">in the forum</a>, but the premise is this:</p><p>Say you have the conditional <code>if ($var) {</code>. That conditional will be TRUE so long as <strong>$var</strong> has a TRUE value. But what is a TRUE value? It&#8217;s easiest to understand what a TRUE value is by knowing what a FALSE value is. These are all FALSE values:</p><ul><li>FALSE (case-insensitive)</li><li>NULL</li><li>(No actual value)</li><li>&#8220;&#8221; (An empty string)</li><li>0</li><li>0.0</li><li>‘0&#8242;</li></ul><p>There are a couple of other higher-end FALSEhoods, such as an empty array. It should be fairly obvious that FALSE, NULL, no actual value, and an empty string are all FALSE values; the bug arises when you forget that zero, in any form, is also FALSE. And here&#8217;s how it can manifest itself as a bug (this is a different example than the one in the book and referenced in the forum)…</p><p>The <strong>stripos()</strong> function is used to identify whether or not string Needle is found within another string Haystack. If the Needle is not found, <strong>stripos()</strong> returns FALSE. If the Needle is found, <strong>stripos()</strong> <em>does not return TRUE</em>, but rather <em>returns the indexed position where Needle begins in Haystack</em>. This code, therefore, could be a problem:</p><p><code>if (stripos($haystack, $needle)) {…</code></p><p>The intent is to see if <strong>$needle</strong> exists in <strong>$haystack</strong>. However, if <strong>$needle</strong> is the first part of <strong>$haystack</strong>, <strong>stripos()</strong> will return 0, which will be interpreted by that conditional as FALSE. The bug-free solution is to change the conditional to test if the value returned by <strong>stripos()</strong> is not identical to FALSE:</p><p><code>if (stripos($haystack, $needle) !== false) {…</code></p><p>Note that you have to explicitly use the <em>not identical</em> operator (<strong>!==</strong>), as using the <em>not equal</em> operator (<strong>!=</strong>) would again be a bug, as the zero returned by the function would, in fact, be equal (but not identical) to FALSE.</p><p>Again, I hope you can take some solace in knowing that we all make mistakes, no matter the level of experience (or maybe that&#8217;s depressing?). I personally find it frustrating to make mistakes that I&#8217;m already aware of as a possibility, but on the bright side, making mistakes you know about makes them easier to fix!</p><h2 id="qa">Q&amp;A =&gt; Could You Say More About Stored Procedures?</h2><p>Oguz had prompted me to write a bit about stored procedures in general and in MySQL in particular. Stored procedures are one of those higher-end database concepts which you may have heard about but never really used (other examples include VIEWs and UNIONs). I previously wrote about stored procedures in my &#8220;<a
href="http://www.larryullman.com/books/mysql-visual-quickstart-guide-2nd-edition/">MySQL: Visual QuickStart Guide</a>&#8221; and my &#8220;<a
href="http://www.larryullman.com/books/php-5-advanced-visual-quickpro-guide-2nd-edition/">PHP 5 Advanced: Visual QuickPro Guide</a>&#8220;, and then relied upon them extensively in the second example of my &#8220;<a
href="http://www.larryullman.com/books/effortless-e-commerce-with-php-and-mysql/">Effortless E-Commerce with PHP and MySQL</a>&#8220;.</p><p>Both <em>stored procedures</em> and <em>stored functions</em> fall under the category of <a
href="http://dev.mysql.com/doc/refman/5.1/en/stored-routines.html">stored routines</a>, added to MySQL in version 5.1 (and MySQL is still adding features in this area). A stored routine is simply a memorized set of SQL queries and code. Think of it like taking any block of PHP code that interacts with a database, has conditionals, does something with the query data, etc., but store all of that in the database itself. The primary difference between a stored procedure and a stored function is that a stored <em>function</em> can return only a single value whereas a stored <em>procedure</em> can return an entire result set (i.e., multiple rows of multiple columns of data). For example, in &#8220;PHP 5 Advanced&#8221;, a stored function is created that returns the distance in miles between two points on the globe, which involves complicated trigonometry using latitude and longitude. A call to that function is then part of a standard SELECT query, as if it were any other predefined MySQL function. Conversely, in &#8220;Effortless E-Commerce with PHP and MySQL&#8221;, stored procedures are used to update shopping carts, return a list of sale items, and much more. Both types of routines can also take arguments, just like functions in PHP.</p><p>Stored routines offer several benefits, the most important of which is improved security. Because all of the database references—table and column names—are in the stored routines, a PHP script using those routines need not have any knowledge of the particulars of the database. Further, a stored routine can use its arguments in queries with the same security as <em>prepared statements</em>, thereby preventing SQL injection attacks. Applications with the highest level of security requirements, such as banking, rely upon stored routines.</p><p>You can also get better performance using stored routines, both because the routines can be cached and because less data has to be transferred to the database (just the data itself gets transferred; all the SQL is already in the database). Using stored routines also offers improved application portability, in that many different types of clients—PHP scripts, command line tools, GUI applications, etc.—can make use of the same stored routines.</p><p>There are arguments against using stored routines, too. For starters, you&#8217;ll need a relatively current version of MySQL, and the ability to create an execute stored routines (these are permissions not necessarily offered by, for example, shared hosting environments). Stored routines also marry your applications to specific database applications (e.g., MySQL or Oracle), although stored routines are part of the SQL standard and may be somewhat translatable from one database application to the next. And, as with most things, there&#8217;s a learning curve involved and debugging applications that use stored routines becomes a bit harder.</p><p>You can find out more about stored routines in the books I mentioned, in the <a
href="http://dev.mysql.com/doc/refman/5.1/en/stored-routines.html">MySQL manual&#8217;s main page for stored routines</a>, and in the stored routines <a
href="http://dev.mysql.com/doc/refman/5.1/en/faqs-stored-procs.html">FAQ</a> and <a
href="http://dev.mysql.com/doc/refman/5.1/en/stored-program-restrictions.html">restrictions</a> pages of the MySQL manual.</p><h2 id="thinking">What is Larry Thinking? =&gt; Doing What I Do: Web Development</h2><p>In this newsletter I&#8217;m finishing what became a series on IT careers. I first wrote about becoming a better programmer, in two parts(<a
href="http://www.larryullman.com/2011/02/01/what-is-larry-thinking-36-becoming-a-better-programmer-and-more/#thinking">1</a> and <a
href="http://www.larryullman.com/2011/02/25/what-is-larry-thinking-37-becoming-a-better-programmer-part-2/#thinking">2</a>). Then I wrote about <a
href="http://www.larryullman.com/2011/03/22/what-is-larry-thinking-38-building-a-career/#thinking">building a career</a> and <a
href="http://www.larryullman.com/2011/04/16/what-is-larry-thinking-39-how-i-got-here-and-the-future/#thinking">how I got here</a>. Next, I wrote about <a
href="http://www.larryullman.com/2011/05/12/what-is-larry-thinking-40-doing-what-i-do-part-1/#thinking">some of the specifics of what I do</a>, focussing on the writing side. In the <a
href="http://www.larryullman.com/2011/06/09/what-is-larry-thinking-41-doing-what-i-do-part-2/#thinking">previous newsletter</a>, I discussed training. This leaves me with the last thing that I do: Web and application development (i.e., programming).</p><p>Web and application development jobs have a wide range of possibilities with a wide range of potential income. Small, simple jobs may pay a few hundred dollars; big, complex, and well-funded projects can pay tens of thousands or hundreds of thousands. Getting any job, regardless of size, is a two-step process: 1) finding out about the job; and, 2) convincing the client to hire you.</p><p>There are online sites for finding projects, but you&#8217;ll be competing with everyone else there. You&#8217;ll have better luck by networking: connecting with people, businesses, and organizations that might be able to make use of your abilities. For example, for a couple of years I was the outside programmer that did the dynamic functionality for a graphic designer. She got the projects, managed the clients, the contracts, and the billing, and I just did my share of the work. A perfect arrangement for me! Local user groups, schools, and similar communities can be good ways to hook up with people in a casual way that might pan out down the line.</p><p>As for convincing clients to hire you, the most important criteria in my mind are good communication skills. Everyone says that communication skills are important, but not that many people excel in this area, and way too many don&#8217;t even try to communicate well. <em>Be clear, responsive, and punctual in your communications!</em> Doing so demonstrates that you have a level of professionalism needed to do the work itself. If you can&#8217;t clearly express yourself in an email, if you fail to answer questions asked of you, or if you&#8217;re negligent in responding promptly, it suggests that the work you do will be poorly put together, will fail to meet expectations, and not be done on time, either.</p><p>Secondarily, you&#8217;ll need to have a portfolio showing what you&#8217;re capable of. If you don&#8217;t have a portfolio, then give them something that they can look at. One of my very first clients, for whom I&#8217;m still working, wanted a bit of JavaScript coding for his site. At that time I had no portfolio to show him, so as part of my bid, I did the work itself and presented that. Nothing more clearly indicates your ability to do a project than actually doing the project! Further, the client could also see, before he hired me, that the project would be finished quickly (because it already was). Yes, I ran the risk of making no money for my efforts, but at the time I needed the work and had to go out on a limb. It really panned out, and I would do it again if I felt I had to (arguably, I have had to in the past, as getting published involves some amount of writing on spec).</p><p>And this leads me to a point that you&#8217;ll (hopefully) learn in time as you grow your skills and your budget: you&#8217;ll always adjust your bids not just to the project and the client but to your situation. When I&#8217;m especially busy or if a project isn&#8217;t that interesting, clients will get the &#8220;I don&#8217;t really want to do this project but if I am going to do it, I&#8217;m going to get paid well&#8221; bid. When I&#8217;m not that busy or a project is interesting, I&#8217;ll provide a cheaper bid. Life is always a matter of time versus money, and the professional is constantly making adjustments along that scale.</p><p>As a final cornucopia of thoughts, first, don&#8217;t be afraid to overbid. Even if you&#8217;re desperate, you may really come to regret getting a project at a low bid. If anything, it tells you a lot about a client that wants the lowest price: you probably don&#8217;t want to work with people that want things on the cheap. There is no doubt you will sometimes make less money on a project than you should (and hopefully sometimes make more), but try not to plan on shortchanging yourself. For that matter, have a good contract in place with expectations clearly laid out so that you don&#8217;t get steamrolled.</p><p>Next, you could consider becoming a specialist in one area: CMS (e.g., Joomla), WordPress, etc. You run the risk of not being able to get work as easily, because you are so specialized, but you may also be able to make more money, and get better at a smaller set of skills faster, by narrowing your focus.</p><p>And lastly, if you&#8217;re working on a project and you&#8217;re having problems and aren&#8217;t going to make the deadline, handle the situation professionally. Never hide from clients, be as honest as you can, and always reply to emails promptly. For more strategies along these lines, check out <a
href="http://brainzooming.com/project-management-techniques-when-time-running-down/6869/">this nice article</a>.</p><p>So that&#8217;s it on my long series on building a career in IT. As happens with me, all the time, what started off as a simple idea expanded and expanded. I worry that I ran out of steam at the end here, but hopefully you&#8217;ve benefitted from this discussion somehow, and I&#8217;ve helped you, in whatever small way, in pursuing your dream of an IT career (as for me, my dream involves a hammock overlooking the Caribbean Sea).</p><h2 id="news">Larry Ullman&#8217;s Book News =&gt; &#8220;PHP and MySQL for Dynamic Web Sites&#8221; (4th Edition) and &#8220;Modern JavaScript: Develop and Design&#8221;</h2><p>I&#8217;m very pleased to say that I&#8217;ve completed the first draft of the fourth edition of &#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide&#8221; (and by &#8220;first draft&#8221;, I mean the first draft submitted to the publisher; there are multiple writing drafts just to get to that point). As with the fourth edition of &#8220;<a
href="http://www.larryullman.com/books/php-for-the-web-visual-quickstart-guide-4th-edition/">PHP for the Web: Visual QuickStart Guide</a>&#8220;, I added a &#8220;Review and Pursue&#8221; section to the end of each chapter. I also expanded the coverage of SQL and MySQL, including much more on JOINs. One new chapter introduces the <a
href="http://www.jquery.com">jQuery</a> JavaScript framework, with examples of form validation and performing Ajax requests. Another new chapter introduces the fundamentals of Object-Oriented Programming, using the MySQL Improved extension for several examples, and the <a
href="http://www.php.net/datetime">DateTime</a> class for another. In the appendix, I&#8217;ve included a few pages on configuring the Apache Web server, providing the syntax for performing common tasks such as password protecting directories and URL rewriting.</p><p>Last, but not least, I am pleased to announce that I have in my hands a contract to write the book &#8220;Modern JavaScript: Develop and Design&#8221; for Peachpit Press. This is the publisher I&#8217;ve worked with the most, and so I&#8217;m quite comfortable with them. The book will be in a new series, titled &#8220;Develop and Design&#8221;, specifically created for code-based books (the first title in the series is on ActionScript). The series does <em>not</em> use the two-column format like the Visual QuickStart/QuickPro series (which some people like, some people don&#8217;t), and will be in full color, a first for me. The publisher has allotted me up to 600 pages, which is quite a lot, and by using a publisher, the book will have the widest possible availability (Peachpit Press really worked with me on making this happen). I&#8217;ll begin formally writing the book in late July or early August so that it comes out by the end of the year. Once again, my thanks to everyone for their interest in this book, and for all of the feedback.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/07/04/what-is-larry-thinking-42-doing-what-i-do-part-3/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Take Control of Scrivener 2</title><link>http://www.larryullman.com/2011/07/02/take-control-of-scrivener-2/</link> <comments>http://www.larryullman.com/2011/07/02/take-control-of-scrivener-2/#comments</comments> <pubDate>Sat, 02 Jul 2011 14:13:42 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[book]]></category> <category><![CDATA[scrivener]]></category> <category><![CDATA[writing]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2654</guid> <description><![CDATA[I&#8217;m a pretty big fan of Scrivener, a writing application for Macs (there is a Windows version currently in beta). For about six months now I&#8217;ve been using Scrivener to write my newsletter, and a JavaScript book I&#8217;ve been working on for some time will be the first book I&#8217;ve written using it. There&#8217;s something [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m a pretty big fan of <a
href="http://www.literatureandlatte.com/scrivener.php">Scrivener</a>, a writing application for Macs (there is a Windows version currently in beta). For about six months now I&#8217;ve been using Scrivener to write my newsletter, and a JavaScript book I&#8217;ve been working on for some time will be the first book I&#8217;ve written using it. There&#8217;s something about Scrivener that just works for me, first and foremost, that I&#8217;m able to keep everything about a project—the writing, references, notes, etc.—in one place. As with any good piece of software, though, I&#8217;ve got a nagging feeling in the back of my mind that I&#8217;m not using Scrivener to its fullest potential. And by that I mean I&#8217;m absolutely convinced that I could be using Scrivener better.</p><p>For this reason, I was quite happy to see the release of the book &#8220;<a
href="http://www.takecontrolbooks.com/scrivener-2">Take Control of Scrivener 2</a>&#8220;. I haven&#8217;t read it yet (ironically, I&#8217;m waiting to complete the book I&#8217;m currently working on first), but it&#8217;s high on my &#8220;to-read&#8221; list. Just scanning the 22-page sample that&#8217;s available, this looks like a good, fast resource. And at $10 (US) for the book, it&#8217;s a steal.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/07/02/take-control-of-scrivener-2/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>&#8220;PHP and MySQL for Dynamic Web Sites&#8221; (4th Edition) Update</title><link>http://www.larryullman.com/2011/06/19/php-and-mysql-for-dynamic-web-sites-4th-edition-update/</link> <comments>http://www.larryullman.com/2011/06/19/php-and-mysql-for-dynamic-web-sites-4th-edition-update/#comments</comments> <pubDate>Sun, 19 Jun 2011 16:41:07 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[book]]></category> <category><![CDATA[phpmysql4]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2621</guid> <description><![CDATA[I&#8217;m happy to say that I should (hopefully) be finishing the first draft of the fourth edition of my &#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide&#8221; this week. Today I&#8217;ll finish one of the new chapters, introducing jQuery. The chapter&#8217;s a bit longer than I had originally hoped (30+ pages), but I [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m happy to say that I should (hopefully) be finishing the first draft of the fourth edition of my &#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide&#8221; this week. Today I&#8217;ll finish one of the new chapters, introducing jQuery. The chapter&#8217;s a bit longer than I had originally hoped (30+ pages), but I think it works very well.</p><p>The chapter begins with a discussion of jQuery and JavaScript, and a sidebar on the best development tools to assist in your JavaScript programming (or, more importantly, <em>debugging</em>). Then the chapter shows how to incorporate the jQuery library and how to do a simple test of it. Next, you&#8217;ll learn how to select page elements using jQuery, and write an HTML form for the example to follow. After that is coverage of event handling and DOM manipulation, which will round out the example.</p><p>The first specific example is a widget cost calculator (similar to one done in PHP earlier in the book), with JavaScript performing the calculations and jQuery being used to show and hide error messages, change the classes assigned to elements, and update the content of the page.</p><p>The chapter concludes with several pages on Ajax. That specific example is a login form, with a server-side PHP script validating the login data, and jQuery updating the page appropriately.</p><p>I think the chapter presents a good introduction to jQuery, within the context of the entire book. Thanks to the new &#8220;Review and Pursue&#8221; section, many ideas for where to learn more or to practice what you&#8217;ve just learned are suggested.</p><p>As I said, I should be submitting this chapter today. Over the week I&#8217;ll finish the last remaining chapter: another new one introducing Object-Oriented Programming in PHP. After that, there&#8217;s just the appendix and introduction, neither of which will take much time. So I&#8217;ll have the first draft of the book done by the end of the month, and I&#8217;ve already completed seven chapters of the rewrites. I think the new edition is turning out well, and I&#8217;ll be happy to have it complete and on its way to the printer in July!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/06/19/php-and-mysql-for-dynamic-web-sites-4th-edition-update/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> </channel> </rss>
<!-- Served from: www.larryullman.com @ 2012-02-05 14:03:26 by W3 Total Cache -->
