Upload
bedis-elacheche
View
24
Download
2
Embed Size (px)
Citation preview
Have we forgotten how to program?
@elacheche_bedis SOUSSE, April 2016.
Modern Javascript
Javascript is no longer just being used to enhance the user-experience on sites, it’s being used to build complex applications.
If you’re still including all of your scripts in your pages using a <script> tag, you’re doing it WRONG.
What a modern front-endworkflow looks like?
Dependency management
Tasks automation
Testing
Docs
Continuous Integration
Version control
Build
Code linting
Prerequisites
- NPM
- GIT
- A command line with less suck*
*If you’re doing development in Windows, the built-in console sucks
- Command Line Interface Application
- Allows users to install Node.js apps that are available on the npm registry
- Manages dependencies
Manages dependencies ?
Generally when working on a project, there comes a time when you have to leave the dev environment and if there are dependencies, you will have to follow them. Rather than copying them by hand, which more completely pollute a source manager.
/* Hello world */
require('module1');require('module2');/* Awesome Code */
/* Bazinga */
app.js
./node_modules
module1.js module2.js
- When you distribute your program, simply provide your sources and a config file.
- A simple command and the module is downloaded and installed!
- If a module requires another module to operate, NPM will download automatically!
NPM registry
- When it comes to building programs, there are a whole lot of modules and tools available to make the process quicker and simpler.
- NPM registry works sort of like an App store for developers. They look up the functionality they want, and hopefully fund a module that does it for them.
The guywho broke
the internet
“ @izs accepted to change the ownership of this module, without my permission. ”
“ I know you for years and would never imagine you siding with corporate patent lawyers threatening open source contributors ... I want all my modules to be deleted including my account, along with this package. I don’t wanna be a part of npm anymore. If you don’t do it, let me know how do it quickly. I think I have the right of deleting all my stuff from npm. ”
Unpublished more than 275 of his modules from NPM,
Left-pad
- Left-pad was fetched 2,486,696 downloads in just the last month, according to NPM.
- It was relied upon by companies such as Facebook, Netflix, and Airbnb.
- Programmers were left staring at broken builds and failed installations.
WHAAAAAAAAAAAT !?
“ This situation made me realize that NPM is someone’s private land where corporate is more powerful than the people, and I do open source because, Power To The People. ”
“ I did it for the benefit of the community in long term. NPM's monopoly won't be dictated to the free software community anymore. ”
Now what?
“ If a developer calls on an npm module, it’s basically shorthand for 'put this code in later', and a software compiler will just download the code when the time is right. ”
- Matt Weinberger
Have we forgotten how to program?
@elacheche_bedis SOUSSE, April 2016.