1

How to Make Your Web Site Do Something

Posted by Duane on Feb 11, 2010 in Uncategorized

In your daily habits you’re probably so used to interacting with web sites on a variety of levels – contact forms, scrolling news stories, slideshows – that you don’t even realize there’s a lot of hard work that goes on behind the scenes.  Well, if you want to host your own site you’re going to learn about it in a hurry.  This article will examine the different levels of interactivity that you can provide your users via the web, and what it takes behind the scenes to make it happen. (The intended audience for this article is not programmers.  This is a primer on programming for the business people who need to make some decisions about what sort of effort they’re going to put into this aspect of their web strategy.  My apologies to my programmer friends who have stumbled here looking for a more in depth discussion, but we have other places for that.)

Step 0 : Brochure Ware

At the most basic, the web is really a content delivery format.  There’s information on one machine and you want to get it to a different machine.  The person who created the content formats it up with some special instructions about how to include pictures and when to use boldface text instead of regular.  These formatting instructions are understood by your web browser.  This is that HTML you’ve no doubt heard mentioned.  The whole circle here is very simple – your machine requests an HTML file from another machine, that machine serves up the file, your browser then draws the HTML file according to the instructions it was given.

The advantage to this system is that it is hands-down easy to work with.  For hosting, all you need is a place to put your files. Get yourself an HTML editor to make some files, move files to server using an FTP program, and you’re done. You absolutely positively want to get started this way if you haven’t already parked your newly hosted domain.  People can’t land on a web site that has no pages, so put one up even if it just says “Coming Soon”.  In this mode you want to focus on writing your content, which works out well for you because who knows your business better?  Break out your editor and start banging out the hard sell for who you are, what you do and why you’re the best at it!

The biggest disadvantage to this level of web building is that it’s about as interactive as a marketing brochure (hence the term “brochure ware”, get it?)  In the old days a web developer would be given a copy of the existing marketing brochure and told to make the web site look like that.

As a general rule, nobody accepts plain HTML as good enough any more.  There are just too many things that you can’t do (like something as easy as submitting a contact form to the site owner).

The exception to this rule is what’s called the “micro-site”.  Sometimes when you’re promoting a specific product and really want nothing but a single page which is all content and links directing to a specific service (such as Lulu for an e-book sale), then it’s quite common to whip together a single HTML page for the purpose.  This is very different from using this technique for your business’ primary web site, though.

Get Started Now! Learn How to Write Killer Copy!

Step 1 : Client-side JavaScript

For a web page to do anything beyond interpreting the HTML formatting commands, it needs to run a program.  The next logical question is, “Well, where to run it?”  Should it run on your computer, or the server computer that sent you the content?  Or somewhere else?

For now let’s talk about programs that run on your computer (“client side” in programmer lingo).  The most common way to make this happen is using a language called JavaScript.  JavaScript programs are embedded directly into the HTML, and it’s the browser’s job to run the scripts when necessary.  A simple JavaScript program might contain a list of a few dozen Shakespeare quotes, and then a simple timer that keeps refreshing one area of the site with a new quote every few seconds.  A more advanced program might play some games with the user, or even make calls out to other web sites (more on that in Step 3, AJAX).

The major benefit to JavaScript is that many programs can be run with a single request.  You may not realize it, but the slowest part of cruising the web is making that request to the other computer and then waiting for that computer to deliver the results.  So programmers try very hard to limit the number of “server side requests” that we make.  Any opportunity to do something client-side is considered a big win for performance.  One of the best tricks you can pull is to refresh only one segment of a page without refreshing the whole thing, so you could keep updating the top news story  without the user ever having to click Reload.

There are several disadvantages to JavaScript.  One is that there’s only so much you can do entirely on the client side.  For example in that game I mentioned above?  Sure you could play a game, but could you save high scores? Could you make it multi player?  Could you download fresh content?  No, not really, not without contacting other computers.  So while JavaScript can contact other computers, it’s a different way of thinking to work with both at the same time and that’s what we’ll talk about in Step 3.

The other major disadvantage of JavaScript is one of security.  Anything that is on the client’s computer can technically be hacked by the client if they wanted to.  You may not think your customers are interested in hacking your web site, but remember that not everybody who hits your site is your customer, some could be bad guys looking to mess you up.  The classic example that all programmers know is what’s called “form validation”.  Imagine that a web site is going to ask you for an email address, and it has to take the form of <word>@<word>.<word>.  You could set up a simple check in JavaScript that says “If the email address does not fit that pattern, then show an error and do not send this page back to the server.”  What you have to take into consideration is that someone could sneak around this program and submit a bad email address, just to see what happens.  So it’s important to validate all your code on the server.

Step 2, Server-Side

