Javascript Function Usage Patterns

In programming, patterns mostly apply to code design. However, patterns may also apply to usage of language specific functionality, either to ensure best practices or to avoid common issues. Patterns below focus on function usage patterns. Functions in JavaScript are of two types: Named functions: functions having a given name (e.g.: function functionName() {} ) […]

PHP 7 Object Properties Type Safety with Setters and Getters

PHP 7 introduces scalar type definitions: your function parameters can be of a given type, and function return type declarations ensuring your function will return results of a given data type. This can increase your code quality by enforcing a specific behaviour of your code, almost similar to how a strongly typed language does. However, […]

Useful JavaScript Frameworks and Libraries

This post presents a set of useful JavaScript frameworks and utilities, designed either for the browser or node.js. EnvyoJS Site: http://enyojs.com/ Documentation: http://enyojs.com/docs/2.4.0/ Description: An HTML5 based JavaScript framework, useful for creating cross platform web applications, “from phones and tablets to PCs and TVs”. BinaryJS Site: http://binaryjs.com/ Documentation: https://github.com/binaryjs/binaryjs/tree/master/doc Description: A WebSockets based JavaScript framework for transferring binary “data […]

Useful web ecosystem tools

Here are a couple of tools, useful for a web based ecosystem. Papetrailapp Site: https://papertrailapp.com/ Description: Web log management service. Librato Site: https://metrics.librato.com/about Description: Log metrics collection and visualisation service. Newrelic Site: http://newrelic.com/ Description: Web application profiling service (works well with PHP and Node.JS). Log4php Site: http://logging.apache.org/log4php/ Description: PHP logging framework – has a JS sibling, named log4js. Phing […]

JavaScript Object Creation Patterns Part 1

To continue the series on Object Oriented Patterns, here is the first entry covering JavaScript; focusing on Object Creation Patterns. Namespace Pattern JavaScript doesn’t support namespaces, however, to avoid naming collisions and reduce the number of global variables, namespaces can be emulated using the technique of creating a global object, and adding functionality and variables […]

Notes on PHP Design Patterns, Part 1: Generating Objects and Flexible Object Programming

Design patterns are streamlined solutions to common problems. They provide guidelines that can be translated into code. This entry will focus on patterns used for Generating Objects and Flexible Object Programming; presenting the problem, solution and basic examples. The structure relies on Matt Zandstra’s second edition of ‘PHP Objects, Patterns, and Practice‘, the ‘ZEND PHP […]