Larry Ullman

Translating Geek Into English

Working with Layouts in Yii

Using the Model-View-Controller (MVC) design pattern, the look of a Yii-based site is naturally controlled by the View files. These files are a combination of HTML and PHP that help to create the desired output. Specific pages in a site will use specific View files. In fact, the View files are designed to be broken down quite atomically, such that, for example, the form used to both create and edit an employee record is its own file, and that file can be included by both create.php and update.php. As with most things in OOP, implementing atomic, decoupled functionality goes a long way towards improving reusability. But the individual View files are only part of the equation for rendering a Web page. Individual view files get rendered within a layout file. And although I’ve mentioned layouts a time or two in my writings on Yii, it’s a subject that deserves its own post.

Interview with Douglas Crockford

SmashingMagazine recently published an interview with Douglas Crockford. Crockford, in case you’re not familiar, is one of the key proponents of JavaScript. One of JavaScript’s “founding fathers”, if you will. His Master Class video series on JavaScript and the history of programming is really quite illuminating.

The interview is part of a new SmashingMagazine series called “How I Work”. As they describe it:

These interviews revolve around how thinkers and creators in the Web world design, code, and create. The goal is not to get into the specific nuances of their craft (as that information already exists online), but rather step back and learn a bit about their habits, philosophies, and workflow for producing great work.

For that reason, the interview is useful whether or not you do any JavaScript programming, as Crockford has great insights into programming in general. Just two things that caught my attention…

WHAT WERE THE TRAITS OF THE WEAK PROGRAMMERS YOU’VE SEEN OVER YOUR CAREER? That’s an easy one—lack of curiosity. They were so satisfied with the work that they were doing was good enough (without an understanding of what ‘good’ was) that they didn’t push themselves.

What's New in PHP 5.4

So PHP 5.4 came out a little while back, and although there aren’t any major changes, there are a couple to be aware of. Most of the changes involve either very advanced PHP programming (e.g., closures now support the $this variable) or somewhat advanced Object-Oriented Programming. But there are a some changes that will affect the average PHP programmer, which I’ll outline here.

Review of "Technical Blogging" by Antonio Cangiano

\[intlink id="2947" type="post"\]\[/intlink\]

 (which really turned out to be February-March), I’ve been going through a stack of books, and a virtual stack of ebooks, that I’ve had lying around for way too long. One of the first books from that stack that I read was " Technical Blogging", by Antonio Cangiano. I bought the ebook through Pragmatic Programmer’s Black Friday sale back in November, and it’s available through Pragmatic Programmer, or Amazon, of course. Overall, I was quite impressed with the book, and I think it’s going to help me a lot. Before I discuss the book in detail, a quick bit of perspective…

How to Write a Book - The Short Honest Truth by Scott Berkun

I’ve just recently become aware of Scott Berkun, thanks to catching an excerpt from his " Confessions of a Public Speaker" book. I’ve since read that book, and it was wonderful (more on that in a separate post). I’m now following Berkun on Twitter, where he frequently Tweets older posts. One of those that I found to be particularly on the nose was " How to Write a Book- the Short, Honest Truth". I get asked about publishing a lot (and recently had a long email conversation about this, which I’ll also share separately), and thought Berkun’s posting is quite valuable on the subject.

In the post, Berkun distinguishes between three aspects of writing a book:

  • Anyone can write a book (i.e., you can write one right now, without needing anything else)
  • Getting published (which is a separate issue from writing a book)
  • Becoming famous and wealthy

I know there are some people that would like to write a book as an experience, or as a way of sharing what they’ve learned. And some others like the imagined prestige and riches that come with writing a book. I’ve done quite well over the past decade, having written 22 books and sold over 350,000 copies, but I can verify that the prestige and riches aren’t all that you might imagine (I recently discussed the economics in a newsletter). That being said, I’m quite happy that I’m making a decent living doing something that I always dreamed of doing. I’ve been working for myself for 13 years now, which is something.