Git Product home page Git Product logo

compressionorientedprogramming's Introduction

Compression-Oriented Programming

A web programmer goes on a soul searching journey where he comes face to face with the big lie of web programming and discovers the truth was deep inside him all along.

Here's a walkthrough of one of the features of this code: https://youtu.be/YMQwa36GKpg

This repo is inspired by Casey Muratori's Compression Oriented Programming methodology. https://mollyrocket.com/casey/stream_0019.html

The way the code in this repo was coded has been heavily inspired by Casey's compression oriented methodology.

The Big Lie of Web Programming Rant

Here's the big lie of web programming:

If you don't like the technology you're building on, the solution is to build an abstracted layer on top of it.

This idea is so normalized in our industry, that it's not even controversial. It's the reason you can't do a PHP project without using a framework that abstracts everything into unfathomable black boxes. It's the reason you need a package manager for javascript - ending up with 100s of dependencies to do trivial tasks. It's the reason you can read the above statements without blinking an eye.

If this idea worked, then we wouldn't have a completely new javascript framework every 2 years. C programming has been around 45 years and it is still the go-to language for coding some of the most performance intensive software on the planet, doing hundreds of complex calculations and rendering 60 times per second. Meanwhile, we web programers are literally rending static text and bitmaps to the screen, and we're happy if we can serve a webpage in under 4 seconds.

It's embarrassing.

While many are proclaiming that the web is horrible, and I agree, unfortunately those of us in web tech need to cope with it for now. The way I am coping is by not defaulting to frameworks and abstraction, instead preferring to write simple code and suppliment it with the simplest libraries where possible.

I also strive to have my code have the fewest "jumps" possible, making it easy to follow and reason about.

Update 8/1/2019

This is kinda old now - I would simplify by using the server side language to template out all the html, and then just manipulate it in javascript. Greatly simplifies the process.

Configuration

Since this project is for demoing work, I've set it up on my Mac. Here's my config if that's helpful.

/etc/hosts

127.0.0.1 compression.app

nginx

server {
	listen 80;
	root /usr/local/var/www/compression_oriented_programming/public;
	server_name compression.app;

	index index.php;
	location / {
			try_files $uri /index.php;
	}

	location ~ \.php$ {
			try_files $uri /index.php =404;
			fastcgi_split_path_info ^(.+\.php)(/.+)$;
			fastcgi_pass 127.0.0.1:9000;
			fastcgi_index index.php;
			fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
			include fastcgi_params;
	}
}

compressionorientedprogramming's People

Contributors

setharchambault avatar

Stargazers

 avatar Jonah H. Harris avatar ryche avatar Tomás Marques avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.