var name length

So how short or how long variable length should be?

The basic rule: the further from its declaration that a name is used, the more descriptive the name must be.

go over c++

“What language do you think Go is trying to displace?

I don’t think of Go that way. We were writing C++ code before we did Go, so we definitely wanted not to write C++ code anymore.”
Russ Cox

!!!!!!! we definitely wanted not to write C++ code anymore !!!!!!!

To use the native C++ stdout << custom_typed_val they’ve broke the CORE IDEA of hierarchical classes (compare with symlinks into tree FS). Overload ‘operation <<' with friends.

In Go – type Stringer interface: strict with the core Go language concepts.

groff A5 page format

Change paper size to A5:
groff -man -Tpdf -dpaper=a5 -P-pa5 pq > pq-a5.pdf; open pq-a5.pdf

To A5 Landscape:
groff -man -Tpdf -dpaper=a5l -P-pa5 -P-l pq > pq-a5.pdf; open pq-a5.pdf

groff_out

Simple commands:

  • 1 letter
  • Fixed # of arguments

They are:

  • f – set font (by number)
  • m – set color
  • N,C,c – print glyph
  • t – print word (several glyphs)
  • H,h – move point horizontally
  • V,v – move point vertically
  • p – new page
  • n – new line

Graphics command:

  • Starts with D
  • 1-2 letter command follows D
  • Fixed or variable # of arguments

They are:

  • Dl – line
  • Da – arc
  • D~ – B-spline
  • Dc/DC – circle/with fill
  • De/DE – ellipse/with fill
  • Dp/DP – polygon/with fill
  • DFx – set color of x

Device control commands:

  • Starts with x
  • x followed by 1 letter or w_ord – ‘ord’ always truncated

They are:

  • xT/xF – set device/file name
  • xi – initialize device
  • xs – stop
  • xf – bind a font name to the number
  • xH – set character height
  • xr – resolution
  • xS – set slant
  • xX – set string as is to device

Example:


shell> echo "hell world" | groff -Z -T ps
x T ps
x res 72000 1 1
x init
p1
x font 5 TR
f5
s10000
V12000
H72000
thell
wh2500
tw
H96620
torld
n12000 0
x trailer
V792000
x stop