Archive

It Bears Repeating

Let me start this post by noticing that the sentence «It bears repeating» can be found on answers.com, categorized as follows:

Answers.com > Wiki Answers > Categories > Animal Life > Wild Animals > Mammals > Land Mammals > Bears > Black Brown and Grizzly Bears > Bears or Bares repeating?

Nice one. And now, for something completely different, if you’ve done any speech writing, you know that a speech should have a central theme, a leitmotiv, a single idea that it tries to get across, and any other elements in the speech are just salad dressing wrapped around that idea to help it come across correctly.

Apple Keynotes are an excellent example, because their leitmotiv is quite obvious:

What is very interesting about Apple keynotes is how obvious their leitmotiv is : they’re great. They’re fantastic. They’re awesome. They’re easy to use. And they only have one message, so that when all those tech editors and bloggers and sneezers leave the conference room, the message just sticks.

Did I mention my blog is awesome?

You might grab the attention of several people. That’s not very hard, assuming that you have the right network or enough money. You can speak to them. Maybe they’re willing to listen to everything you say (as in the Apple Keynote crowd situation). Maybe they’re willing to remember everything you say (as in a typical classroom situation). But they’re not geniuses. No one becomes an expert just because they’ve listened to another expert for a short while.

You can have your audience leave with one idea. One emotion. What is it going to be?

Where Has The Magic Gone?

Last month, Chris “powerpig” McVeigh uploaded this image to his flickr account:
Picture of Darth Vader riding a chipmunk
Yes, this is Darth Vader riding a chipmunk. In the days of yore, one would say that the image was edited, tampered with, or fake. Today, we say that it has been photoshopped (or shopped). This goes a long way to show how iconic Adobe’s software has become. I still remember the early days of Photoshop 6.0, when the splash screen still showing the 33 authors and 14 patents of the software.

Except that this image is not photoshopped. Chris McVeigh uploaded a video a short while later to explain this fact:

I understand that my chipmunk photography can seem unbelievable at times, and I’m used to getting questions such as “How did you do that?” and “Is it all Photoshop?”

As this video will show, it’s all happening right there in front of the camera. I get no satisfaction out of a composited photo—the challenge for me is to capture the chipmunk engaged in a real and rather extraordinary situation.

The challenge. If you’re in my generation, you’ve been in school at a time when only the nerdy computer users ever managed to print the papers they handed in. And other people looked at them and said «wow, this is so cool, you must have used a computer» with a tinge of admiration in their voice—or was that fear? Back in the 90s, using a computer to print documents was surprising for a 14-year-old.

And now, the magic is gone. Kids look at you in disbelief when you suggest they write their paper, then go back to copy-pasting Wikipedia articles.

People used to be amazed when they saw an actual programmer. Software was some kind of magic resource that appeared in the bowels of huge mega-corporations with thousands of engineers and millions of dollars in budget. A few people had heard about shareware, yes, but those were the exception. When you showed people that you could program computers, they would all go «oooh» and «aaaah» and beautiful young girls would ask to have sex with you (or at least, that’s what the pictures in the pop-ups said).

That magic is gone as well, with the rise of the reclusive anti-social geek stereotype.

And yet… A few days ago, I was commuting in the Parisian subway. Next to every subway door, there’s a map like this one:

plan-de-metro-bonne-definition

Sitting next to the door was a young girl with an HTC smartphone I did not recognize. Her head was literally inches from the map on the door, at a perfect reading distance. And yet, she fumbled around the cell phone interface and launched a subway map application that, for all practical purposes, was just an on-screen version of the map next to her. And then, she fingered the screen some more to scroll her current position into view.

Such a reliance on magic technology can only mean one thing — the geeks have won.

Unrelated Posts

P = NP for Normal People

A few days ago, an Indian computer scientist working for HP has announced that he has proven that P ≠ NP, solving the decades-long search for an answer to the P = NP question. A lot of computer scientists, me included, are quite excited over this, and waiting to see whether the proof actually holds (it’s long and complex enough that only people with a lot of spare time on their hands can actually determine if it’s correct). To us, this is the equivalent of finding life in outer space or learning who killed JFK.

