A Comic from Things in Squares
Developer’s life without testing
Power of Composer packages
About Composer Packages
Composer packages makes maintaining your code easier. For example, you have a small library which is used in a few projects at the same time. You want to add a new feature or fix a bug.
You can go through all projects which are using the library and update them. But what if new update needs to add new dependencies? You should add them manually too. It will take too much time and chance to break something is very high.
Another way is to package the library in a Composer package and make it accessible somewhere across the Internet (you actually don’t need make it public). In this case you update the code, add required dependencies in config and release a new version. After that, you just go through projects and run a single command in their root directory:
composer update
This is much easier than the previous scenario.
Composer Basics
About Composer
Composer is a tool to manage dependencies in your project. With it you can search, install and remove external packages in your code just in few commands. It tracks information about updates and dependencies using centralized repositories (the largest is packagist.org).
PSR PHP naming standard
About PSR
PHP developers created many professional tools to make coding easier. One of them is PSR standard. This standard contains recommendations how to organize classes, interfaces and traits naming in your code.
PHP closures
About PHP closures
Generally PHP closures are constructions of an anonymous function (a function without a name) stored in variable. For example:
$records=someFunctionToGetAllRecords(); $getRecord = function($recNum)use($records){ return $records[$recNum]; } var_dump($getRecord(10)) //Will return a specified record from records array
Continue reading “PHP closures”
Subversion vs Git
About
Comparison Subversion vs Git can be interesting for a junior developer. Git and SVN both are version control systems (VCS). Their main purpose is to allow developer track project development progress. With VCS you can revert your project’s code to any version in the past. It’s extremely useful in bug fixing and new feature development.
There are many VCS and today I want to compare probably two most popular of them – Git and SVN.
XPath. Tips and tricks
About XPath
XPath is a way to locate elements on a web page – like CSS selectors, but more suitable in some cases. I use it selectors for web page scraping and testing.
Useful XPath selectors
Here is the list of XPath selector examples very useful for me:
Nightwatch – automatic website testing using Selenium server
About front-end website testing
Website integration tests are extremely useful for front-end development. Automatic website testing makes you sure that your website works properly, that you haven’t broken something working on recent updates. I write front-end integration tests using Selenium technology and Nightwatch (written in NodeJS) or JUnit (written in Java).
Continue reading “Nightwatch – automatic website testing using Selenium server”
Subversion. Tips and Tricks
About Subversion
Subversion (SVN) is centralized revision control version. That means you have one central server and many SVN clients installed on developer’s workstations. When a developer commits, code updates are sent to the server immediately (in contrast to Git, where commits stored in local repositories and pushed to the central repository manually).
Anyway SVN is very old and inflexible revision control system – it has many disadvantages comparing with Git. But it is used for some old projects and it can be useful to know some basic SVN commands.