What Is Larry Thinking? #66 => Goals

February 11, 2013

In this edition…

About This Newsletter

It’s the beginning of a new year, which makes it an apt time to talk about resolutions. But I’m not really a resolutions kind of person. Instead of resolutions, I prefer goals, specifically work goals. (And by “prefer”, I mean that it’s something I’ve finally started purposefully thinking about in the past couple of years.) I often get asked about what kinds of things developers should learn, so a good portion of this newsletter will be goals you could set towards that end. You’ll also find links to my 2013 goals, and a recap of how well my 2012 resolutions, er, goals, were met.

As always, questions, comments, and all feedback are much appreciated. And thanks for your interest in what I have to say and do!

What is Larry Thinking? => Good Goals for 2013

I recently posted my goals for 2013, but I thought I might also put forth what I would consider to be good goals for any Web developer. Obviously, I don’t know each of you personally, let alone well, so some of these goals won’t be applicable to you. But in coming up with this list, I’ve tried to think about goals that are either particularly crucial considering today’s technologies and expectations, or are generally good goals to have every year. I’ll discuss them in that order.

Of course, the most important thing you should be doing as a Web developer in 2013, if you have not already, is at least familiarizing yourself with mobile Web development. You don’t have to become an expert. You don’t have to retrofit all of your existing sites. But get familiar with the concepts and terminology so that you can start making your sites mobile ready, or mobile friendlier than they otherwise would be.

Second, I think it’s safe to say that Web developers these days are expected to be conversant with:

  • A framework (or two or three)
  • Version control
  • Code testing

For frameworks, this would include both PHP frameworks, such as my favorite, Yii, and other frameworks, like jQuery. I’m not a person that believes frameworks are always the right solution–I probably use a PHP framework on maybe 60% of the sites I do, but developers are expected to know a framework or two. This is particularly true if you’ll be working on a team of developers, in which case you’ll need to know the framework that the team is using.

The same can be said for version control, whether it’s Git, Subversion, or whatever. You should be comfortable with version control, and plan on using it when working with others.

As for code testing, I’m not sure that everyone’s on board with it yet, particularly in the PHP community, but it’s worth pursuing if you have not already. This can be unit testing, integration testing, automated testing, Test-Driven Development (TDD), or whatever. As with mobile Web development, start thinking about testing in general, and pick up the key concepts and technologies, if you have not already.

Finally, in terms of newer technologies and expectations, consider taking a flyer on learning something that has recently sprung up. Pick something that you haven’t heard much about, or isn’t all the rage yet, but that you think may be interesting and possibly useful. Thirteen years ago, PHP was that for me, and it’s worked out pretty well. (On the other hand, a few years ago, I spent time learning Adobe AIR, which I really did like, and that never amounted to much.)

In terms of recommendations I have for any Web developer, there are three. First, freshen up your own Web site if you haven’t in the past few months. It’s very easy to let your Web site get stale while you’re working for clients (believe me, I know), but your Web site is a representation of you, so you should at least keep it up to date. And I mean that in terms of both content and standards (e.g., design). A benefit of working on your site is that it gives you opportunities to try things that clients may not let you try, or not pay you to try. Your next version of your site might be a perfect time to take a stab at mobile Web development or version control, for example.

Second, improve your skills in areas where you have some ability, but may not be up-to-date with the current knowledge and approaches. If you’re a Web developer, this may be PHP (and OOP PHP), MySQL and SQL, modern JavaScript, or HTML5. When was the last time you read the PHP manual? The MySQL manual? Anything on JavaScript? No time like the present!

Third, work on being more efficient. Get better with your text editor or IDE (or switch text editors or IDEs). Get better with the other tools you use. Any efficiencies you gain will pay off in spades over time. Often this is simply a matter of being reminded of something you once knew (I recommend re-reading manuals and documentation every year for your most commonly used software). Just last year I was re-introduced to some keyboard shortcuts for selecting text or merely moving the cursor around quickly. Every time I don’t take my hands off the keyboard (to use the mouse to do those things), I’m grateful that I re-discovered those shortcuts.

If you want more recommendations, NetTuts+ posted a very good article titled “10 New Year’s Resolutions Every Web Developer Should Make” that you could read.