Why are we so excited? Here’s a short explanation for normal people:

Linear Complexity

Suppose you’re in the outsourcing business, and all the world’s spell-checking algorithms have mysteriously disappeared overnight. Being the clever businessman that you always were, you hire a hundred workers from India, buy them a hundred English dictionaries, and start sending them pieces of text with instructions to reply with a list of words that were not in the dictionary.

Having a minimum-wage offshore worker look up a word in a dictionary costs you $0.01; this means that if your customers pay you $0.02 / word, you’re a winner regardless of how large the text is. In essence, spell-checking a text has a linear complexity, because the price as a function of the text size is a line:

linear

Polynomial Complexity

Not everything is linear. Suppose now that you have a different business: big corporations and political parties give you a list of things, and you sort them by popular preference. For instance, you could determine that Pepsi > Coke Light > Coke. You do this by polling people. A “pick one” poll costs you $100 to set up and execute.

If asked to sort two items (Pepsi and Coke), you would need only one poll – $60 per item is a good price (you earn $120 and pay $100).

If asked to sort three items (Pepsi, Coke and Coke Light), one “pick one” poll is not enough : what if everyone loves Pepsi, and there’s not enough answers to order Coke and Coke Light? You need two polls. Now $60/item runs you into the red (you earn $180 and pay $100). So, you increase your price to $100/item just to be sure you’ll never be in the negative. Right?

Well, there are exactly 24 ways of ordering a list of four items:

1 2 3 4 2 3 4 1 3 4 1 2 4 1 2 3
2 1 3 4 1 3 4 2 3 4 2 1 4 2 1 3
3 2 1 4 2 1 4 3 1 4 3 2 4 3 2 1
4 2 3 1 2 3 1 4 3 1 4 2 1 4 2 3
1 3 2 4 3 2 4 1 2 4 1 3 4 1 3 2
1 2 4 3 2 4 3 1 4 3 1 2 3 1 2 4

On the other hand, if you run four “pick A or B” polls, you only get 16 different outcomes:

A A A A A A A B A A B A A A B B
A B A A A B A B A B B A A B B B
B A A A B A A B B A B A B A B B
B B A A B B A B B B B A B B B B

So, you have a testing strategy that can give you only 16 different results, and based on those results you have to find which one of 24 situations you are in. This is impossible. You need a fifth test, which will increase the number of results to 32. Now you’re earning $400 but paying $500…

Adding an item to the list multiplies the number of permutations by the number of elements in the list: adding a tenth item multiplies it by ten. On the other hand, adding a new poll only multiplies the number of results by two. This means that the number of polls will increase faster than the number of items. No matter what per-item price you select, you will run out of money sooner or later. Keep this in mind: it’s going to be very important soon.

This plot represents cost (red) and earnings (blue) as a function of the number of items, for a per-item price of $1,000 :

nlogn

The set of all problems that can be solved for a profit, regardless of size, at a per-item price, is the set of problems with linear cost; in computer science lingo, we write this cost as O(n), meaning that you can find a constant (here, the price) such that the cost will be smaller than n times this constant for a problem of size n. Looking for words in a dictionary is a known O(n) problem. Sorting a list of items by comparing them to each other has been proven not to be an O(n) problem (and the description above is a summary of the proof).

Suppose you go for a different pricing method: to sort a list of n items, you ask for $100 × n × n. Two items is $400 (cost: $100), three items is $900 (cost: $200), four items is $1600 (cost $500). You are guaranteed to make a profit because the worst that could happen is that you compare every item to every other item, which means polls, and you would still get enough to pay for all of them.

Sorting a list of n items is hence known to be an O(n²) problem.

Remember the definition of linear cost? There exists a constant k such that the cost of working with n items is smaller than than k × n. There is a similar definition for polynomial cost: there exists a constant k such that the cost of working with n items is smaller than nkn multiplied by itself k times. All linear-cost problems are, by definition, polynomial-cost problems as well.

