1500 Lines of Code

Original article posted to PHP Advent 2009, Click to jump to discussion. Happy Holidays to you and yours!

Even the best of us can only write 1500 lines of code a day, so we need to make those lines count.

There were so many great articles in PHP Advent this year, that I couldn’t think of a good topic—I like to believe my peers stole all the good ideas this year… 🙂
Continue reading about Read about 1500 lines of code after the jump

Vivanista

(Disclaimer: I work for Automattic which contributes to the development of WordPress, WordPressMU, BuddyPress, and bbPress.)

At this month’s Bay Area WordPress Meetup, there were four interesting talks. One of which wised me up to the Zemanta WordPress plugin, which I’m using now, any content creator (or Another Search Startup) should check it out—it’s quite clever.

But the presentation I want to focus on in this article, was Annie Vranizan’s Vivanista demo.

The Vivanista homepage

Vivanista is a social network for women focusing on philanthropy. Even if you don’t have a passing interest in such things, the website deserves a look, it’s quite an attractive website and built in record time—a couple of months.

Being a vertical, this is mostly the territory of white-label social networks, and more recently, Facebook. In fact, if you look at their team, it reads more like a group blog than a company.

That’s because it is.

What makes Vivanista so interesting is that it is built on WordPress MU blog publishing platform in combination with Andy Peatling’s BuddyPress plugin.

Continue reading about More about how Vivanista was created after the jump

Learning Programming Part 2: Programming Frameworks

A selection of programming language textbooks ...
Image via Wikipedia

(Full disclaimer: I work at Automattic and am a speaker at PHP conferences.)

A couple days ago, Gina Trapani posted an interesting article on learning to program.

This reminds me that some people may take the wrong points away in my last article on the subject, the priority shouldn’t be what language you should learn, but rather, what is going to get you motivated to learn. PHP is a popular language because it naturally invites “immersion” style learning, not because it makes a good teaching language—which it doesn’t. That is, assuming the thing you are immersing in is “building a website”. As I like to say:

PHP is the shortest distance between two points on the web.

In the comments, I wrote:

After [the first] chapter, I’d say [PHP and MySQL Development]offers the most “immersion” gratification (at the least cost) than any other language’s textbook. The chapters are easy and by the end of it you have an eStore written and working from scratch. What do you get at the end of the Learning Python book? And how easy was each subsequent chapter? I’d say much less and much harder.

[Unfortunately,] it’s that first chapter that does the first timer in.

Continue reading about More about learning web programming after the jump.

What’s the deal with short_open_tag?

A friend asked me today:

Why isn’t short_open_tag set to On in php.ini at [servers you set up] or in general?

Basically short_open_tag allows you to use <? and <?= in addition to <?php when formatting code. The latter can be very useful if you are using PHP as a templating language—like with Savant or no templating system at all.

Many people think that there is a security reason for this. For the life of me, I can’t really see the security problem with the setting though I can see the security problem with the coding. That is… if you code using short_open_tags, then you run the risk of running that code on a server where this variable it is off somewhere and suddenly you are dumping PHP code to people’s browsers. But that almost never happens and really if you have a configuration issue, you have bigger problems.

The real reason is simply that it violates valid XML markup to use short tags. Simply put, let’s say you have an example where your PHP page has to generate a valid XML file that needs a XML directive.

<?xml version="1.0" ?>

With short_open_tags, this will generate a fatal error in the PHP engine! The workaround is to do something nasty like

echo '<'.'?xml version="1.0" ?>';

(or some such). As more websites contained XHTML or some weird sort of sacrifice to the Gods of all things XML (SOAP, XMLRPC, REST-XML), it was sooner convenient to admit defeat and just start coding in valid XML markup.

It violates valid xml. It was not recommended for use because it isn’t guaranteed to be on everywhere. Ever since then people have been in the habit of not using short tags just in case they are off. Soon, it became part of the php.ini-recommended and short tags, like asp_tags and the alternative syntax for control structures got relegated to the dustbin of history.

What is the alternative syntax for control structures? Let’s not go there. 😉

Zynga hiring PHP developers

As someone who worked at Tagged, I can say that profit-sharing with game developers like Zynga have been instrumental to make our revenue numbers. If they make this much off us, I shudder to think how much they’re pulling in from open API networks like Facebook and MySpace.

(Not to mention way to many hours wasted on Mafia Wars and Poker. ;-))

In any case, another PHP job posting…

Continue reading about Zynga is hiring after the jump

PHP Job: PHP 'guru' position in San Francisco

Senior Software Engineer (PHP/MYSQL)

Someone who has help build scalable web apps for sites with millions of users at established Web 2.0 company.

Seeking a self-directed senior software engineer with a desire to build scalable and interesting web applications. We desire someone who is comfortable writing efficient database schemas, clean and efficient back-end code, and has passionate opinions about user interface and interaction. Developer will be working to design and implement new features and improve the overall experience for millions of people. Developer will be part of a team that works on diverse, site-spanning projects involving community-facing tools, video, web services, security, anti-spam, user-to-user interaction, advertiser network, and more. Projects will be for both internal tools and highly-used public-facing products.

Continue reading about Qualifications and contact after the jump