In this edition…
- About This Newsletter
- What Were You Thinking? => “PHP and MySQL for Dynamic Web Sites” (4th Edition)
- On the Web => Five Critical E-Commerce Security Tips in Five Days
- On the Web =>More E-Commerce Articles Published Online
- On the Web => New Support Forum
- Q&A => Why Shouldn’t I Use require_once()?
- What is Larry Thinking => Building a Career
- Book Giveaway => “PHP for the Web: Visual QuickStart Guide (4th Edition)”
- Larry Ullman’s Book News => “PHP for the Web”, “PHP and MySQL for Dynamic Web Sites”, and More!
About This Newsletter
I don’t normally come up with a newsletter theme and then write the newsletter to match, but rather I write the newsletter based upon what I’m thinking and doing at the time, and then see if a theme arose. Well, it seems that this newsletter is largely about…me. And despite the fact that it is my newsletter, I try not to make it so much about me, generally speaking. But hopefully you’ll still learn some things that benefit you in this newsletter. Or you can just skip to the end where I give away some books!
As always, questions, comments, and all feedback are much appreciated. And thanks for your interest in what I have to say and do!
What Were You Thinking? => “PHP and MySQL for Dynamic Web Sites” (4th Edition)
In the previous newsletter, I introduced a new section titled “What Are You Thinking?” In it, I asked about what additions or changes you’d like to see in the fourth edition of my “PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide” book. I received a lot of feedback, giving me a pretty clear sense of what you want.
To start, most votes went towards more on servers, specifically on the Web server (primarily Apache): using .htaccess files,
mod_rewrite, proxy scripts, SSL, protecting directories, and so forth. I plan on adding maybe 10-15 pages to Appendix A, “Installation,” that provide a solid introduction to these topics. Certainly I could do more, or put the material elsewhere in the book, but I don’t want to get too off topic or too advanced.
Many people thought that more on databases, JOINs, and complex SQL would be useful, so I’m planning on breaking the original Chapter 6, “Advanced SQL and MySQL,” into two chapters, and expanding the coverage of both accordingly.
There was an appropriately mixed reaction to including some Object-Oriented Programming. On the one hand, those who don’t already know OOP are curious about the subject and think it should be present. On the other hand, those who do know OOP know that you can’t really cover the subject well in just a couple of chapters. I’ve always been in the later camp, which is why OOP hasn’t made it into previous editions of this book (by comparison, I walk through OOP in detail in my “PHP 5 Advanced: Visual QuickPro Guide” book, and it takes about 150 pages). However, the great thing about OOP is that you can reasonably use it without mastering it. I’ll explain…The complexity of OOP is in the design process: creating classes of code with methods, attributes, inheritance, access control, etc. The ease of OOP is in using already defined classes. What I’ve decided to do is show how one uses OOP in PHP. Doing so will provide an introduction to OOP without overwhelming the reader or distracting from the other content. And, there are plenty of good OOP classes built into PHP that I can use as examples. One will be the MySQL Improved extension, which the book already demonstrates procedurally (so the OOP coverage will provide a nice comparison). Other candidates include the DateTime class, the Internationalization libraries, and the Standard PHP Library. From this list of candidates, I should be able to put together a nice chapter that both demonstrates how to use OOP, as well as introduces newer features of PHP 5.3.
So those are my thoughts and some of what you can expect to see in the fourth edition. I’ll post a complete version of the Table of Contents on my blog in the next couple of weeks. Again, I thank everyone for their feedback. If you have any more feedback, including on what I’ve written here, please do share. Also, I should note that a couple of people expressed admiration for my request for feedback and input. While it may be true that most writers don’t do this, rest assured that it’s entirely self-serving of me. By finding out directly what readers may want, I can hopefully create a better book, which in turn makes me look like a better writer!
On the Web => Five Critical E-Commerce Security Tips in Five Days
Peachpit Press has published on their Web site my “Five Critical E-Commerce Security Tips in Five Days” series of blog postings. The specific postings are:
- Maintaining Secure Passwords
- Securely Handling File Uploads
- Have a Emergency Plan
- Validate, Validate, Validate
- Understand Your Hosting
The postings are in concert with my “Effortless E-Commerce with PHP and MySQL” book, although the information provided, from theory to actual code, should be useful whether you’ve read that book or not.
On the Web => More E-Commerce Articles Published Online
Peachpit Press has published online the last two articles (of four) I wrote in support of my “Effortless E-Commerce with PHP and MySQL” book, The first is “Creating an Ajax-Enabled Rating System for Your Website.” The second is “Ajax-ifying a Shopping Cart.” Even if you haven’t read the book, these articles should be useful and informative (plus they are free to read, without any registration).
On the Web => New Support Forum
Perhaps as long ago as 2001, a reader suggested that I create a support forum where readers could ask questions and get assistance. An excellent suggestion! A decade later and the forum continues to be the most popular aspect of my Web site (I think) and is frequently mentioned as an extra reason to buy my books. Unfortunately, until recently, I was still running the same forum software (Phorum). It seems that after ten years, thousands of users, and tens of thousands of posts, the open-source solution I began with is no longer viable (the final straw was an annoying caching bug introduced in the latest version of Phorum, but regardless the software is lacking some good features). This past week I changed the forum over to the commercial IP.Board.
IP.Board, while not free, seems to be the go-to forum software of choice these days. It has features galore (perhaps too many) and should be able to grow with the forum for years to come. The user interface is more capable, although more complex, and it allows members to more quickly do what they want to do. I’m still figuring it all out (IP.Board’s template system is crazy and, like almost everything, the documentation could be much better), but I think this switch was the right choice.
In transitioning to this new forum, I made the unconventional, and perhaps dubious, decision to abandon the existing forum (its messages and users). Partly this was because I didn’t want to bog down the new, clean forum with outdated messages from ten years ago. I also didn’t want to institute another redirect (from www.DMCInsights.com/phorum/ to www.LarryUllman.com/forum/ to www.LarryUllman.com/forums/). Also, I’m a bit busy these days and wanted the easiest solution. So I’m keeping the old forum up in read-only mode, but all new messages should go in the new forum, available at https://www.larryullman.com/forums/. If you registered at the old forum previously, you’ll need to re-register at the new forum.
I apologize for any inconvenience this may cause but hope/believe it’ll be worthwhile in the long run.
Q&A => Why Shouldn’t I Use require_once()?
In my previous newsletter, I made an offhand comment about how the more experienced programmer knows to avoid using
require_once() in PHP (as opposed to just
require()). A couple of people specifically inquired about this statement, including Jonathon and Bill.
To be fair, I would not be surprised if you found poor (i.e., unnecessary) uses of these functions in my own work, but that just goes to show we’re all always learning, no? The problem with the
_once() versions of these functions is that PHP needs to do a lot of extra work when you call them (to make sure the referenced file hasn’t already been included). So it’s a performance degradation issue. With something like a header or footer file, it’s relatively safe to assume they’ll only be included once and there’s no reason to institute the extra overhead.
The only time I would use the
_once() versions is when I have a very complicated site with lots of includes, where some files might include other files. There’s one example of this in my “Effortless E-Commerce with PHP and MySQL” book, involving a login form and the sidebar. That example site has a user-defined function that creates form inputs, used by every form on the site. One such form is for logging in; it appears in the sidebar, on every page, when the user is not logged in. The login form is stored in a separate file, which is included by the footer. Because the login form needs the user-defined function, the login form file must include the function definition file. But on a couple of pages, like the registration page and a contact page, the same function is also needed, meaning those pages will also have included the function definition file. To prevent errors, the login form file does do a
require_once() (I hope that makes sense). But that’s the only situation in the entire book where I use
_once(), and as you can tell, it’s absolutely necessary (i.e., I know there will be a page that attempts to include the same file more than once).
What is Larry Thinking? => Building a Career
Some time ago, Daniel was one of several people who asked me about how one builds a career similar to mine (programming, writing, teaching, etc.). By no means am I a career counselor, but I can share what I’ve figured out thus far (and this nicely extends the “Becoming a Better Programmer” thread discussed in the previous two newsletters).
To start, you’d need to make a choice between working for yourself and working for someone else (of course you can switch back and forth throughout your career). It’s extremely easy to get the “job” working for yourself, but very, very, very hard to make a living that way. Conversely, it’s easier to make a living working for someone else but harder to get the job in the first place. I’ll speak to this path first, as it’s the one I have the least direct knowledge of.
It’s been almost twelve years now since I worked for someone (whohoo!) and I never officially worked for anyone in a computer/IT capacity. Getting a conventional job in these areas will largely depend upon geography: there are just more opportunities in, say, Silicon Valley, than in rural Western Australia. So you have to look at your surroundings and think about how many technical companies there are to see how difficult this path will be.
Assuming there are companies nearby, the next question is: what knowledge and experience are they looking for? You can normally find this information on company Web sites and in job hiring ads. Even if the companies in your area aren’t hiring right now, find out this information from other companies to gauge where you need to be. Many companies do specifically want IT college degrees, certifications, and other “official” proofs of ability (about the only reason I recommend getting certified in a subject).
Getting experience is always the catch-22. How do you gain experience in order to get the job that will give you the experience you need to get such jobs? I would think that internships and apprenticeships would be the best way to get in the door. Or, as always, knowing someone that knows someone is a useful “in”. If you’re associated with a school, there may be career advancement/job placement services there that you should look into. You can also gain experience by working for a company in one capacity and over time learning about other jobs. My last real job was at the main library of Georgetown University: a year in the administrative department and a year in circulation. Neither job had much of a technical aspect to it, but I’m almost certain that had I stayed around I would have ended up in the IT department (because I was friends with that department, helped them with their Mac questions, and was generally involved with what they did). So do keep in mind the option of going in through the side door. This could also work via temp agencies: many good temps become full-time employees.
One great thing about being in this industry that you should never forget is that you can create your own experience. An architect can’t have every building she designs be constructed, but for little-to-no money, you can actualize any Web site or application you dream up. Unfortunately if you’re looking for experience that turns into a real job, the work you do will have to be really good, but again, that’s entirely up to you.
If you want to pursue a career working for yourself, I’m proof that it’s possible, but it’s not easy and may never be lucrative. As I said, I’ve been working for myself for nearly 12 years now and I would never go back to a conventional job if I can help it. I’m able to make a fine living doing it, although I probably don’t make as much money as some may think. Before I started doing this work, I had no formal IT experience, no customers, no portfolio, no nothing. But I was starting off when the Web and e-commerce was expanding greatly, and lots of opportunities were there if you worked hard enough to get them. (I’ll discuss more of my own path in the next newsletter.)
When it comes to working for yourself, the greatest benefit is the freedom. At first, this is the freedom in choosing when you work, what you wear, and the like, but over time the true value is in the freedom to do and learn what you want. In an IT job with a company, I might be stuck doing only X and Y for years and years. Working for myself, I can do X, Y, Z, B, C, N, J: whatever I think is worth doing. Ironically, if I were more business minded, I’d would stick to a couple of specific skills, absolutely master and promote those, and probably make more money, but I just don’t think or function that way. Being able to change what I do keeps me motivated.
The two worst things about working for yourself, in my opinion, are the income and the benefits. I expect both negatives are fairly obvious ones. As for the income, there are no steady paychecks and no expectation of continued income (like one normally has with a conventional job). If you want to pull off working for yourself, this means you need some money saved up, you need to be able to live quite frugally, and it’ll make a huge difference if you have someone providing a steady paycheck. The benefits is a trickier subject and one that depends greatly upon the country you live in. Where I am, in the United States, citizens have to buy their own health insurance. And when you do buy your own health insurance, the fact of the matter is that individuals cannot get good health insurance in America (e.g., I could spend $1,000/month to get a policy that’s nothing close to what my wife’s employer provides). You could, of course, forgo health insurance and just plan on being overwhelmed with debt should your health go south for any reason. So the income and benefits are big concerns with this path, but you can overcome them if you’re frugal, patient, and have someone to help share the load. (Or maybe live in a country with socialized medicine; not to be all political about it.)
There is, as always, a third option: the middle road. If you have a job that provides a steady income and benefits, even if it’s not your dream job, you can certainly hold onto that while you learn and gain experience in other areas. This is the pragmatic route. If you’re even remotely in a situation to pursue this path, I would highly recommend it. The biggest potential pitfall would just be that you don’t put enough time and energy into expanding your horizons because you never have the “trial by fire” need to. But that’s a pitfall that’s easy to avoid and there’s a lot to be said for pragmatism, especially in this economy!
There, then, are the three most distinct career paths available, with some plusses, minuses, and a smattering of advice. In the next newsletter, I’ll follow this up with “Building a Career, Part 2″/”Doing What I Do”, in which I’ll talk about some of the specifics of earning a living as a programmer, Web developer, writer and instructor.
Book Giveaway => “PHP for the Web: Visual QuickStart Guide (4th Edition)”
You must be subscribed to the newsletter to participate in any book giveaways.
Larry Ullman’s Book News => “PHP for the Web”, “PHP and MySQL for Dynamic Web Sites”, and More!
I’m very pleased to say that the fourth edition of “PHP for the Web: Visual QuickStart Guide” should be available in bookstores any day now (I received my copies last week). And I’m giving away free copies of it!
I have also begun writing the fourth edition of my “PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide.” I’ve already rewritten the first two chapters (revisions of books tend to go much, much faster than the first writing). The book should be available come August.