In the expression “P = NP”, the “P” represents all problems that can be solved at a Polynomial cost.

Non-Deterministic Polynomial Complexity

Let’s think of another business idea. Now, you’re a tour optimizer: salesmen give you a list of cities they need to travel through to sell their wares, and you provide them with a sequence of visits that has the smallest travel costs and never goes more than once through any given city. This is a common toy problem in computer science for which no polynomial-cost solution is known—The Traveling Salesman Problem.

As a quick comparison:

  • Spell-checking a 10-word text involves 10 dictionary searches – O(n)
  • A naive sort of 10 elements takes, at most, 100 comparisons – O(n²)
  • The traveling salesman problem with 10 cities involves testing 3,628,800 paths.

So, you set up a contest: you hand out the problem to a billion minimum wage workers, and you only pay the worker who found the shortest travel path. So, each of them starts computing the length of a certain path, and there are so many workers that every path will be worked on. After a while, they all submit their solutions, and you keep the shortest one.

Each worker spent a polynomial time selecting a travel path and computing its length: they only had to add the distances between consecutive cities in the travel path. So, the cost of solving the problem this way is polynomial. The important thing here is that you did not know what worker you would pay until the answers came in. In computer science, we say that your solving strategy is non-deterministic.

In the expression “P = NP”, the “NP” represents all problems that can be solved at a polynomial cost using a non-deterministic solving strategy — Non-deterministic Polynomial.

P = NP ?

Any P problem is also an NP problem : if you can solve it by paying someone, you can solve it by holding a contest and paying the winner that same amount. The question is whether any NP problem is also a P problem (hence, P = NP) : if you can hold a contest to solve the problem, can you hire someone to do the same while retaining a polynomial cost?

This question is important because our current computing technology (electricity-through-silicon-transistors) does not support non-deterministic computing. So, if we could find efficient deterministic solutions to every problem inside NP, we would be quite happy about it.

Actually… we wouldn’t. Many security features in computer science rely on problems such that 1° solving the problem is very complex but 2° checking whether a solution is correct is very simple. For instance, checking that a password is correct is a P problem (your computer does it several times a day), but finding the password is an NP problem (you have to try all passwords). If a P solution could be found to the “find the password” problem, we would be in trouble.

Bounce Rates : Bait and Switch

You are a cell phone retailer, and you’ve bought a whole lot of Angbandroid cell phones. These phones are usually not sold to individuals: corporations buy them in bulk for their employees for about $50 apiece directly from the manufacturer. Besides, mainstream attention is focused on the upcoming CryPhone 3 which will sell at $349. And this gives you an idea, because you’re a filthy, conning cell phone retailer.

So, you bait some victims by running ads for a $299 CryPhone 3. Customers start flowing into your shop, and you switch by telling them that the price was so low you’ve sold all your CryPhone 3 models in minutes, and to apologize you will let them buy the enterprise-only, high-quality Angbandroid models for the bargain price of $319.

A lot of people will just leave because they were looking for the CryPhone 3 and no substitute will do. A few will decide that:

  • They’ve come all the way to your shop, they might as well buy something
  • You sold the CryPhone 3 at -15%, so the $319 Angbandroid is probably a good price.
  • The Angbandroid costs more than the CryPhone 3, so it must be better.
  • The Angbandroid is an enterprise-only phone, so this must be an unique opportunity.
  • $319 is within their $349 budget for a CryPhone 3.

Five good reasons for buying the phone, and you just made an 84% margin.

Bait-and-Switch is a type of fraud, and it’s illegal in many countries. The principles behind it are well-known powerful cognitive biases such as bad assessment of sunk costs, price anchoring and  post-purchase rationalization, so they can be applied in many situations that would not legally qualify as a bait-and-switch fraud.

