PHP is one of the easiest programming languages to use ever and powers more than half of the internet. With this ease of use, certain common patterns emerge that become harmful. This is especially true when your product or service is not expected to die soon. Some anti-patterns are coding, others are related to operating your service, especially with new docker stacks. We will go over some of the most common pitfalls with a focus on enterprise development.
Fine-tuning your development environment means more than just getting your editor set up just so -- it means finding and setting up a variety of tools to take care of the mundane housekeeping chores that you have to do -- so you have more time to program, of course! I'll share the benefits of a number of yak shaving expeditions, including using App::GitGot to batch manage _all_ your git repos, App::MiseEnPlace to automate getting things _just_ so in your working environment, and a few others as time allows. Delivered at OpenWest 2016, 13 July 2016
Automated tests are pieces of code that execute other code to verify outputs without manual testing. There are unit, integration and acceptance tests. Programmers are the worst testers of their own code so automated testing allows code to be tested and refactored more easily. Code without automated tests is just a rumor rather than a real feature. Test code is also production code so it is important to show code, not just talk about it. Automated testing makes developers out of programmers.
The document discusses test-driven development (TDD) and behavior-driven development (BDD). It explains that BDD uses external specifications to describe behavior before coding starts. This solves issues with TDD like where to begin and what to test. BDD uses a double cycle of writing scenarios in Behat and then examples in Phpspec at the internal class level. Phpspec is used to describe behavior through examples before coding classes. The document provides instructions on installing Phpspec and describes how to define a specification and examples.
The document discusses several reasons for the importance of Java, including that Java applications can run on any system due to the Java virtual machine, Java has strong IDE support to help developers, and Java is used widely in areas like Android and enterprise applications. Specifically, it notes that Java's virtual machine allows applications to run the same on all processors and operating systems, Java IDEs like Eclipse make development easier, and Java is commonly used for Android development and for integrating with other systems through APIs.
The document discusses common myths about the Symfony framework and attempts to dispel them. It addresses claims that Symfony is hard to learn, extremely coupled, not really programming but just configuration, restrictive, and badly performing. For each myth, counterarguments are provided explaining why Symfony is in fact easy to learn through documentation and community support, has become decoupled over time, allows for significant programming through controllers and custom code, is flexible through configuration, and can be optimized for performance.
The document discusses an Android developer's experiences using OpenCV for image processing tasks in Android applications. It mentions using OpenCV for tasks like converting between RGB and YUV color spaces, applying filters like Laplacian, and chaining or running tasks in parallel. OpenCV provides high performance image processing and avoids issues with fragmentation in the Android camera APIs. Examples are given of using OpenCV to record video and do face detection.
The document discusses common myths about the Symfony framework. It addresses criticisms that Symfony is hard to learn, extremely coupled, focuses only on configuration rather than programming, is restrictive, performs poorly, and claims it is the ultimate tool. For each myth, the document provides counter arguments explaining why Symfony is easy to learn with documentation and community support, has become less coupled over time, involves significant programming beyond just configuration, and allows for flexibility and customization. It also notes performance depends on caching and configuration choices.
Ho to use Groovy and Spock framework for testing Java projects. Examples of using Storm testing facility.
BDD + PHP = Behat Behavior Driven Development (BDD) is a technique for testing and developing software using an agile approach. Behat is a BDD testing tool for PHP that allows writing tests in a natural language format called features. Behat tests in PHP look like scenarios written in plain English with structured keywords.
Composer allows PHP developers to declare and manage dependencies of PHP packages and libraries. It provides tools for installing, updating, and managing dependencies of PHP applications and packages. The document discusses how to use Composer to declare dependencies in a composer.json file, install dependencies, publish your own packages, and consume packages published by other developers. It highlights benefits like dependency management, autoloading, and keeping dependencies updated.
Ideas and techniques for using a REPL in general and pry specificially, to improve your development workflow and solve problems faster.
Continuous Integration (CI) is a software development practice where developers regularly merge their work into a central repository. This allows for automated builds and tests which catch errors early. CI helps reduce integration problems, improves code quality, and allows for more frequent deployments. The document discusses implementing CI with tools like Jenkins, build scripts, unit testing, code analysis, and notifications to improve the development process.
This document discusses lessons learned from apps that performed better than Titanium apps in terms of cross-platform concerns, memory management, slow initialization times, multiple contexts, and code structure. It provides solutions for each problem area, such as not aiming for 100% code reuse across platforms, planning for platform differences, closing windows and nulling references to help Titanium cleanup memory, deferring script loading, avoiding multiple contexts, and building a suite of custom components for code structure. The document concludes with a demo and code walkthrough.
Behat is a tool that makes behavior driven development (BDD) possible. With BDD, you write human-readable stories that describe the behavior of your Drupal site. These stories can then be auto-tested against your website, whether in the midst of development, or on a live site. And yes, it’s as cool as it sounds! Behat, if embraced by enough Drupal folks, has the potential to vastly improve the way we build and test Drupal websites. Testing language can be developed by module maintainers, and allow nearly codefree testing to be developed by everyone, as needed, per site. Behat IS NOT unit testing nor a specification testing tool. Behat is a Scenario-oriented BDD framework with functional testing capabilities as part of a communication process between stake-holders and developers. Think Agile User Stories meets Selenium. Behat is currently used to test Drupal.org, allowing a variety of coders to work on a single site, and ensure that no existing functionality will break as they add new features. Or as it's migrated from one version to another. Imagine that on your site. We will review Behat (and Mink, and related code), how to use it with Drupal, Drush, and the existing modules/code to support that. We will demo live testing, and so how easy it is to write tests, with and without code.
This document introduces Behavior Driven Development (BDD) and Behat, a tool that implements BDD for PHP projects. BDD works by writing feature descriptions, or stories, in a simple language anyone can understand before writing any code. Behat uses the Gherkin syntax to write stories. It provides a six step process to write and test stories through the creation of feature files, object definitions, step definitions, and running tests. Stories are written from the outside-in, focusing development on key business requirements and keeping code simple.
Scriptcs is an open source project that enables a rich C# scripting experience. It allows users to script and execute C# code or use a REPL without needing compilation, projects, or solutions. Scriptcs uses a relaxed C# syntax and provides features like loading scripts and assemblies through directives. It aims to provide a simpler scripting workflow compared to a typical C# development experience that requires setting up projects in an IDE. Scriptcs code can be distributed easily and run on any machine with the scriptcs CLI installed. The documentation provides demonstrations of key scriptcs features and how to extend it through script packs and modules.
Node & Express as Workflow Tools “Enterprise” and “Node.js” are generally two terms which are rarely seen together, but developing on an (what are considered) “enterprise level” stack doesn’t mean you can’t sneak some Node.js into your workflow. This talk will cover using Node.js, Express, Grunt/Gulp, Commander to build custom workflow tools, mock APIs, and test suites to allow you to maintain sanity while working with more traditional environments. We will cover a simple use case for using Node and Express to smooth Front-end development workflow, and how to package your custom tool as an NPM module for others to install. Presented live at FITC's Spotlight: MEAN Stacks event held on March 28th, 2014 More info at FITC.ca
A workshop held in StartIT as part of Catena Media learning sessions. We aim to dispel the notion that large PHP applications tend to be sluggish, resource-intensive and slow compared to what the likes of Python, Erlang or even Node can do. The issue is not with optimising PHP internals - it's the lack of proper introspection tools and getting them into our every day workflow that counts! In this workshop we will talk about our struggles with whipping PHP Applications into shape, as well as work together on some of the more interesting examples of CPU or IO drain.
We aim to dispel the notion that large PHP applications tend to be sluggish, resource-intensive and slow compared to what the likes of Python, Erlang or even Node can do. The issue is not with optimising PHP internals - it's the lack of proper introspection tools and getting them into our every day workflow that counts! In this workshop we will talk about our struggles with whipping PHP Applications into shape, as well as work together on some of the more interesting examples of CPU or IO drain.
The document discusses 10 code anti-patterns that developers should avoid in software development. These anti-patterns include: 1) The Golden Hammer where the same solution is used for different problems, 2) Spaghetti Code which is messy and unorganized, 3) Reinventing the Wheel by creating custom solutions instead of using existing libraries, 4) Dependency Hell which occurs when too many third-party libraries are imported, 5) God Classes that have too many responsibilities, 6) Hard Coding values instead of externalizing them, 7) Boat Anchor code that is written but not needed, 8) Lava Flow legacy code that is risky to change, 9) Copy-Paste Programming without reviewing code, and 10) Cargo Cult Programming
Conférence présentée lors du summer meetup de l'AFUP à Limoges le 19 juin 2018. Son objectif est de présenter plusieurs outils permettant de gagner rapidement en efficacité au quotidien.
This document discusses 12 tricks hackers use to compromise continuous integration and continuous delivery (CI/CD) systems. It outlines attacks such as installing malware via libraries, leaking secrets, executing malicious code in pipelines, consuming cloud services to cause outages, zip bombs, memory bombs, fork bombs, and compromising APIs. The document emphasizes the importance of limiting permissions, monitoring systems, and assuming insider attackers when hardening CI/CD pipelines and infrastructure.
My presentation on 'Enterprise PHP' at the PHP London Conference 2008 (http://www.phpconference.co.uk)
The document discusses the goals and development of an online dictionary application being built by three developers called the Giraffes. It aims to provide dictionary functionality through the cloud to replace installed software and reduce disk space usage. The application displays dictionary results for selected text within the browser using JavaScript. Future plans include browser extensions, additional dictionaries, language support, and APIs for other developers and users to integrate new dictionaries.
* What is boilerplate? * Common setup steps * Common build steps * Practices to ensure efficient development * Tools * Python demo
This document provides an overview of building mobile applications using PhoneGap. It discusses how PhoneGap works by instantiating a chromeless browser and implementing a bridge to allow calling native device APIs from JavaScript. It also covers topics like plugins, debugging mobile apps, performance considerations, and the PhoneGap API for accessing device features like the camera, contacts, and geolocation. The document advocates for a mobile-first approach using modern web standards and technologies when building apps with PhoneGap.
This document discusses the journey of transitioning infrastructure management at Namecheap to an immutable infrastructure as code model using tools like Terraform, Docker, and Jenkins. Key points include taking over a project from an outsourcing company, setting up immutable infrastructure with infrastructure as code, configuring CI/CD pipelines as code in Jenkins, and lessons learned around testing, chaos engineering, and encouraging team feedback. The overall goals were to make infrastructure hard to break, easy to repair, and easy to modify.
DevOps aims to automate the process between software development and IT operations. This includes continuous integration, continuous delivery, and infrastructure management. The document discusses definitions of DevOps, tools for source control, continuous integration, deployment, testing, monitoring and containers/orchestration. It emphasizes creating automation to reduce errors and speed up development cycles. Automation should be implemented gradually by focusing on the most painful manual tasks each sprint.
This document discusses compilers and their capabilities. It notes that compilers support multiple languages as inputs and targets, can perform many optimizations, and include tools to help developers write better code. Modern compilers are highly customizable and include sanitizers to detect bugs and undefined behavior at runtime. The document emphasizes that compilers are complex programs that can outperform attempts by developers to manually optimize code.
This document discusses strategies for modernizing front-end codebases in an incremental way. It suggests starting with basic modularization by splitting code into logical chunks, then concatenating and minifying modules. Next steps include loading modules on demand using various module systems. Graceful deprecation is recommended over breaking changes. The document also advocates trying new frameworks on side projects first before adopting one. Maintaining good development practices like testing, linting, code style rules and performance testing is emphasized over choosing any particular framework.