What's frontend, what's backend?

Sun 06 November 2016

Last week a co-worker of mine asked me to clarify for him what the difference was between backend and frontend web development. I had been asked this quesiton before, but this was the first time I felt I provided a clear explanation and was able to instill knowledge.

So, here, I'd like jot down a lof of the key points which I think helped to clarify the meaning of and the difference between 'frontend' and 'backend' development:

  • Backend code is run on the server computer while frontend code is run on the client computer.
  • Being a fullstack developer means that you write (or can write) both backend and frontend code.
  • The backend takes care of any logic that the server needs to run before a response can be sent to the client. This includes things like retreiving data from a database, authenticating a user or making some calculations.
  • The frontend code takes care of any logic that needs to run locally - on the clients computer - in response to user interactions. This includes any subsequent network calls for updated data.
  • Frontend code is usually written in JavaScript, which your browser can interpret.

Why can't I write frontend in Python (or can I)?

  • Just like all browsers know how to turn HTML and CSS into pretty pages, all browsers know how to interpret JavaScript; All browsers have built in JavaScript interpreters.
    • Check it out! In Chrome right click on a page and click on the 'inspect'. Then click on the 'console' tab. You are now looking at a JavaScript Interpreter! For fun, write the following: alert('Leta is cool').
  • Python interpreters aren't currently built into browsers. It's not that they couldn't be it's just that they aren't. If I wanted to write frontend logic in Python I'd have two choices:
    1. Write a browser plugin to be able to interpret Python, and prompt users to install it to view my web app. (This type of thing has been done in order to run Java on the frontend! Remember those annoying Java plugin installation promps?)
    2. Compile my Python code down to JavaScript before sending it to the client. This is a bit of a hack, though, because technically javaScript is still what would be running on the client side.

Where do HTML and CSS fit in?

  • Often HTML and CSS are considered frontend. The reason being is that, like JavaScript, they are interpreted by your browser.
  • I consider HTML to be backend only in the context of a template that will be compiled by a template enginge. In this case one is writting an HTML page with added template language logic which will render more HTML depending on the data that is fed into it.
  • To me, this falls under the backend umbrella because the templatign engine will turn this template into a finished HTML file on the surver side before sending the final HTML file to the client.
  • Some people agree with me on this distinction, others disagree (and that's OK!)

Further readings

If you're curious to know a little more, specifically about why / how JavaScript became the only language built into browsers, I recommend reading this thread on reddit. I found it to be well explained and pretty thorough!

Category: Blog Tagged: Web


How the Internet Works

Thu 10 September 2015

What is the internet?

One thing I’d like to clarify right off the bat is that when we connect to the internet we are connecting to other physical computers. Any service accessed through the internet- email, Skype, reading the news online- is the result of obtaining data from one ...

Category: Blog Tagged: Web

Read More

Interviews are oportunities to learn

Thu 29 January 2015

Over the past month I've had my first experience interviewing for development positions. Its been a somewhat nerve-racking experience but also, at times, enjoyable. I've come to realize that the best way to approach an interview is with an attitude of excitement and an openness to learn.

A ...

Category: Blog Tagged: Python

Read More

Some things I learned when my computer crashed.

Wed 31 December 2014

During my last two weeks at Hacker School I encountered some serious troubles with my computer. Despite becoming overly emotional about the state of my computer, I learned some valuable things through this experience. I learned some cool bash commands when Casey helped me try to diagnose the cause of ...

Category: Blog Tagged: Bash Documentation

Read More

Scopes got me again!

Mon 15 December 2014

In a previous blog post I wrote about some of the struggles I encountered with scoping when Margo and I worked on our web framework Chapeau. This week, scopes got me again! This time, while I was working on my Template Engine.

I think that, as a new programmer, its ...

Category: Blog Tagged: Python

Read More

I made my first cookie!

Thu 27 November 2014

Margo and I have been working on our web-framework, Chapeau. To test out its functionality and user-friendliness, we've been using Chapeau to build various web-apps. This week we implimented a buzz-feed-style quiz. To challenge ourselves (and Chapeau) we structured the app to have a separate webpage for each question ...

Category: Blog Tagged: Web

Read More

Lisp Interpreter: Episode 3 (The Finally!) ... Continued.

Mon 24 November 2014

In last week's episode we inspected how my program tokenizes and parses the user's input. In the spirit of finishing this series of blog posts, I have decided today to present an overview of how the rest of my program works. We'll walk through the basic algorithm ...

Category: Blog

Read More

Lisp Interpreter: Episode 3 (The Finally!)

Tue 18 November 2014

Let me start off by apologizing for the delay. I've been hesitant to write this post for several reasons, including:

  1. Presenting and explaining my entire lisp interpreter is a BIG (and therefore daunting) task.
  2. There are parts of my code that I'm not entirely satisfied with and I ...

Category: Blog

Read More

Adventures with sockets, threads and more!

Tue 11 November 2014

For a while now I've wanted to learn more about the internet, about servers, and about how web apps really work. Last week I finished a small flaks tutorial. I enjoyed the tutorial and I learned some cool things by doing it, yet, I was feeling unsatisfied. The tutorial ...

Category: Blog Tagged: Web Threading

Read More

Little Lessons: Episode 2

Thu 06 November 2014

Seeing as there are a whole bunch of "little lessons" that I'd like to write down and keep track of, I've decided to extend my previous blog post "Little Lessons" into a whole series! Get ready!

Mutating Iterables:

Suppose we have a list and we'd like to ...

Category: Blog Tagged: Python

Read More

Interpreting the Interpreter: Episode 2

Thu 30 October 2014

Confession: I am not yet ready to present my final, finished, Lisp Interpreter. It will be coming soon, but not today. Today I will describe the rollercoaster ride of an experience taking on this project has been for me. Then I'll focus in on a couple things I've ...

Category: Blog

Read More

Little Lessons

Mon 27 October 2014

This blog post will be dedicated to some of the little (but important!) lessons I've learned over the past week. Enjoy!

The list method "extend" returns None.

Before I explain this lesson, let me just back up for a second and address the lingo "method". Only recently have I ...

Category: Blog Tagged: Recursion Lists

Read More

Interpreting the Interpreter: Episode 1

Mon 20 October 2014

This episode will describe my experience in the initial phases of writing a Lisp interpreter. I will describe how I started, my thought processes as I progressed, some of the code I wrote, how it worked, and, why,at day 3, I decided to start from scratch (almost). If you ...

Category: Blog

Read More

Interpreting the Interpreter: Episode 0

Fri 17 October 2014

For a while now, I have been perplexed by the land of compilers and interpreters. Thinking of these things sparks all sorts of questions in my mind. For instance, if a compiler compiles my program, but the compiler is itself a program, doesn't something need to compile the compiler ...

Category: Blog

Read More

What I learned from Crista Lopes

Sat 11 October 2014

The resident at Hacker School during my first week was Crista Lopes. She has given some great lectures, and she's taught me some cool things!

Different Styles of Writing Code

On Monday night she spoke to us about coding styles, the topic of her latest book. Crista explained that ...

Category: Blog

Read More

The struggles I had setting up this site.

Wed 08 October 2014

For me, setting up my blog was not easy. I think part of this was that I was impatient, and part of this was because IT IS HARD! I ran into many weird error messages and I began to get quite impatient and frustrated. Thankfully I got Allison to help ...

Category: Blog

Read More

Welcome

Wed 01 October 2014

Hello and welcome to my Blog! I started this blog in October 2014 to document some of my experiences at Hacker School, and to reflect on the things I've learned. This blog is mostly for my own benefit; writing about the things I learn helps to solidify them in ...

Category: About

Read More