For a real-life example, consider this: Pixmania (an online retailer) advertises low prices on price comparison web sites, such as €48 for a flatbed scanner instead of an average market price of €51. However, delivery costs (which you only discover once you’re midway through the ordering process) are at least €6, which brings the price up to €54—and even picking up the flatbed scanner from their warehouse in Paris counts as a delivery. Other retailers do not charge anything if you pick up the item yourself, so you can actually find that flatbed scanner for €51. The Pixmania trick is too small to count as a fraud, but it relies on the same basic principles.

And then, they started spamming me weekly because I had entered my e-mail address when I started ordering. /me waves a flamethrower at Pixmania.

Bait-and-Switch is dangerous. If your customers suspect that you’re using bait-and-switch techniques to sell them something when they were actually looking for something else, you’re in trouble. Not only will they stop buying from you, but they will also tell everyone who listens to them—god forbid that they should be an influent twitter user. And you should be extra careful because this can happen even if you honestly never intended to use bait-and-switch at all.

Bounce Rates

I personally use bait-and-switch a lot. I don’t really mean to, but that’s just how search engines work.

My page on how Doodle God does Marketing is on the first results page for «Doodle God Easter Eggs», which brings me a healthy number of daily visits looking for such easter eggs. Some of these people are bound to think that I’m a jerk trolling for Google hits when in fact I’m just really good at unintentional SEO (I should start a consulting gig…).

My page on how Magento was pretty secure in early 2009 is literally the first result for «Hacking Magento», and it has been the most visited page on this web site so far. There’s no doubt here that 99% of the people who read that page are looking for a way to hack into a Magento store, and will be pretty disappointed when they find out I didn’t write a how-to guide.

On the other hand, I’m pretty happy that the person who looked for «web sex performer nicollet» yesterday was not satisfied by this blog.

The bounce rate is the percentage of first-time visitors who leave your web site after viewing only one page. If they’re coming from a search engine, this could mean they didn’t like what they found there, because if they did, they would have explored your web site a little further.

My Doodle God page has a 91% bounce rate – only one person in ten decides that the rest of my blog would be worth exploring. The Hacking Magento page has a 83% bounce rate – one person in five. Most people who end up on those pages did not find what they were looking for.

By contrast, the bounce rate on my About Me page is 0% – all the people who end up there (usually looking for “Victor Nicollet”) are happy with what they found.

Then again, who wouldn’t? ;)

Posts With Great Titles and Bad Content

The Four Stages of Communities

Alison Bechdel is the author of the Dykes to Watch out For webcomic. One of the characters has three simple and apparently obvious rules to decide whether she wants to see a movie. These are known as the Bechdel Test, and look for movies that:

  1. have two female characters
  2. who talk to each other
  3. about something other than a man

They may sound obvious, but popular movies fail the test on a regular basis.

The same applies to communities led by a figurehead, such as blogs or fan pages.

Stage Zero happens when there are no participants. It’s a sad place.

Stage One happens when there are some participants who leave comments and interact with the figurehead, but mostly ignore each other.

Stage Two happens when the participants start interacting.

Stage Three happens when the participants, still interacting with each other, start going off-topic and discuss things beyond the original purpose of the community.

Most communities get to Stage One. Yet, even as they get hundreds of participants, getting them to interact together is harder. Hundreds of people go write “Great Post! I completely agree with you!” in the comments section of every article on 10k-subscriber blogs because this gets them some free back links. It takes a lot of spine and insight to actually write something original, contradict the author on his own blog or *shudder* go post on a brand new blog with only a few subscribers.

This blog is still in Stage One. I think Stage Two is a nice place to be, and my regular posters seem to be clever and decisive enough to go beyond the “Great Post! I completely agree with you!” wall. Stage Three would be even better ;)

Blue Man Group – The Outsider

The Blue Man Group consists in several musical theatre troupes, acting all around the world, that follow the same conventions: three characters designed to be identical (the same size, the same body shape, the same blue latex bald caps and black clothes, and no voices), acting as outsiders to our modern world.

