M4 is Good

So you’re about to type some­thing re­pet­itive for the 20th time are you? Wait!

Re­pe­ti­tion is bad:

  • It vastly in­creases the chance of ac­ci­dental mis­takes.
  • It wastes time.
  • It wastes space.
  • It vastly in­creases the chance of ac­cdental mis­takes.

Con­sider using m4 for your re­pet­itive text needs

m4 is avail­able on pretty much every system and is a pretty sweet macro sys­tem. Much nicer than cpp! For ex­ample, here’s the result of me m4-ing up my hledger journal file:

Be­fore:

01/05 * Dad money
    un­al­loc­ated  £650
    in­come:dad  -£650

01/06 * Shop­ping
    ex­penses:­food  £4.03
    budget:­food  -£4.03
    as­set­s:hand  -£4.03
    un­al­loc­ated  £4.03

01/08 * With­drawal
    as­set­s:hand  £40
    un­al­loc­ated  -£40

Af­ter:

01/05 * Dad money
    in­come_­from(dad, £650)

01/06 * Shop­ping
    cash_budget_spend(­food, £4.03)

01/08 * With­drawal
    cash_with­draw(£40)

So much sim­pler!

Use m4.

Date
Tags
m4, programing
Target Audience
Not you.
Epistemic Status
Totally unsubstantiated opinions.