And when all is said and done, at the end of the year, make sure that you look back on your year and see how you did with your goals. Hopefully, doing so will make you feel like you’ve really accomplished a lot. If not, then you’ve already got a good start on your goals for the next year!

On the Web => Mobile Web Development Resources

If you’re looking to learn about mobile Web design, I’ve got a few good resources you should consider starting with.

For a nice introduction to responsive Web design (RWD), check out the Treehouse blog’s article “Beginner’s Guide to Responsive Web Design“.

Next up, Jared M. Spool, a renown UI and UX expert, recently posted a great article titled “Devising a Strategy for Responsive Design“. In the article, Mr. Spool covers the current issues surrounding designing web sites responsibly (and responsively) for today’s environment, devices, and destinations. Not only does Mr. Spool talk about the technologies involved, he also explains how some of these issues have further implications on other aspects of a site, such as content management. It’s a sufficiently thorough and well-explained article that’s definitely worth your time if you want to get up to speed on the issues surrounding web design today.

Brad Frost, one of the most important names in mobile Web development, has worked with another developer to create This is Responsive, an ongoing repository of responsive Web design resources. Frost also has a great newsletter that you ought to subscribe to.

Although I generally detest O’Reilly’s Head First book series, the “Head First Mobile Web” is the best book I’ve read thus far on the topic of mobile Web development. It provides a good survey of the landscape, with lots of specific code, and even goes into the basics of native apps. (And it does all this while trying to be cool, with large pictures of hipsters saying silly things; I hate Head First.)

When it comes time to test how your site looks on various devices, head to Screenqueri.es. It’s very easy to use, free, and seems to be pretty accurate.

For those of you already doing mobile Web development, if you have specific resource recommendations or advice, please share them with me, so I may share them with others. Thanks!

On the Web => Code Testing and The Grumpy Programmer

When you’re ready to start actively pursuing testing, you could do worse than to start with the NetTuts+ series on Test-Driven PHP. This is a gentle and cohesive introduction to testing, covering the key terms, concepts, and tools. Testing is not for beginners, though, so you should be very comfortable with application development, PHP, and with Object-Oriented Programming in particular, before heading too far down this path.

If you have the third edition of my “PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide” book, there’s an introduction to unit testing with PHP Unit in the last chapter. Unit testing is the basic building block of most types of code testing, and PHP Unit is the de facto framework of unit testing in PHP. (PHP Unit is also used in the NetTuts+ series.)

If you’ve already done some testing and are ready to take your knowledge to the next level, get to know The Grumpy Programmer. Chris Hartjes, who goes by “The Grumpy Programmer“, is serious about testing, and PHP is his primary programming language. Chris does two things better than anyone:

  1. He’s a great advocate for testing in the PHP community (which was been sorely lacking for too long).
  2. He focuses on complete, practical, and real-world uses of testing.

Many resources only demonstrate a subsection of testing: the fundamental tools and principles. Even resources like my book, which teaches testing with real-world code, only do so with a subsection of an application. It can be hard to take that next step, translating the core testing concepts to an entire application. This is where Chris’s first book, “The Grumpy Programmer’s Guide to Building Testable PHP Applications“, comes in. It’s a smart and well-written book, capable of showing you how to thoughtfully apply testing to complex, modern applications. Again, this is not a good testing book for beginners, but is probably the best way for a decent tester to become a great day-to-day tester.

If you think Chris’s book, “The Grumpy Programmer’s Guide to Building Testable PHP Applications“, might be right for you, he was kind enough to provide me with this discount code to share in this newsletter: LARRYSENTME. That code gets you the book at $15 (US) instead of the normal minimum price of $20. My thanks to Chris for the discount offer and for his continued efforts in bringing the PHP community to the 21st century, when it comes to testing.

Chris is currently working on a companion book, “The Grumpy Programmer’s PHPUnit Cookbook”. It’s expected to be released in early March 2013. Head to http://grumpy-phpunit.com for more details and to be notified when the book is ready.

For those of you already doing testing with PHP, if you have specific resource recommendations or advice, please share them with me, so I may share them with others. Thanks!

