Archive for February 23, 2016

Tuesday, February 23, 2016

Pain Free Constraints With Layout Anchors

Keith Harrison:

A frequent complaint with Auto Layout is how verbose and unreadable the syntax is for programmatically creating constraints. Fortunately iOS 9 has done a lot to improve things. Stack Views have removed the need for us to create many of the constraints in typical layouts. Overlooked by comparison, but just as useful, was the introduction of layout anchors and layout guides. From the Apple Auto Layout Guide […] I will look at layout guides another time but for now here are my notes on using layout anchors to create constraints in code without the pain.

Write Code That Is Easy to Delete

tef (via Buzz Andersen):

Every line of code written comes at a price: maintenance. To avoid paying for a lot of code, we build reusable software. The problem with code re-use is that it gets in the way of changing your mind later on.

[…]

If we see ‘lines of code’ as ‘lines spent’, then when we delete lines of code, we are lowering the cost of maintenance. Instead of building re-usable software, we should try to build disposable software.

logGen

Phil Holland (via Rich Trouton):

logGen can be used to detect what files have changed as a result of a configuration change or installing a package. It accomplishes this by utilizing a number of methods, but mostly using the modification date and a checksum of each file. Lists will be generated for files that are added, changed, or deleted, and will include only the directory if everything within it has been added, changed, or deleted. A number of directories are automatically ignored in the search including your home directory, temporary directories, network mounts, and non-root volumes.