From charlesreid1

I've created web apps using a couple of different languages.

My first introduction to web apps was through PHP, a dynamic, server-side web programming language. I use PHP for running web apps that other people have written, like MediaWiki and Wordpress. I occasionally use it for my website.

The way I usually develop web apps is using a combination of Python and Javascript, or just plain Javascript. If the web app is doing something complicated, I'll use Python; otherwise, I can usually get the job done in Javascript.

Below are some basic concepts about web apps that'll be useful to know.

Servers and Clients

Server-Side vs Client-Side

The biggest decision to make, when designing a web app, is deciding what tasks will be run by the client, and what tasks (if any) will be run by the server.

Let me explain.

Your typical webapp consists of two parties: the client, the end user of the webapp, and the server, the provider of the webapp.

Webapp.jpg

Most typically, you're using the HTTP protocol - that's why it's a WEB app. Using that HTTP protocol, you can send requests and information back and forth between the server and client. HTTP is a COMMON protocol, meaning you can turn data and variables in Python or Javascript into HTTP information, and vice-versa. This allows the client and server, running the two sides of the webapp, to communicate.

Deciding on whether to run parts of a web app on the client or on the server can have big implications for the complexity and speed of your webapp. If code runs only on the client side, it will be very fast, and all your server has to do is send some files, which means your server won't get bogged down as more users try and use the webapp.

But client-side-only web apps are pretty boring (unless you're into playing games). Much more interesting is the case of server-side applications. These might involve looking up data in a database or performing calculations. It might involve grabbing information from a sensor, or sending information to and from a microcontroller. There are many more interesting remote applications (at least, in my mind).

Python vs Javscript

We've seen that the main concern when designing a web app is location: client or remote side. This also has implications for the languages that we can use.

Javascript is designed as a client-side language, since it runs in the browser (although it can be hacked so you can use it as a server side language). Python, on the other hand, does not run in the browser, so it lacks the portability of Javascript. But Python has enormous power and an amazing selection of libraries, making it a great do-anything library:

Webapp jspy.jpg