Q&A => How Do You Improve Your PHP Workflow?

Some time ago, David asked me for tips and tricks for optimizing a PHP development workflow. To be clear, David was looking for recommendations with respect to optimizing development–the creation of a site, not optimizing how the code itself runs. My answer starts with some unconventional thoughts, and then gets to the crux of the matter.

The most obvious and important way to improve your development speed is through knowledge and experience. The more you know, the easier and faster it is for you to develop subsequent sites. When you don’t have to look up a function definition or think about how to solve a particular problem, you’re saving yourself lots of time. Unfortunately, this isn’t an easy tip to implement.

Second, have a good backup system in place for your computer. Losing all your work because of a hard drive crash is about the most inefficient event possible. Yes, this is a “big picture” look at development, but it still counts to me.

Similarly, start using version control. How is that an optimization technique? Here’s the scenario we’ve all been in: You do some code and it works. Hooray! Then you make some minor tweaks, or so you think, and now it’s not working. Boo! How do you undo those techniques to return to the working code? If you have version control, you just de-commit the last round of changes and you can try again. If you’re not using version control, it’s going to take a while to undo the latest round of changes.

So knowledge, experience, backups, and version control are some foundational elements you can use to become more efficient. From there, the two things you must minimize in order to optimize your workflow are:

  • Typing
  • Not typing

That sounds contradictory and useless, but I actually mean it. Typing hurts productivity when you could have accomplished the same result by not typing. For example, you should use file templates and code snippets as much as possible. Hopefully your text editor or IDE supports these. Any bit of code more than a few characters long that you find yourself typing more than once a day ought to be represented by a snippet that you can easily insert. And because you’re essentially copying and pasting, not typing, you’re less likely to create bugs (in that code).

One of the best optimization techniques is to use a lot of file templates and code snippets!

On a related note, spend a lot of time mastering your text editor or IDE. Find out what it can do to make development faster. In particular, look at its support for:

  • Code completion and code hinting
  • Code generation
  • Templates and snippets
  • Inline documentation

For example, if I type “fun” and press Tab in TextMate, it creates the following:

public function FunctionName($value='')
{
    # code...
} 

Then I press Tab to navigate to, and change, the function’s name, parameters, and body. These are the kinds of things you need to learn how to do with your text editor or IDE, because it saves you from typing.

Along with learning how to avoid unnecessary typing, you should learn to avoid unnecessary not typing. By that I mean the things you do that take you away from creating code. For example, a lot of time can be spent looking up documentation. For some reason, I can never remember the order of the arguments for the explode() and implode() functions. If your software can provide answers like those for you without leaving the application, or even the line of code you’re on, that will save you time.

While developing, look at the things you do that take you away from writing code, and see if you can’t minimize those, or at least bring them into the code development application.

Finally, there are some general things you can do that will expedite your development. These aren’t easy or cheap changes, but a faster computer, a faster Internet connection, and multiple monitors are all significantly beneficial. Also make sure you have a comfortable work environment. If you’re physically uncomfortable, you’ll fidget or take more breaks, which is inefficient. And consider spending some time (and possibly money) looking into the “Getting Things Done” or Pomodoro approach to task management. Oh, and turn off Twitter, Facebook, and your email!

If you have any specific optimization recommendations or advice that I did not cover, please share them with me, so I may share them with others. Thanks!

Larry Ullman’s Book News => “The Yii Book”

So you probably know that the “The Yii Book” is (still) available for sale at yii.larryullman.com. Since my last newsletter, I posted my third and fourth updates, bringing it to version 0.41. It’s currently about 236 pages of material, up to Chapter 10. I’m currently working on Chapters 11-14 now, which will conclude Part 2 of the book. When I post the next update, through Part 2, I’ll probably also include some cleaning up of the material to that point. You can view the complete table of contents online.

I’ve also just posted the Introduction online per a user request. I plan on posting some excerpts from the book over time as well.

Thanks to everyone for their interest in this book and to everyone that has already purchased a copy!

If you enjoyed this post, then please consider following me using your favorite social media, the RSS feed, and/or by subscribing to my newsletter. Or go crazy, and buy one or more of my books . Thanks!