This is a short video of an interview with founders Matt Goldman, Phil Stanton and Chris Wink:

My favorite quote here is from Matt Goldman:

The group of three is the smallest contingent where you can have an outsider.

Find two other people and start discussing something. Could be a topic in the news, what you ate for lunch, a project you’re working, or a new start-up.

Sometimes, one will be talking and the others will listen. He is the outsider.

Sometimes, two will be discussing the topic while the third listens. He is the outsider.

Sometimes, two will agree and the third will disagree. He is the outsider.

Sometimes, one will have the solution when the other two are lost. He is the outsider.

We find the 2vs1 situation inherently remarkable, fun or interesting, because it makes it easier to see what is the norm and who is anormal. The outsider introduces creativity and disruption into the mix, where the two others provide stability and prevent the entire thing from going astray too much. As long as you switch roles often enough, there’s enough energy in a group of three to keep a discussion going forward for a while.

Three people is an entirely different group dynamic from only two people (and of course, the group dynamics of being only one person are different as well).

  • One person is excellent for eliminating communication costs (maximum efficiency when you know what has to be done). If you can do it alone properly, then do it.
  • Two people are good for high-bandwidth information transfer, because there’s no interruption.
  • Three people are good for thinking outside the box, for creative meetings where one acts as the disruption and the other two are stabilizers. Less than two stabilizers leads to a situation that is too unstable. More than two stabilizers prevents things from going forward.

What are you trying to achieve? How many people do you really need in that meeting?

Related Posts

Wave Me Goodbye

Google announced last Wednesday that they would discontinue Google Wave:

But despite these wins, and numerous loyal fans, Wave has not seen the user adoption we would have liked. We don’t plan to continue developing Wave as a standalone product, but we will maintain the site at least through the end of the year and extend the technology for use in other Google projects.

Google Wave is a web application that enables rich communication between Google Wave users. Rich meant a lot of things, such as sending as sending specific widgets directly (instead of sending a link to Google Maps or Doodle by e-mail, you could embed them), or moving away from the «every message is standalone» approach of e-mail and keeping track of conversations (sequences of messages) instead.

I remember Wave for the astronomical amounts of hype that surrounded it in the early days. It was said to be revolutionary. You had to be invited to use it, and there were only so many invitations around. And regardless of the apparent lack of interest, Google Wave is an impressive and exciting technical achievement:

Last year at Google I/O, when we launched our developer preview of Google Wave, a web app for real time communication and collaboration, it set a high bar for what was possible in a web browser. We showed character-by-character live typing, and the ability to drag-and-drop files from the desktop, even “playback” the history of changes—all within a browser. Developers in the audience stood and cheered. Some even waved their laptops.

Yet, Google Wave was designed as an application for communication and collaboration. Such applications, by design, need several people to be using it together. It’s a classic chicken-and-egg situation: I won’t use the system if I have no one to talk to, and I won’t have anyone to talk to if other people don’t use the system. And Google Wave made two mistakes here which prevented it from reaching the expected critical mass.

This morning, I turned my computer on. Within seconds, Skype and MSN Windows Live Messenger launched as well. These bloody parasites increase my boot time. But they’re doing the Right Thing: this means every time my computer is on, they will be running. Let me rephrase that: every time my friends’ computers are on, they will be running. This increases the probability that my friends will appear online for me to talk to them, which in turn increases the usefulness of the software.

It means that if Alice asks Bob to install Skype so she can send him a large file (or view his screen for some tech support, or whatever), then Bob will be connected to Skype all the time, even though he does not believe it to be useful.

On the internet, there’s no special “Launch when Windows starts” flag you can use to keep your users connected to your web site all the time. You have to rely on your users to either come back to the web site of their own accord every day, or set up your web site as their home page. Bob will only be connected on Google Wave if he genuinely believes it to be useful. This is an extremely important difference, and it was Google’s first mistake.

Rule 1. To achieve a critical mass for an application that revolves around user collaboration, you need to attach it to another application that is used on an extremely regular basis by the users.

