Writing about the craft of software

Notes on Unix, Python, databases, design, and building useful systems.

Take some lines

Do you ever want to take some lines from the middle of a file say, lines 300-400? You can do that in a kludgey way with Unix head and tail: cat ids.csv | head -400 | tail -100 The take command from vbin tools does just that. cat ids.csv |take 300 400 Here we…

Command Line, SQL, Unix

Read article →

MVC is Overrated

The Model-View-Controller Pattern ( MVC ) is not the only game in town. In fact it is awkward and cumbersome in some cases. MVC is a D esign Pattern , and Design Patterns show us how to solve common problems with common solutions. However we should not just…

Design, Elegance, MVC

Read article →

What is in a Name?

What should we call it? Call it whatever you like. I hear that a lot. As coders and builders of systems, we should take the time needed to come up with the best names for the systems , databases , tables , columns , filenames , modules , classes , methods …

Design, Elegance

Read article →

Stitch in Time

A stitch in time saves nine, is a fundamental principals we should use to write code and build systems. It might be said, a stitch in time saves you from being stuck forever with unruly software. People just want to get the job done. But any small mistake or…

Design, Elegance

Read article →

csv as a database table

CSV files can be used on the Unix command line like database tables. grep can act as a where-clause, and awk can be used as column selector. However the csv utility from vbin makes it easier. Here it is. $csv -p books.csv id, isbn, name, publicated, type 1…

Command Line, csv, database, Unix

Read article →

grep '^$'

That's wizardry for you. How many times have you typed grep '^$' ? Do you grep ? grep, the Unix command that searches files for patterns, is one of the most useful Unix utilities. This example here grep '^$' passes a regular expression with two characters: a…

Command Line, Unix

Read article →

False Optimization

So often I hear tech folks talking about some implementation as being better than another because "It is more efficient ". Efficient? Efficient for who? The computer? Are we shaving milliseconds off processing time? That's ridiculous. We should be in the…

Design, Elegance

Read article →

PHP vs Python

$What is $easier to $read? {A $document of $commands in a $pseudo $English $language $strewed with ($dollar $sign $symbols ($$), $French $Braces ({), and $semi-colons)? Or a $document $without all $that?} What is easier to read? A document of commands in a…

Elegance, PHP, Python

Read article →

sav, savdiff, and unsav

vbin has a very useful command called sav . You always need to make a backup copy of a file before messing with it. A simple $ cp book.xml -p book.xml.sav will do. The -p preserves the original date and ownership of the file. sav does this for you. In other…

Command Line, Unix

Read article →

Introducing vbin

vbin is a collection of very useful Unix Bash utilities. Available on github: https://github.com/dlink/vbin It is easy to install - See instructions in the README

Command Line, Unix

Read article →