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.

Social gaming

Image representing Zynga as depicted in CrunchBase
Image via CrunchBase

There was an interesting article in the New York Times about FarmVille. The only major error I have to comment on is that, given my experience at Tagged, saying Zynga is profitable is a massive understatement.

I think it’s instructive how companies like Slide and RockYou could have been so slow to capitalize on game designs that date back to 1980’s bulletin board systems. Perhaps they’ll study that in b-school. With 20-20 hindsight, this model does complete sense—interaction and bandwidth limitations are pretty much the same relative to the existing technology in each time period are strikingly similar in both BBSs and social networks. And just to further emphasize that it was not first mover that defined success, but rather failure to capitalize, I’ll remind the audience that neither FarmVille nor Mafia Wars were original ideas on Facebook—both were swiped from competitor products.

I will give Zynga (and the others) this. They have a far more mature understanding of social virality than the days of Plaxo, Tagged, or even RockYou/Slide. Earlier social gaming (like the first such app, Zombies) used traditional models based on optimizing signups and invites, but the Zynga model is optimizing views and clicks and they’re doing a good job. Remember, FarmVille only launched in June and now is all over the Times.

 

This is Mafia Wars, Zynga’s copy of Mob Wars. Note the use of various promotions to cater to instincts of people to bring their eyeballs here daily — gambling with daily chance, limited time offers and jobs, cross selling their other applications like Farmville, etc.On this screenshot showing a fold and a half of content, you only see one “social” touch point (at the bottom). That’s because the social aspect is only used like e-mail for messaging—and even then, only for notifications because real interaction like in Diplomacy or Chess would need much more brainpower than simply clicking.

 

Clicks are optimized here; social interaction is minimal here.

Trust me, they make a lot of money off of this.

Before any of us start rationalizing, part of learning is admitting when someone does it better than you. Hats off to Zynga.


Reblog this post [with Zemanta]

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

One door closes…

Chris just left OmniTI and so did Jon, Jeremiah departs Forrester, Andrei’s last day at digg is today, Lucas’s last day at Facebook is today…

I got to get me some of that action…

Letter of resignation

It’s been an interesting ride. When I joined Tagged, we were doing around 20 million pages/day—almost all of them coming from the viral registration flow. Today, we have virality turned off, and yet we still do over 240 million page views per day—close to a billion dynamic requests per day—as well as having been profitable for over 16 months now.

In a weird coincidence, Mark Jen is today the Director of Engineering at Tagged. Congratulations!

As for my future? Stay tuned. 🙂

I need a drink first.

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