Most of what you experience on the web today is the result of server-side applications.  That is, when your computer makes a request to another computer, that computer is actually running a program to figure out what you want and provide you with an answer.  An obvious example of this would be a web site that requires you to login before you can see anything.  You request the “My Account” page, and then a controller program says “Do I know this person? Does he have an account?”  If you don’t, the program kicks you to the login page.  If you do, and you are logged in, you get to see the My Account page.

The scope of *how* to do server-side programming is wide open.  One popular option is the programming language PHP (sometimes referred to as part of the “LAMP stack”, which refers to Linux / Apache / MySQL / PHP ).  Most hosting providers offer PHP as part of their plan.

Another popular option is Ruby on Rails, which is something of a combination programming language / web framework where many of the assumptions about typical requirements have been made for you, and you just plug in the code that is different for your business.

For the larger enterprises you may hear talk of Java, Enterprise Java, or .NET.   Java and C# (the most popular .NET language) are typically the realm of trained software engineers and not the kind of thing that you pick up with a book from the local Borders.  PHP and Ruby, on the other hand, are more open to teaching yourself, which is perhaps one of the reasons why they are so popular.

To run programs on your server, your hosting provider has to allow them.  The best way to have any idea what this means is to have access to a developer/programmer.  They will poke around and tell you in a matter of minutes what it would take you hours of research just to get your head around.

What your provider likely offers is some “one click installation” software.  The idea is the same – these are server side programs just like you could have built for yourself with enough time and resources – but they’re already setup for you and ready to turn on.  This is a very popular and useful option for quickly setting up a blog, image gallery, or content management portal.

The advantage of server side programming, of course, is that you can quite literally do everything that you can imagine.  That’s the fundamental reason why the web is what it is, because every day someone is coming up with something you never knew you could do before.

The downside, though, is that the commitment is pretty large.  You need to know *how* to program. You need a hosting provider that allows you to run your programs.  You need to then get the programs running, which is not always as easy as it sounds – take that from a programmer with 20 years under his belt.  Even when it’s up and running you still don’t get a break because then you have to monitor for performance and security holes and memory leaks …  This is why there’s such a job as “web developer.”  You almost certainly don’t want to take this on yourself.

Not Convinced? Give It A Shot – Learn PHP in 17 Hours – Click Here!

Step 3, AJAX (aka The Cloud, Web 2.0)

Give yourself a pat on the back if you already thought “If server side programming is such a highly regarded commodity, what if people setup programs to do the most common functions, and then used that JavaScript stuff to execute them?”  You just thought up AJAX, the latest craze in web development.

No idea what I’m talking about?  I just got through saying how JavaScript is great as long as it can talk to the server programs, but server programs are very expensive (in terms of resources) to maintain for yourself, right?  Imagine somebody’s in the business of making those programs available.  That’s cool for them, they can hire programmers to watch the site and keep it running and keep the hackers out, all that good stuff.  But instead of then running a business on top of that, what they do is make those programs available to you, the small business owner.  You put a bit of JavaScript on your page that makes a call to this other service and presto, you get all the benefits of that service without the downside of having to maintain it.

Want a specific example?  Imagine that you want to run a mailing list so you can send out a newsletter.  You need to put a form on the web site to collect email addresses, and you need a database to store those addresses.  You need to handle it when somebody wants to unsubscribe from your list, and you need to generate email messages and blast them out to your subscribers.  So what if somebody did all that for you?  You just have to put a little “widget” on your page that invokes this other service, and it’s all done for you.  Very handy.

This is central to the concept of what’s often called “cloud” computing.  There’s a lot of redundancy on the web.  Plenty of blogs, slideshows, “news tickers”, mailing lists and so on.  It just doesn’t make sense for every small business that wants to get online to shoulder the burden of developing programs to do this.  So the web has moved into what many call it’s “2.0” phase where you start by asking, “I need to do X, is there already a service out there that I can use that does X for me?”

The advantages should be obvious.  Your time to market is diminished drastically.  You can bring a fully functional website up with advertising, blog, rotating slideshow, you name it – in a matter of hours.

Disadvantages? Somebody else wrote the code, so you’re limited by what they offer.  Maybe you hate the look of the widget they want to drop on your site, and you can’t configure it.  Chances are very good that if the service is not something you have to pay for, then there’s going to be an advertisement on it that your users will see (after all, these services have to make money somehow).  If you can’t find a service that suits your needs, then you have to decide whether you need it bad enough to make it yourself.

 

In conclusion, I hope that didn’t muddy the waters for you even more.  If you’re putting up a web site these days then you’re really pretty firmly in step 3.  Even if your hosting provider offers no PHP or other server-side solution, no one-click installs, you could still cobble together enough functionality using Web2.0 services to bring a very respectable web site up.  You just need to start thinking about what functionality your site will have (will you have a blog? news ticker? mailing list?) and who you’re going to link to in order to get it.

Good luck!

  • Share/Bookmark

Tags: , , , , , ,

Copyright © 2010 Before You Launch All rights reserved. Theme by Laptop Geek.