Skype attaches itself to Windows. Facebook chat attaches itself to Facebook. Gmail chat attaches itself to Gmail. Google Wave attaches itself to… nothing.

Then, there was the other issue. Google decided that Wave would be initially available only by direct invitation, and every Wave user would only get a limited number of invitations. I think there were only eight. How could this have gone wrong? The reduced availability combined with the persistent Buzz made everyone run around in circles looking for invitations! Contests were held to win Wave invitations [fr]! Instead of thinking «oh, I’ll try it someday» everyone thought «I have to get my hands on an invitation now» !

I managed to get my hands on a Google Wave account when someone on my alumni network newsgroup offered them to anyone interested. I signed up, and was faced with a mostly empty screen. My contact list was empty, save for the person who had invited me (whom I knew in a «keep in touch» way, but not enough to warrant using Google Wave). I toyed around a bit with the interface, failed to get the point of it all, and never came back.

For someone in the web analytics business, Google made a pretty surprising error: they went for a high quantity of eyeballs, instead of a high quality. They attracted people through curiosity and the illusion of a shortage, instead of attracting people that wanted to communicate with existing users.

Rule 2. If your software relies on people using it together, then you should target non-users that might want to use your software with existing users.

The invitation model worked for Gmail because you can use it to send mail to any person on earth with an e-mail address. It worked for the early Facebook because of the privacy implications (you don’t want to invite someone unless you are comfortable with sharing your personal information with them) and because the friends of your friends are usually your friends as well (so you fill your contact list very fast). But with Google Wave, you could get yourself invited by anyone, and you would end up with an empty contact list and an useless application.

To quote Seth Godin, Ideas that spread, win. And here is a Godin-ly good hour-long video of his talk at Business of Software 2008:

Related Posts

The Evil Overlord Solution (2)

Not so long ago, the Evil Overlord Returned. Your job as a minion of evil was to help the Evil Overlord and the equally evil Empress Bing from Alpha Centauri pick a winner at random. The winner would then use a secret weapon to enslave mankind, because that’s what these kinds of people do.

Neither trusts you, so you had to find a provable way of offering each a 50% probability of winning. And the three of you can only communicate using one-on-one encrypted communication channels.

