This document discusses principles of software craftsmanship including: - Common JavaScript pitfalls like implied globals, trailing commas, and return undefined - Best practices like avoiding globals, using module patterns for organization, and test-driven development - Tools for JavaScript development like Jasmine for testing, RequireJS for module loading, and Visual Studio for debugging - The process of test-driven development including writing tests, making them fail, making them pass, refactoring code, and repeating
This document provides an overview of writing clean code, focusing on readability, code style, naming conventions, code comments, control structures, functions/methods, classes, and modules. Key points include formatting code for readability, using explicit and descriptive naming, minimizing comments by ensuring code is self-explanatory, limiting nested control structures and side effects, following single responsibility and encapsulation principles, and leveraging software patterns.
The document provides an overview of learning bottom up JavaScript, including the key things it will cover: the JavaScript language, Document Object Model (DOM), how JS and DOM cooperate, libraries, development tools, and resources. It describes the main aspects of JavaScript like being dynamic, weakly typed, prototype-based, and using first-class functions. It also explains the three main things done with JS: attaching event listeners, getting/modifying data, and updating the page.
An introduction to Javascript, highlighting some of it's good and bad language design. This talk was part of the webcon 2014.
Type systems are not just syntax checkers, but are intended to prevent execution errors by catching type errors. Static typing catches errors at compile-time rather than run-time, as demonstrated by examples in Ruby and C#. While static typing can seem bureaucratic in some languages, it enables type inference and other "smart" features in languages like Haskell. Both static and dynamic typing are flexible depending on the language, as dynamic languages allow for eval and meta-programming while static languages have reflection and templates. Overall, typing influences language design and tools but flexible features depend more on the language's meta-model, while static languages can feel bureaucratic due to historical reasons rather than limitations of the typing model.
The document provides an overview of fundamental JavaScript concepts such as variables, data types, operators, control structures, functions, and objects. It also covers DOM manipulation and interacting with HTML elements. Code examples are provided to demonstrate JavaScript syntax and how to define and call functions, work with arrays and objects, and select and modify elements of a web page.
This document discusses JavaScript functions and objects. It explains that functions can return values, run code, and construct objects. It also discusses creating user-defined and built-in objects, accessing and adding properties, and inheritance through the prototype chain. Functions are first-class citizens that can be stored in variables, passed as arguments, and returned from other functions.
Good and Bad Code The Broken Window Theory The Grand Redesign in the Sky The Sushi Chef Rule The Hotel Room Rule The Boy Scout Rule OOP Patterns and Principles SOLID Principles How to measure clean code? Tools
This document provides an introduction to JavaScript, covering topics such as: - What JavaScript is and its origins - How to set up the browser console and load scripts - Data types in JavaScript including numbers, strings, Booleans, objects, and more - Variables, operators, and comparisons - Logical flow and conditionals - Basic programming concepts like functions, events, and objects The document gives examples and explanations for JavaScript syntax and fundamentals to help newcomers get started with the language. It also outlines a simple task manager project as an introduction to building applications with JavaScript.
Max Ramos, Oracle Certified Professional & Associate Software Engineer of Orange and Bronze Software Labs, discusses the new syntax elements of Java 7. www.orangeandbronze.com
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.
The document discusses abstract syntax trees (ASTs) and parsing of code. It provides examples of parsing JavaScript code into tokens and then building a syntax tree. It also discusses common JavaScript parsers like Esprima and Acorn, and AST specifications like ESTree. Homomorphic parsing is shown where code and AST are equivalent. Common uses of ASTs include transpilation, linting, minification, and code transformation.
This document provides an overview and examples of several design patterns in object-oriented programming with PHP, including Strategy, Factory, Abstract Factory, Adapter, Singleton, Iterator, and Observer patterns. The Strategy pattern allows making decisions on different cases more easily by encapsulating varying implementations of an algorithm. The Factory pattern hides object creation logic and allows for polymorphic object instantiation. The Abstract Factory pattern ensures all created objects conform to a common interface. The Adapter pattern allows incompatible interfaces to work together by wrapping an object to fit expected interfaces. The Singleton pattern ensures only one instance of a class is created. The Iterator pattern provides a way to access elements of an object sequentially without exposing its underlying representation. The Observer pattern allows objects to publish
This document provides an overview of PHP and MySQL. It discusses key PHP elements like variables, arrays, conditional statements, and loops. It also covers PHP statements, naming variables, outputting values, performing calculations, working with arrays, conditional logic, and loops. The document then discusses connecting to and querying MySQL databases, and how to insert, update, delete data. It also covers building forms, getting form input, and basic file input/output in PHP.
This document summarizes new methods for exploiting ORM injections in Java applications. It begins with introductions to ORM, JPA, and common ORM libraries. It then outlines several exploitation techniques, including using special functions in EclipseLink and TopLink to call database functions, abusing string handling and quote processing in OpenJPA, and leveraging features in Hibernate and specific databases like string escaping, quoted strings, magic functions, and Unicode delimiters. Code examples and demonstrations are provided for most of the techniques.
The document summarizes the speaker's upcoming book tour stop at Powell's Books. It includes 3 topics the speaker will discuss: 1) Why capture/playback for testing is problematic and alternative approaches like model-based testing should be used instead. 2) That test-driven development (TDD) means test automation, and includes code examples of automating mouse input. 3) That the discussion will move on from talking about testing itself.
Slides from a tutorial I gave at ETech 2006. Notes to accompany these slides can be found here: http://simonwillison.net/static/2006/js-reintroduction-notes.html
Fancy is a JavaScript library that combines Underscore functions with functional programming concepts to allow for writing functional code in a more readable way. It constructs FancyArrays and FancyObjects from normal arrays and objects that allow chaining of Underscore functions. This functional approach to problems like evaluating poker hands avoids side effects, combines functions, and solves problems conceptually rather than using loops. While it may not implement all aspects of functional programming, Fancy emphasizes the use of functions and avoids state to make code more reusable, abstracted, and easier to write and extend.
This document discusses NoSQL databases and provides an overview of MongoDB and RavenDB. It begins with trends driving the adoption of NoSQL databases like increasing data sizes, more connectedness, and individualization. It then covers concepts like horizontal scaling, schema flexibility, and CAP theorem. Specific sections provide information on MongoDB's BSON format, CRUD operations, and MapReduce. For RavenDB, it discusses the developer, deployment, indexing, and HTTP API. It concludes with questions about table to document mapping and key/index strategies.
The document outlines an ETL project to extract data from an Excel room-plan file, transform it into a new structure and data types, and load it into a database. It discusses exporting the CSV file from Excel and issues with encoding and delimiter. It then describes using a Groovy script to parse the file and handle inconsistent data. Finally, it notes putting the objects into the database and addressing problems around data conversion and structure.
This document discusses different data modeling techniques for MongoDB including embedding documents, linking documents by ID, and handling many-to-many relationships. It provides code examples of saving documents, querying, and updating in MongoDB. It also briefly covers software testing strategies for MongoDB applications.
This document discusses ASP.NET MVC and provides code examples. It begins by explaining that ASP.NET MVC is a framework built on ASP.NET that implements the model-view-controller pattern. It then discusses routing and how requests are processed, showing how the controller accesses the model, which returns data to populate the view. Code examples of a model, controller, and view are also provided. The document aims to explain the basics of ASP.NET MVC through definitions, diagrams, and short code snippets.
INTERAKTIVE SLIDES: http://johanneshoppe.github.com/HTML5Security/ Sie kennen die bekannten Angriffsvektoren wie SQL-Injections oder XSS. Ihre Anwendung ist sicher. Ist Sie das wirklich? Auch wenn Sie in Ihrer Webanwendung kein HTML5 einsetzen, die Browser sind bereit! Kennen Sie alle neuen Markups? Haben Sie bereits die Potentiale von Cross Origin Requests, WebSockets oder Local Storage auf dem Radar? Lernen Sie neue Gefahrenpotentiale kennen, die durch die Unterstützung von HTML5 und dessen APIs entstanden sind.
This document discusses trends in Rich Internet Applications (RIAs) and cloud computing. It begins with definitions of key concepts like RIA, cloud computing models (IaaS, PaaS, SaaS), and discusses the combination of RIAs and cloud computing as the future of software. The document then covers RIA design patterns and best practices, including common interaction and presentation patterns. It concludes with reiterating that the combination of asynchronous JavaScript and XML (Ajax) with RIA patterns enables new just-in-time delivery of information to keep users engaged.
Typescript fundamentals document summarized in 3 sentences: The document discusses Typescript fundamentals including types, classes, interfaces, modules and how to use the Typescript compiler. It explains how Typescript adds type safety and compile time checking to JavaScript by using types for variables, parameters, returns and more. Examples are provided for many Typescript features and how they compile down to equivalent JavaScript.
This document provides an overview of an ES6 hackathon focusing on new features in ES6 including block scope, modules, destructuring, arrow functions, classes, template literals, internationalization, spread syntax, generators, sets, promises and more. Attendees will have 30 minutes to work on code challenges exploring these new ES6 features using resources like JSFiddle and TypeScript. The challenges involve updating functions to use new syntax like arrow functions, default parameters and object shorthand, satisfying class assertions, and improving outputs using template strings and internationalization.
This document discusses best practices for handling errors and callbacks in Node.js applications. It covers techniques like error delegation, exception handling, error-first callbacks, avoiding nested callbacks, and using control flow libraries. It also discusses deployment strategies like using screen, restarting crashed processes, and innovating with platforms like Joyent, Nodejitsu and Heroku.
This document discusses ECMAScript 2015 (ES2015), also known as ES6. It provides examples of new ES2015 features like arrow functions, template literals, classes, and modules. It also discusses how to set up a development environment to use ES2015, including transpiling code to ES5 using Babel, linting with Eslint, testing with Mocha, and generating coverage reports with Istanbul. The document emphasizes that while ES2015 is fun to explore, proper tooling like linting and testing is needed for serious development. It concludes by noting ES2015 marks a transition and thanks the audience.
This document discusses proven JavaScript best practices for writing better code. It covers topics like always using var to declare variables, avoiding eval(), using object literals instead of the Object constructor, preferring === over ==, ending statements with semicolons, and turning on strict mode. Each topic is demonstrated with examples of bad code and how to fix it. The document aims to help programmers structure their code properly and avoid common pitfalls in JavaScript.
The document discusses the beauty of JavaScript and its many features. It covers how JavaScript offers classless object-oriented programming and functional programming. It also discusses how JavaScript can run on both the client-side and server-side. The document provides examples of JavaScript syntax like variables, functions, objects, prototypes and more to demonstrate JavaScript's capabilities. It emphasizes that libraries help create abstractions and beautiful patterns in JavaScript code.
Workshop Good Practices in JavaScript. Regular Expressions. Scopes & Closures. Memory Leaks. Presentado por Ing. Mario García