JavaScript is the language that powers the interactive web of the future. But as our web applications become larger and more complex, we begin to strain the old paradigm of throwing a bunch of JavaScript functions into a few files. Complex dependencies, tight coupling, and global state can turn our code into a huge plate of spaghetti. Though browsers do not natively support JavaScript modules, there are many tools that can help us to write clean, modular JavaScript.
In this session, we will explore the benefits of writing modular JavaScript. We will also take a deep dive into specific JavaScript module systems, such as Browserify, RequireJS, and the module standards that are coming in ES6.
Presented on 8/14/2012 at BostonRb. This talk provides a nice intro and overview of what RubyMotion is and whether or not it's worth incorporating into your development toolkit.
We'll look at how the HTML5 and related specifications allow us to develop applications that can survive outside of the web. Browsers now offer us simple storage and more complicated SQL based storage and also full offline support which means we can build our apps to be self sufficient when the user is disconnected. This talk will take you through the technology and walk you though some practical code.
Symfony Guard Authentication: Fun with API Token, Social Login, JWT and moreRyan Weaver
There are so many interesting ways to authenticate a user: via an API token, social login, a traditional HTML form or anything else you can dream up.
But until now, creating a custom authentication system in Symfony has meant a lot of files and a lot of complexity.
Introducing Guard: a simple, but expandable authentication system built on top of Symfony's security component. Want to authenticate via an API token? Great - that's just one class. Social login? Easy! Have some crazy legacy central authentication system? In this talk, we'll show you how you'd implement any of these in your application today.
Don't get me wrong - you'll still need to do some work. But finally, the path will be clear and joyful.
Writing code as an individual and writing code as part of the team are two very different things. Learn the tips and tricks for writing JavaScript code as part of the team so that your code will continue to work for years to come.
Presented on 8/14/2012 at BostonRb. This talk provides a nice intro and overview of what RubyMotion is and whether or not it's worth incorporating into your development toolkit.
We'll look at how the HTML5 and related specifications allow us to develop applications that can survive outside of the web. Browsers now offer us simple storage and more complicated SQL based storage and also full offline support which means we can build our apps to be self sufficient when the user is disconnected. This talk will take you through the technology and walk you though some practical code.
Symfony Guard Authentication: Fun with API Token, Social Login, JWT and moreRyan Weaver
There are so many interesting ways to authenticate a user: via an API token, social login, a traditional HTML form or anything else you can dream up.
But until now, creating a custom authentication system in Symfony has meant a lot of files and a lot of complexity.
Introducing Guard: a simple, but expandable authentication system built on top of Symfony's security component. Want to authenticate via an API token? Great - that's just one class. Social login? Easy! Have some crazy legacy central authentication system? In this talk, we'll show you how you'd implement any of these in your application today.
Don't get me wrong - you'll still need to do some work. But finally, the path will be clear and joyful.
Writing code as an individual and writing code as part of the team are two very different things. Learn the tips and tricks for writing JavaScript code as part of the team so that your code will continue to work for years to come.
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)Dotan Dimet
A lightning talk given at Rails Israel 2014
(http://railsisrael2014.events.co.il/presentations/1319-mojolicious-perl-framework-for-the-real-time-web).
Uses some slides lifted from Glen Hinkle's YAPC 2012 talk
(https://speakerdeck.com/tempire/intro-to-mojolicious-perl)
and an image created by Marcus Ramburg.
jQuery Performance Tips and Tricks (2011)Addy Osmani
Today we’re going to take a look at best practices, tips and tricks for improving the performance of your jQuery code. Performance optimization is a crucial aspect of building ‘snappy’ client-side applications and something which all developers using jQuery should bare in mind.
Short lived immutable servers with masterless puppetNeil Millard
Neil Millard describes the components required to run puppet in a masterless configuration. This allows you to boot immutable servers quickly, and the option of tearing them down and replacing/rebuilding quickly.
This was presented at Puppetcamp London 2017
Il arrive parfois que nous, développeurs, pensions qu’il n’est pas nécessaire de connaître ce qu’ils appellent les « design patterns » ou « patrons de conception ». Nous pensons parfois que nous n’avons pas besoin de cette théorie. Après des années d’expériences avec la faible maintenabilité de mon propre code et de celui de mes clients, j’ai exploré de nombreuses façons de découpler nos applications afin de créer des applications « enterprise ready » qui peuvent vivre pendant de nombreuses années. Via des exemples concrets, je vais vous présenter quelques design patterns qui peuvent vous aider à travailler sur une codebase propre, structurée et bien découplée.
Slides from my talk at the Angular Community Days 2017 in Barcelona. In this keynote I talked about the JS single threaded nature, the problem WebWorkers solve, their basics, and the fancy Angular approach in order to bootstrap your whole app inside a WebWorker so the UI does not freeze when running CPU consuming tasks in your code.
Fórum de Software Livre do Serpro RJ 2009Fabio Akita
Esta palestra é muito parecida com a que eu também ministrei no evento Dev in Rio 2009, portanto os slides são quase iguais caso você já tenha baixado.
A apresentação fala sobre filosofias, valores e idéias ágeis e como elas são a fundação da comunidade Ruby on Rails e do ecossistema que se formou ao seu redor.
Alguns dos vídeos mostrados estão disponíveis em http://vimeo.com/akitaonrails.com
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)Dotan Dimet
A lightning talk given at Rails Israel 2014
(http://railsisrael2014.events.co.il/presentations/1319-mojolicious-perl-framework-for-the-real-time-web).
Uses some slides lifted from Glen Hinkle's YAPC 2012 talk
(https://speakerdeck.com/tempire/intro-to-mojolicious-perl)
and an image created by Marcus Ramburg.
jQuery Performance Tips and Tricks (2011)Addy Osmani
Today we’re going to take a look at best practices, tips and tricks for improving the performance of your jQuery code. Performance optimization is a crucial aspect of building ‘snappy’ client-side applications and something which all developers using jQuery should bare in mind.
Short lived immutable servers with masterless puppetNeil Millard
Neil Millard describes the components required to run puppet in a masterless configuration. This allows you to boot immutable servers quickly, and the option of tearing them down and replacing/rebuilding quickly.
This was presented at Puppetcamp London 2017
Il arrive parfois que nous, développeurs, pensions qu’il n’est pas nécessaire de connaître ce qu’ils appellent les « design patterns » ou « patrons de conception ». Nous pensons parfois que nous n’avons pas besoin de cette théorie. Après des années d’expériences avec la faible maintenabilité de mon propre code et de celui de mes clients, j’ai exploré de nombreuses façons de découpler nos applications afin de créer des applications « enterprise ready » qui peuvent vivre pendant de nombreuses années. Via des exemples concrets, je vais vous présenter quelques design patterns qui peuvent vous aider à travailler sur une codebase propre, structurée et bien découplée.
Slides from my talk at the Angular Community Days 2017 in Barcelona. In this keynote I talked about the JS single threaded nature, the problem WebWorkers solve, their basics, and the fancy Angular approach in order to bootstrap your whole app inside a WebWorker so the UI does not freeze when running CPU consuming tasks in your code.
Fórum de Software Livre do Serpro RJ 2009Fabio Akita
Esta palestra é muito parecida com a que eu também ministrei no evento Dev in Rio 2009, portanto os slides são quase iguais caso você já tenha baixado.
A apresentação fala sobre filosofias, valores e idéias ágeis e como elas são a fundação da comunidade Ruby on Rails e do ecossistema que se formou ao seu redor.
Alguns dos vídeos mostrados estão disponíveis em http://vimeo.com/akitaonrails.com
A re introduction to webpack - reactfoo - mumbaiPraveen Puglia
I gave a talk at ReactFoo Mumbai about the history of how we arrived at the module bundlers we have today, specifically webpack. We walked through a live coding demo where I built a working webpack configuration for a working Vue application and then talked about the future of webpack.
You believe in the power of JavaScript modules, but you have an existing app, stack or platform infrastructure to keep running. Between maintenance and new features, where do you carve out time to switch over? After a brief overview of modules and why they're great, we'll dig into how to actually migrate a code base, from plotting your approach to implementation tips.
Video: http://youtu.be/FbdcdC8mqwE?t=50m51s (watch the entire video from the beginning for other great talks about shadow DOM and competing task runners)
Talk from February 19, 2014 NYCHTML5 Meetup: http://www.meetup.com/nychtml5/events/160684962/
A key feature of TYPO3 today is its extendability and flexibility. Writing extensions was never easier since the Kickstarter, and tslib_piBase. But, time doesn't stand still: new programming paradigms other innovative frameworks came up. It's time to take a next step to faster, cleaner extension coding. With the new Version 5 of TYPO3 and its basis FLOW3 the way to develop extensions will change fundamentally. With Extbase - the new framework for extension development introduced in TYPO3 4.3 - you are able to develop with the paradigms of FLOW3 today. During this talk, you get in touch with the features of the framework to understand how it supports your development process. We also address the users perspective by discussing best practices how to migrate to TYPO3 v5.
Javascript and first-class citizenry: require.js & node.js
Javascript on web pages is ubiquitous and its problems are legendary. Javascript, seen as a second-class code citizen, is usually hacked together even by seasoned developers. New libraries (jQuery, prototype, backbone, knockout, underscore) and runtime tools (firebug, jasmine) look like they solve many problems - and they do. But they still leave poorly written code as just that. One key problem is that all javascript code lives globally and this results in poorly managed, tested and delivered code.
In this session, I will illustrate that we can treat javascript as a first-class citizen using with require.js and node.js: it can be modular, encapsulated and easily unit tested and added to continuous integration cycle. The dependencies between javascript modules can also be managed and packaged just like in C# and Java. In the end, we can resolve many javascript difficulties at compile time rather than waiting until runtime.
2013-06-15 - Software Craftsmanship mit JavaScriptJohannes Hoppe
Entwickeln Sie Clean Code mit JavaScript. Den “Software Craftsman” zeichnen dabei Wissen, Werkzeuge und Wiederholung aus. Diese drei Grundfeste werden speziell für JavaScript beleuchtet. Lernen Sie die wichtigsten Patterns für eine stabile und wartbare Website kennen. Überprüfen Sie Ihre persönliche Werkzeugkiste für Entwicklung, Testing und Deployment. Schließen Sie Bekanntschaft mit Code Katas für JavaScript.
2013-06-24 - Software Craftsmanship with JavaScriptJohannes Hoppe
Entwickeln Sie Clean Code mit JavaScript. Den “Software Craftsman” zeichnen dabei Wissen, Werkzeuge und Wiederholung aus. Diese drei Grundfeste werden speziell für JavaScript beleuchtet. Lernen Sie die wichtigsten Patterns für eine stabile und wartbare Website kennen. Überprüfen Sie Ihre persönliche Werkzeugkiste für Entwicklung, Testing und Deployment. Schließen Sie Bekanntschaft mit Code Katas für JavaScript.
This workshop is a hands-on training where a real Zend Framework application is used as an example to start improving QA using tools to test, document and perform software metric calculations to indicate where the software can be improved. I also explain the reports produced by a CI system.
Strategies for Successful Data Migration Tools.pptxvarshanayak241
Data migration is a complex but essential task for organizations aiming to modernize their IT infrastructure and leverage new technologies. By understanding common challenges and implementing these strategies, businesses can achieve a successful migration with minimal disruption. Data Migration Tool like Ask On Data play a pivotal role in this journey, offering features that streamline the process, ensure data integrity, and maintain security. With the right approach and tools, organizations can turn the challenge of data migration into an opportunity for growth and innovation.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
Science gateways allow science and engineering communities to access shared data, software, computing services, and instruments. Science gateways have gained a lot of traction in the last twenty years, as evidenced by projects such as the Science Gateways Community Institute (SGCI) and the Center of Excellence on Science Gateways (SGX3) in the US, The Australian Research Data Commons (ARDC) and its platforms in Australia, and the projects around Virtual Research Environments in Europe. A few mature frameworks have evolved with their different strengths and foci and have been taken up by a larger community such as the Globus Data Portal, Hubzero, Tapis, and Galaxy. However, even when gateways are built on successful frameworks, they continue to face the challenges of ongoing maintenance costs and how to meet the ever-expanding needs of the community they serve with enhanced features. It is not uncommon that gateways with compelling use cases are nonetheless unable to get past the prototype phase and become a full production service, or if they do, they don't survive more than a couple of years. While there is no guaranteed pathway to success, it seems likely that for any gateway there is a need for a strong community and/or solid funding streams to create and sustain its success. With over twenty years of examples to draw from, this presentation goes into detail for ten factors common to successful and enduring gateways that effectively serve as best practices for any new or developing gateway.
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?XfilesPro
Worried about document security while sharing them in Salesforce? Fret no more! Here are the top-notch security standards XfilesPro upholds to ensure strong security for your Salesforce documents while sharing with internal or external people.
To learn more, read the blog: https://www.xfilespro.com/how-does-xfilespro-make-document-sharing-secure-and-seamless-in-salesforce/
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
CyanicLab, an offshore custom software development company based in Sweden,India, Finland, is your go-to partner for startup development and innovative web design solutions. Our expert team specializes in crafting cutting-edge software tailored to meet the unique needs of startups and established enterprises alike. From conceptualization to execution, we offer comprehensive services including web and mobile app development, UI/UX design, and ongoing software maintenance. Ready to elevate your business? Contact CyanicLab today and let us propel your vision to success with our top-notch IT solutions.
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
5. registraLon.js
$('input#name').on('change input blur', function () {!
var input = $(this)!
var inputGroup = input.parent()!
!
inputGroup.find('.help-block').remove()!
!
var name = input.val()!
var valid = !empty(name)!
!
inputGroup.toggleClass('has-error', !valid)!
if (!valid) {!
input.after(!
'<span class="help-block">Name is required</span>')!
}!
!
input.data('valid', valid)!
})!
6. registraLon.js
$('input#email').on('change input blur', function () {!
var input = $(this)!
var inputGroup = input.parent()!
!
inputGroup.find('.help-block').remove()!
!
var val = input.val()!
var valid = !empty(val) && /.+@.+..+/.test(val)!
!
inputGroup.toggleClass('has-error', !valid)!
if (!valid) {!
input.after('<span class="help-block">'!
+ 'A valid email address is required</span>')!
}!
!
input.data('valid', valid)!
})!
!
7. What
is
spaghe.
code?
DRY
WET
Loosely
Tightly
Coupled
SeparaLon
of
Concerns
Doing
Too
Many
Things
At
Once
Easy
to
Understand
Big
Ball
of
Code
Safe
to
Modify
Afraid
to
Touch
Well-‐tested
Tests?
Hah!
8. What
is
spaghe.
code?
Source:
hBps://www.flickr.com/photos/avlxyz/4800088303/
9. What
about
ravioli?
Source:
hBp://cocinandoespero.blogspot.com/2009/11/ravioli-‐rellenos-‐de-‐setas-‐del-‐bosque.html
10. empty.js
module.exports = function (v) {!
if (!v) {!
return true!
}!
!
if (typeof v === 'string' && v.trim() == '') {!
return true!
}!
!
return false!
}!
11. required.js
var empty = require('./empty')!
!
module.exports = function (val, label) {!
label = label || 'Field’!
!
return empty(val) ? (label + ' is required') : null!
}!
12. email.js
module.exports = function (val, label) {!
label = label || 'Field’!
!
return /.+@.+..+/.test(val) ? null !
: (label + ' must be a valid email address')!
}!
13. validate.js
module.exports = function (validation, label) {!
return function (value) {!
return validation(value, label)!
}!
}!
14. validate-‐input.js
var $ = require('jquery')!
var _ = require('lodash')!
!
module.exports = function (input, validations) {!
return function () {!
var val = $(input).val()!
!
var error = _.chain(validations)!
.map(function (validation) {!
return validation(val)!
})!
.compact()!
.first().value()!
!
return error!
}!
}!
15. Composed
ValidaLon
FuncLon
var $ = require('jquery')!
var required = require('./validation/required')!
var email = require('./validation/email')!
var validate = require('./validation/validate')!
var validateInput = require('./validation/validate-input')!
!
var validateEmail = validateInput(!
$('input#email'), !
[!
validate(required, 'Email'), !
validate(email, 'Email')!
])!
!
// This will now get the input value, run through!
// all the validations, and return an error message!
// if validation fails!
validateEmail()!
16. Even
more
composiLon!
module.exports = function (formGroup, validator) {!
var input = formGroup.find('input')!
input.on('change input blur', function () {!
!
formGroup.find('.help-block').remove()!
!
var error = validator()!
formGroup.toggleClass('has-error', !!error)!
if (error) {!
input.after('<span class="help-block">' !
+ error + '</span>')!
}!
})!
}!
watch-‐and-‐validate.js
17. Even
more
composiLon!
var validateEmail = validateInput(!
$('input#email'), !
[!
validate(required, 'Email'), !
validate(email, 'Email')!
])!
!
watchAndValidate($('.form-group.email'), validateEmail)!
!
!
var validateName = validateInput(!
$('input#name'), !
[ validate(required, 'Name') ])!
!
watchAndValidate($('.form-group.name'), validateName)!
18. What
is
ravioli
(modular)
code?
DRY
Loosely
Coupled
SeparaLon
of
Concerns
Easy
to
Understand
Safe
to
Modify
Well-‐tested
19. The
UNIX
Philosophy
Do
one
thing
and
do
it
well
-‐
Doug
McIlroy
(1978)
Many
UNIX
programs
do
quite
trivial
things
in
isolaCon,
but,
combined
with
other
programs,
become
general
and
useful
tools.
-‐
Brian
W.
Kernighan
and
Rob
Pike
(1984)
Small
is
beauCful.
-‐
Mike
Gancarz
(1994)
20. Simple
UNIX
Tools
• find
-‐
searches
a
directory
structure
for
files
matching
an
expression
• xargs
-‐
executes
an
arbitrary
command
using
the
output
of
a
previous
command
as
arguments
• egrep
-‐
searches
for
text
matching
a
given
regular
expression
• identify
-‐
retrieves
image
metadata
(part
of
ImageMagick)
• cut
-‐
extracts
segments
of
text
• tar
-‐
creates
file
archives
21. A
Complex
Task
I
want
to
search
through
my
file
system
for
all
photos
taken
during
the
winter
holiday
season
of
every
year,
and
put
them
in
a
single
archive.
23. While
designing
the
future,
it’s
important
not
to
forget
the
lessons
of
the
past
There
is
such
a
thing
as
a
Beethoven
or
Mozart
of
soUware
design.
-‐
ScoV
Locklin
24. VanillaJS
modules
(function (global) { !
var chicken = global.chicken = {}!
!
chicken.thesis = function () {!
// I sure hope the browser finished loading egg.js !
// and sprintf.js by now...!
return sprintf('You need the %s before the %s.', !
chicken.sound(), egg.sound())!
}!
!
chicken.sound = function () {!
return 'cluck'!
}!
!
}(window))!
chicken.js!
25. VanillaJS
modules
(function (global) { !
var egg = global.egg = {}!
!
egg.thesis = function () {!
// I sure hope the browser finished loading!
// chicken.js and sprintf.js by now...!
return sprintf('You need the %s before the %s.',!
egg.sound(), chicken.sound())!
}!
!
egg.sound = function () {!
return 'crack'!
}!
!
}(window))!
egg.js!
26. VanillaJS
modules
// I sure hope the browser finished loading jquery !
// by now...!
$(document).ready(function () {!
// I sure hope the browser finished loading egg.js !
// and chicken.js by now...!
!
$('<div/>').html(chicken.thesis())!
.appendTo(document.body)!
!
$('<div/>').html(egg.thesis())!
.appendTo(document.body)!
})!
debate.js!
29. Browserify
modules
var egg = require('./egg')!
var sprintf = require('sprintf')!
!
module.exports.thesis = function () {!
return sprintf('You need the %s before the %s.', !
sound(), egg.sound())!
}!
!
var sound = module.exports.sound = function () {!
return 'cluck'!
}!
chicken.js!
30. Browserify
and
npm
• Over
150,000
packages
on
npmjs.com
• Can
point
npm
to
arbitrary
URLs
• Easy
to
install
packages
• Easy
to
upgrade
packages
32. In
just
a
few
minutes,
we…
• Imported
three
3rd
party
libraries
Easy
to
upgrade!
• Created
several
Lght,
focused
modules
Easy
to
test!
• Integrated
a
templaLng
system
Safe
from
XSS!
• Set
up
a
quick
turnaround
development
process
Sourcemaps,
too!
• Set
up
producLon
build
process,
producing
one
bundle
with
all
JavaScript
and
templates
Minified,
too!
33.
34.
35. RequireJS
• Helps
you
write
Lght,
focused
modules
• Manages
complex
dependency
trees
• Only
includes
modules
you
actually
use
• Can
produce
a
single
bundle
Like
Browserify…
39. RequireJS
Unlike
Browserify
(in
a
bad
way)
• Cumbersome
syntax
(IMO)
• No
package
manager;
need
to
manually
install,
upgrade,
and
manage
3rd
party
library
dependences
• More
configuraLon
40.
41. ES6
Modules
• ECMAScript
version
6
(the
next
JavaScript
standard)
• NaLve
browser
support
(someday)
• Only
loads
the
modules
you
need
• Simple
syntax
42. ES6
Modules
chicken.js!
import * as egg from './egg'!
import sprintf from 'sprintf'!
!
export function thesis () {!
return sprintf('You need the %s before the %s.', !
sound(), egg.sound())!
}!
!
export function sound () {!
return 'cluck'!
}!
43. ES6
Modules
• Need
something
to
create
a
producLon
bundle
• Need
a
transpiler
unLl
supported
in
target
browsers
(babel,
Browserify
+
babelify)
44. So
which
module
system
should
I
use?
The
nice
thing
about
standards
is
that
you
have
so
many
to
choose
from.
-‐
Andrew
S.
Tanenbaum
46. Simplicity
is
prerequisite
for
reliability.
-‐
Edsger
W.
Dijkstra
Simplicity
is
the
ulCmate
sophisCcaCon.
-‐
Leonardo
da
Vinci
Any
intelligent
fool
can
make
things
bigger,
more
complex,
and
more
violent.
It
takes
a
touch
of
genius
-‐
and
a
lot
of
courage
-‐
to
move
in
the
opposite
direcCon.
–
Albert
Einstein
“Simplicity
is
about
subtracCng
the
obvious
and
adding
the
meaningful.”
-‐
John
Maeda
47. Don’t
write
complex
so7ware…
Write
many
pieces
of
simple,
thoroughly
tested
sopware…
And
compose
these
simple
pieces
of
sopware
to
do
complex
things.
48. Jeremiah
Orr
@JerryOnJava
jerryorr.com
Spider
Strategies,
Inc
thedash.com
Thanks
for
listening!
All
code
examples
available
at
hBps://github.com/jerryorr/psuweb-‐modularity