10 Things I'd Rather Download than your 2MB Web Page

Websites are getting extra beefy and clunky these days. The new average size of a single web page in 2014 is just under 2MB. Like 200× bigger than, ya know, back in the day. That's a big honkin' web page; most of which is big pictures, custom fonts, and carousels.

I think I can do better with any one of these 10 things:

  1. 3 eBooks of any Terry Pratchett Discworld novel

  2. 4 funny cat videos from Vime (OK, they probably won't be that funny*)

  3. A radio-quality MP3 of almost any non-remix version of any song by Beck

  4. A file big enough to break the Atom editor

  5. A nice retina photo of my dog for my laptop background

  6. Two copies of a file with info about all the zip codes in the USA (the list is less than 1MB zipped)

  7. 30 old school Nintendo® games (ROM sizes are usually

Continue...

Introducing GOTOJS: Sequential Programming for JavaScript

With all the Javafication of JavaScript still going around today, I'd like to take the conversation in another direction and humbly introduce GOTOJS.

It's a lightweight, low-level library that:

  • Introduces proper sequential programming based on line numbers, something sorely missing from JavaScript
  • Reduces complexity by eliminating the need for semicolons
  • Works exclusively in global space; no more var statements for your variables (seriously, don't use them or something may break)
  • Simple, direct control of code execution with goto()
  • Powered by eval()

Using GOTOJS

Basically, it's BASIC.

Example

program = {  
    10: "x = 0",
    20: "x = x + 1",
    30: "print(x)",
    40: "if (x < 5) goto(20)",
    50: "print('Done!')",
    60: "end()",

    100: "print('Hello World!')"
};

run();  

Produces:

1  
2  
3  
4  
5  
Done!  

You can also run from a given line number:

run(100);  

Produces:

Hello World!  

Easy!

Commands

  • run(line) start execution of the program at the beginning

Continue...