There were two interesting answers by Guillaume and Iftah, both of which should work (although Guillaume’s solution relies on instant communication, which is not necessarily available.

This is actually a common problem in cryptography. Let’s start with a traditional coin-flipping problem: one participant picks heads or tails, then someone else flips a coin. The participant wins if he chose correctly. The problem is that no one trusts anyone, so the “someone else” could easily be accused of cheating by the first participant (choosing an unfair coin, or even announcing heads or tails without flipping a coin).

In real life, one person flips the coin and hides the result, then the other person picks heads or tails, and the coin is revealed. The first person cannot manipulate the result even by using an unfair coin, and the other person does not know the result when they choose. This relies on the second person being able to verify that the coin was not tampered with while they were choosing. If one participant is on Earth and the other is on Alpha Centauri, this is impossible.

This is where hash functions come in. A hash function transforms a piece of text into a fixed-length text called a hash. For instance, the MD5 hash function turns HEADS into 7eb87d1ebe8f12eb105d00464a1eb496. The entire point of a hash function is that you cannot reverse it: if I gave you a hash, you couldn’t be able to find the original text.

So, the Evil Overlord would pick heads or tails with any method he wished (including, for instance, a fair coin toss) and write a long piece of text that indicates the chosen value, and compute its hash. For instance:

b5d3945edb299c8f54634b8c87c47a47

Then, he sends that hash to Empress Bing. She has no way of determining what piece of text this represents (because a hash function cannot be reversed). So she picks and announces either heads or tails. Suppose, for instance that she chooses “tails”.

The Evil Overlord then reveals the value he chose:

I chose tails. My clever choice will let me rule the world!

This lets Empress Bing win. The Evil Overlord cannot win, because that would involve finding a sentence containing “tails” that also results in the same hash, which is the same as reversing the hash and is therefore impossible. Of course, he could try tricking the Empress by providing a different sentence:

I chose heads. Really, I swear!

But that sentence would have a different hash, and the Empress would be able to find out very quickly by computing the hash herself:

bee5be82d96f76bffc07786c70cacb06

This means that his original choice cannot be tampered with in response to Empress Bing’s choice, without her knowing.

If any of the participants use a fair coin toss, then there’s a 50% probability of winning.

This reminds me… back in Computer Science school, I had to submit a paper by e-mail before midnight, but the paper was too big. So, I uploaded the file to my web server and send the teacher a link to it. However, this would have let me alter the file (since it was on my web server, I could spend the rest of the night working on it, and upload it a second time right before the teacher woke up and downloaded it). So, in order to prove that the online version was indeed uploaded before midnight, I sent the MD5 hash of the file to the teacher in the e-mail.

This only works for Computer Science assignments, obviously.

Brain Dump

Frameworks. Every single tech person is touting around the word Framework these days. And we all seem to have a different definition about it. Even when it obviously does not apply. Here’s what a tutorial had to say about the Blueprint CSS Framework :

Blueprint CSS isn’t really a framework in the sense that it’s not MVC (model-view-controller) like something like Ruby on Rails

Way to go kid. Don’t go around confusing Frameworks with MVC Web Server Frameworks (of which Ruby on Rails is an example). Also, do check out Blueprint CSS, it’s quite good for small-ish projects without a great web designer on hand.

Drive-through open source. On the topic of having fewer tech people around you yet still managing to set up your free open source tools, Bitnami offers free installers for the main open source applications. Instead of having to hunt down appropriate versions and configuratios of Linux, Apache, MySQL and PHP to run your Drupal web site, just download and install the Drupal package stack.

Gifts and choices. In a powerful address at Princeton, Amazon.com founder Jeff Bezos explains the difference between a gift (I’m good at doing X) and a choice (I decided to do Y) and the power of X=Y. Go read it. It’s great. If you’re wondering whether you should quit your job and start a company, go read it again. It only gets better.

DNS Propagation. Need to point your domain to another server, and wondering how many DNS servers have already caught up on the modification? WhatsMyDNS.net handles this for you. It’s free and very useful (albeit in an extremely specific situation).

Browse the Brain Dump category or subscribe to my feed.

Using JavaScript and PHP for Web Development

Today, I bring you a guest post from James Mowery.

When you want a website to do more than just display the same text to every user, you’re moving into the realm of things that will require the use of a programming language. Two of the most popular web development languages are PHP and JavaScript. They can often accomplish the same basic functions, though they’re designed to do it in different ways.

The most critical difference to consider is where the code will be executing. PHP is handled by the server, while JavaScript is processed by the user’s browser. This may initially seem like a minor implementation detail, but it actually has important implications.

The way that it executes means that JavaScript requires that your user be on a browser that supports JavaScript. It must also have this functionality turned on; some users turn off JavaScript support in their browser to improve their computer’s security. On the other hand, JavaScript can execute entirely on the user’s computer without having to contact the server again.

PHP, in contrast, has to contact the server every time a calculation or action needs to be performed. This means that communication between the user and the site will be much more frequent, more bandwidth will be used, and more requests will have to be processed. The need to wait for communication with the server also means that the time between getting input and giving a response is longer. On the other hand, PHP can achieve more sophisticated effects, including generating HTML and JavaScript as needed, and accessing databases.

Both JavaScript and PHP can be useful in setting up a website. Which one is more appropriate for a given situation will depend on the details of a project, and how responsive the servers running it are expected to be. These are issues that should be taken into consideration before any actual code is written.

About the author: James Mowery is a computer geek that writes about technology and related topics. If you wish to read more blog posts by him, he contributes regularly to a blog on laptop computers.

If you wish to contribute a guest post, you can send me an e-mail : victor@nicollet.net



693 feed subscribers
(readers who polled a feed this week)