This document discusses techniques for improving JavaScript performance by following the DRY (Don't Repeat Yourself) principle. It identifies DOM manipulation, function calls, and property lookups as particularly slow operations in JavaScript. The document provides examples of inefficient code and more optimized alternatives that avoid repetition through caching elements, using document fragments for DOM changes, and minimizing scope lookups. Overall, the document advocates structuring code in a DRY way to improve performance, especially within loops, intervals, and event handlers.
An introductory presentation I'm doing at my workplace for other developers. This is geared toward programmers that are very new to javascript and covers some basics, but focuses on Functions, Objects and prototypal inheritance ideas.
This document provides an overview of JavaScript including its history, key features, and comparisons to other languages. It also discusses important JavaScript concepts like objects, functions, events, and libraries like jQuery. Key topics covered include the window, document, location, and history objects, arrays, cookies, closures, inheritance, callbacks, and popular JavaScript libraries and frameworks.
This document discusses JavaScript promises as an abstraction pattern for handling asynchronous code. It explains why promises are useful by describing some of the issues with callback-based asynchronous code, such as callback hell and lack of readability. The document then provides examples of how to create and use promises to handle sequential and parallel asynchronous tasks in a more maintainable way using chaining and batching. It also discusses how promises are supported in browsers, Node.js, and common promise libraries like Q, RSVP, when.js, and Bluebird.
Web developers constantly look for the latest and greatest ways to hone their craft, but changes come fast. From jQuery to Angular to Ember to React, CoffeeScript to TypeScript, it seems there is always something new. But ES6 is something different. With ES6 we are seeing the evolution of core JavaScript. It includes syntactic improvements and great new features never before seen in client-side code. Linters and transpilers for ES6 are readily available and easy to use. There is no need to wait; learn how to leverage the power of "the new JavaScript" in your applications, today!
ES6 is Nigh is a presentation on the future of JavaScript. It discusses the history of JavaScript and why ES6 is important for advancing the language. The presentation outlines many new features being added in ES6, such as arrow functions, classes, modules, template strings, symbols, generators, and proxies. It emphasizes that ES6 is purely additive and introduces these features without breaking backwards compatibility.
The document provides an overview of the qooxdoo framework and toolkit. It demonstrates how to download and explore the qooxdoo SDK which contains over 15,000 files. Code examples are provided to illustrate defining a class with properties, mixins, inheritance and interfaces. Additional features highlighted include extensive documentation, GUI components, easy key/command binding, layouts for positioning elements, and REST call capabilities.
The document discusses dependency injection and inversion of control principles in PHP applications. It provides examples of using global variables, Zend Registry, and Zend Application to manage dependencies. It also summarizes various PHP dependency injection containers and how they can be used to configure services and their dependencies. The document advocates designing applications with loose coupling, separation of concerns, and configuring via configuration files rather than code for improved maintainability.
This document discusses new features in ECMAScript (ES) 6 including: enhanced object literals with shorthand property and method definitions; destructuring assignment for arrays and objects; template strings for string interpolation; iterators, generators, and for-of loops; modules with named and default exports; and the module loader API. It provides code examples to demonstrate these new features and compares them to CommonJS and ES5 syntax.
From ReactPHP to Facebook Hack's Async implementation and many more, asynchronous programming has been a 'hot' topic lately. But how well does async programming support work in PHP and what can you actually use it for in your projects ? Let's look at some real-world use cases and how they leverage the power of async to do things you didn't know PHP could do.
This document introduces ES2015 (ECMAScript 2015), which updated the JavaScript language with new syntaxes and libraries. It summarizes some of the key additions, including classes, template literals, object literal extensions, Maps, destructuring, and more. These features are now supported by modern browsers. The document provides examples of code using the old syntax versus the new syntax for classes, template literals, Maps, and destructuring to illustrate the changes. It also lists some references for further exploring ES2015.
The document summarizes techniques for improving app development in Swift. It discusses using the Result enum to model success and failure states from network requests, using the Cartography framework to simplify auto layout code, representing view states with an enum to avoid ambiguity, and defining shared behaviors with protocols to reduce duplicated code. The techniques aim to make code more readable, simplify view controller logic, centralize state management, and prevent duplicated implementation across unrelated types.
Minimizing Decision Fatigue to Improve Team ProductivityDerek Lee
The document describes a typical day at Pivotal Labs, focusing on techniques for improving team productivity such as pair programming, standup meetings, discussions, and retrospectives. It emphasizes organizing code through file structure and annotations in Swift to minimize decision fatigue. Styles are defined for UI elements through extensions to promote consistent branding.
This document provides an overview of JavaScript basics including:
- The history and creation of JavaScript in 2 weeks by Brendan Eich.
- Language basics like syntax, variables, objects, functions, and inheritance.
- Tools for JavaScript development like Firebug and jsLint for debugging and linting.
- Best practices like unobtrusive JavaScript, namespaces, and automated testing.
- Resources for further learning JavaScript like books and websites.
JavaScript - Like a Box of Chocolates - jsDayRobert Nyman
This presentation aims to give you information about the JavaScript language itself; pros, cons and pitfalls. It will cover the basics and then go into objects, scope, closure and some performance bits.
Interceptors: Into the Core of PedestalKent Ohashi
Pedestal is a Clojure library for building server-side web applications. It uses interceptors, which are similar to middleware, to modify the request-response context as it passes through the system. The document shows how to create a basic Pedestal project, define routes and handlers, and use interceptors like body-params to extract parameters from requests. Further reading sections provide links to learn more about Pedestal, interceptors, related concepts, and alternative routing libraries.
Symfony2 Service Container: Inject me, my friendKirill Chebunin
This document discusses the Symfony service container and dependency injection container. It covers topics such as inversion of control, dependency injection patterns like constructor injection, service definitions, scopes, extensions, compiler passes, and how bundles integrate with the container.
Converting your JS library to a jQuery pluginthehoagie
The document discusses converting an existing JavaScript library to a jQuery plugin by encapsulating the code within an anonymous function, allowing options to be passed in at initialization, making private functions truly private, and making the selector and initialization customizable per instance rather than hardcoded. It provides an example of converting some sample code to a jQuery plugin following these best practices in under 20 lines of code.
- JavaScript patterns like custom events, deferreds, and pub/sub can help manage asynchronous processes in the browser environment. Custom events allow defining and triggering custom events. Deferreds help manage callbacks and caching of asynchronous results. Pub/sub implements a publisher/subscriber pattern for loose coupling between modules. These patterns help modularize applications and decouple components.
The document discusses the keyword "this" in JavaScript and how its context depends on how functions are called. It provides various ways to avoid using "this", such as binding functions, using closures to access outer variables, and defining objects without "this". Avoiding "this" can make code clearer but uses more memory, while using "this" carefully enables features like inheritance. The overall message is to understand how "this" works and avoid it when possible or bind it when needed.
jQuery: out with the old, in with the newRemy Sharp
This document provides an overview and introduction to jQuery. It discusses understanding jQuery and its core functionality as a DOM library. It covers selecting elements, DOM navigation/filtering, debugging selectors, new features like deferreds/promises in jQuery's Ajax functionality. It also discusses best practices like letting the browser handle effects natively when possible, proper use of document ready, and designing well-behaved jQuery plugins.
The document discusses the Dojo JavaScript toolkit. It provides an overview of what Dojo is, including that it is a lightweight JavaScript toolkit with modular components for tasks like charts, calendars, file uploads and more. It also discusses Dojo's build system for concatenating and minifying files, its module loading system, and patterns used like ambiguous constructors, chaining and deferreds. The document promotes Dojo's large developer community and active development.
The document discusses reasons why JavaScript does not suck, including that it is the most widely used functional programming language, supports lambda functions, objects, metaprogramming, and duck typing. It provides examples of the module pattern for encapsulation and prototype inheritance for object-oriented programming in JavaScript.
This document provides an overview of intermediate JavaScript language features including object literal notation, functions within objects, JSON syntax, arguments, arrays, logical operators, functions as objects, function pointers, callbacks, and higher order functions. It explains how object literals can be used to define objects and functions, the relationship between arrays and objects, and common patterns involving functions like callbacks and higher order functions.
The document discusses different patterns for handling asynchronous code in JavaScript: callbacks, promises, and AMD (Asynchronous Module Definition). It outlines issues with nested callbacks and inflexible APIs. Promises and AMD aim to address these by allowing composition of asynchronous operations and defining module dependencies. The document provides examples of implementing PubSub with events, making and piping promises, and using AMD to load dependencies asynchronously. It concludes that callbacks should generally be avoided in favor of promises or AMD for asynchronous code.
JSX is an XML-like syntax extension to JavaScript, popularized by React. When seen for the first time it can often elicit bad memories of intermixing HTML and code, but JSX is *very* different! Let's learn exactly what it is, how it works, and even how you can use it outside of React.
--
Reactive programming nut and compiler enthusiast. Jay is a Senior Software Engineer at Netflix. Lover of all things open source, his contributions span numerous ecosystems. Former RxJS core team member and author of core-decorators, git-blame-someone-else, and co-author of redux-observable.
Slides from the GTA-PHP meetup about the new features in PHP 7. Slides had corresponding RFC pages linked to them in the speaker notes, but they don't seem to correspond to pages here so I've made the original keynote file available at http://gtaphp.org/presentations/NewInPHP7.zip and a PowerPoint version at http://gtaphp.org/presentations/NewInPHP7.pptx.
This document discusses JavaScript and the Dojo toolkit. It emphasizes that JavaScript is very flexible and powerful on its own, beyond just manipulating the DOM. Dojo takes advantage of JavaScript's capabilities by providing utilities like pub/sub, object-oriented programming, function binding, and extending native prototypes. Overall, the key message is that JavaScript can do a lot more than people realize and libraries like Dojo help unlock its full potential.
Symfony CMF - PHP Conference Brazil 2011Jacopo Romei
The document discusses Symfony CMF, which is a tool for developers to build content management systems. It provides a standardized PHPCR API and implementation-agnostic interfaces to work with content repositories. Symfony CMF aims to reduce technical debt that CMS systems can introduce by separating data and behavior using a content repository. The document includes code examples of using PHPCR for content storage and retrieval.
The document discusses crafting app interfaces. It begins with an introduction by Nathan Smith about carpal tunnel relief and slides being available online. It then discusses using Sass to expedite writing CSS which compiles down to CSS. It emphasizes using frameworks as extensions and learning the underlying languages to avoid being dependent on frameworks.
The document discusses several best practices for optimizing jQuery code including:
1) Using more specific selectors for faster lookups, chaining methods instead of multiple lookups, and storing selections in variables.
2) Using .live() instead of .click() for event binding to improve performance.
3) Declaring variables together on one line and containing global variables in a namespace to reduce scope and conflicts.
4) Manipulating the DOM efficiently by inserting HTML fragments together instead of separately.
Matthew Eernisse gave a presentation on NodeJS at the Toster Conference in 2011. He discussed what NodeJS is, how it uses asynchronous and event-driven JavaScript, and some examples of using NodeJS at Yammer for applications like a file upload service and real-time document editing. He also covered challenges like debugging asynchronous code, developing for NodeJS, and operations considerations like monitoring and logging.
1. JavaScript can be used to build applications, and some common JavaScript frameworks are YUI, Tbra, and native JavaScript. YUI and Tbra provide more robust functionality while native JavaScript is simpler.
2. When developing with JavaScript, code is usually wrapped in an anonymous function for namespace management and to avoid polluting the global namespace. Scripts and CSS files also often include a cache-busting parameter to ensure the latest versions are loaded.
3. Interacting with DOM elements in JavaScript commonly uses event handling. Libraries like YUI provide cross-browser event handling functions to attach events like click to elements.
This document provides an overview of asynchronous JavaScript and techniques for handling asynchronous code. It discusses asynchronous functions like setTimeout, XMLHttpRequest, WebSockets and others. Examples are provided to demonstrate asynchronous behavior and the callback hell problem. Solutions to callback hell like async.js and promises are mentioned. Other topics covered include object literals vs constructor functions, the prototype property, private methods in JavaScript using closures, the module pattern, and Object.defineProperty for defining object properties with getters and setters.
BLOCKCHAIN TECHNOLOGY - Advantages and DisadvantagesSAI KAILASH R
Explore the advantages and disadvantages of blockchain technology in this comprehensive SlideShare presentation. Blockchain, the backbone of cryptocurrencies like Bitcoin, is revolutionizing various industries by offering enhanced security, transparency, and efficiency. However, it also comes with challenges such as scalability issues and energy consumption. This presentation provides an in-depth analysis of the key benefits and drawbacks of blockchain, helping you understand its potential impact on the future of technology and business.
Mastering OnlyFans Clone App Development: Key Strategies for SuccessDavid Wilson
Dive into the critical elements of OnlyFans clone app development, from understanding user needs and designing engaging platforms to implementing robust monetization strategies and ensuring scalability. Discover how RichestSoft can guide you through the development process, offering expert insights and proven strategies to help you succeed in the competitive market of content monetization.
Integrating Kafka with MuleSoft 4 and usecaseshyamraj55
In this slides, the speaker shares their experiences in the IT industry, focusing on the integration of Apache Kafka with MuleSoft. They start by providing an overview of Kafka, detailing its pub-sub model, its ability to handle large volumes of data, and its role in real-time data pipelines and analytics. The speaker then explains Kafka's architecture, covering topics such as partitions, producers, consumers, brokers, and replication.
The discussion moves on to Kafka connector operations within MuleSoft, including publish, consume, commit, and seek, which are demonstrated in a practical demo. The speaker also emphasizes important design considerations like connector configuration, flow design, topic management, consumer group management, offset management, and logging. The session wraps up with a Q&A segment where various Kafka-related queries are addressed.
Uncharted Together- Navigating AI's New Frontiers in LibrariesBrian Pichman
Journey into the heart of innovation where the collaborative spirit between information professionals, technologists, and researchers illuminates the path forward through AI's uncharted territories. This opening keynote celebrates the unique potential of special libraries to spearhead AI-driven transformations. Join Brian Pichman as we saddle up to ride into the history of Artificial Intelligence, how its evolved over the years, and how its transforming today's frontiers. We will explore a variety of tools and strategies that leverage AI including some new ideas that may enhance cataloging, unlock personalized user experiences, or pioneer new ways to access specialized research. As with any frontier exploration, we will confront shared ethical challenges and explore how joint efforts can not only navigate but also shape AI's impact on equitable access and information integrity in special libraries. For the remainder of the conference, we will equip you with a "digital compass" where you can submit ideas and thoughts of what you've learned in sessions for a final reveal in the closing keynote.
In Deloitte's latest article, discover the impact of India's
three new criminal laws, effective July 1, 2024. These laws, replacing the IPC,
CrPC, and Indian Evidence Act, promise a more contemporary, concise, and
accessible legal framework, enhancing forensic investigations and aligning with
current societal needs.
Learn how these Three New Criminal Laws will shape the
future of criminal justice in India
Read More Deloitte India's Latest Article on Three New
Criminal Laws
https://www2.deloitte.com/in/en/pages/finance/articles/three-new-criminal-laws-in-India.html
El análisis del Patch Tuesday de Ivanti va más allá de la aplicación de parches a sus aplicaciones y le ofrece la inteligencia y orientación necesarias para priorizar dónde debes enfocarte. Consulta los últimos análisis en nuestro blog Ivanti y únete a los expertos del sector en el webinar de Patch Tuesday. En él profundizaremos en cada uno de los informes y ofreceremos orientación sobre los riesgos asociados a las vulnerabilidades más recientes.
"Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes...Anant Gupta
Discover the art of graphic design with our comprehensive guide tailored for both beginners and seasoned professionals. Learn essential tips and tricks, explore the best design tools and software, and get inspired by creative design ideas. Whether you're just starting out or looking to refine your skills, this guide has everything you need to master the world of graphic design. Dive into topics ranging from basic principles to advanced techniques and stay ahead in the ever-evolving design industry.
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfNeo4j
Presented at Gartner Data & Analytics, London Maty 2024. BT Group has used the Neo4j Graph Database to enable impressive digital transformation programs over the last 6 years. By re-imagining their operational support systems to adopt self-serve and data lead principles they have substantially reduced the number of applications and complexity of their operations. The result has been a substantial reduction in risk and costs while improving time to value, innovation, and process automation. Join this session to hear their story, the lessons they learned along the way and how their future innovation plans include the exploration of uses of EKG + Generative AI.
Data Integration Basics: Merging & Joining DataSafe Software
Are you tired of dealing with data trapped in silos? Join our upcoming webinar to learn how to efficiently merge and join disparate datasets, transforming your data integration capabilities. This webinar is designed to empower you with the knowledge and skills needed to efficiently integrate data from various sources, allowing you to draw more value from your data.
With FME, merging and joining different types of data—whether it’s spreadsheets, databases, or spatial data—becomes a straightforward process. Our expert presenters will guide you through the essential techniques and best practices.
In this webinar, you will learn:
- Which transformers work best for your specific data types.
- How to merge attributes from multiple datasets into a single output.
- Techniques to automate these processes for greater efficiency.
Don’t miss out on this opportunity to enhance your data integration skills. By the end of this webinar, you’ll have the confidence to break down data silos and integrate your data seamlessly, boosting your productivity and the value of your data.
Using LLM Agents with Llama 3, LangGraph and MilvusZilliz
RAG systems are talked about in detail, but usually stick to the basics. In this talk, Stephen will show you how to build an Agentic RAG System using Langchain and Milvus.
Tailored CRM Software Development for Enhanced Customer InsightsSynapseIndia
Gain deeper customer insights with our tailored CRM Software Development services. Our customized solutions help you understand customer behavior, preferences, and needs. Utilize our expertise to develop CRM systems that enhance customer engagement and support data-driven decision-making.
14. What’s slow in JavaScript?
1. The DOM
2. Function calls
3. Lookups
15. DOM manipulation
// Create the element in memory
var el = document.createElement('p');
// Insert the element into the DOM
document.body.appendChild(el);
17. DOM manipulation
var div = document.createElement('div'),
p = document.createElement('p');
// Bad
document.body.appendChild(div);
div.appendChild(p);
18. DOM manipulation
var div = document.createElement('div'),
p = document.createElement('p');
// Better
div.appendChild(p);
document.body.appendChild(div);
20. DOM manipulation
var p = document.createElement('p'),
i = 4;
while (i--) { // Add four <p> elements
document.body.appendChild(p.cloneNode(false));
}
21. DOM manipulation
var frag = document.createDocumentFragment(),
p = document.createElement('p'),
i = 4;
while (i--) { // Add four <p> elements
frag.appendChild(p.cloneNode(false));
}
document.body.appendChild(frag);
22. Function calls
// Function declaration
function foo(bar) {
return bar;
}
// Function call
foo('something');
59. Avoid switch
switch(foo) {
case 'alpha':
// do X
break;
case 'beta':
// do Y
break;
default:
// do Z
break;
}
60. Avoid switch
var switchObj = {
'alpha': function() {
// do X
},
'beta': function() {
// do Y
},
'_default': function() {
// do Z
}
};
(switchObj.hasOwnProperty(foo) && switchObj[foo] || switchObj._default)(args);
61. Don’t use jQuery for everything
$('.foo').click(function() {
$(this).prop('id');
// same as this, before jQuery 1.6:
// $(this).attr('id');
// also `href`, `checked`, `value`…
});
62. Don’t use jQuery for everything
$('.foo').click(function() {
this.id;
this.href;
this.checked;
this.value;
// etc.
});
67. jQuery document ready
(function() {
// move <script>s to the bottom
// and just use an IIFE*
}());
// * unless you use .appendChild() / .innerHTML on document.documentElement or document.body: http://mths.be/ieoa