summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-12-14 16:25:34 -0500
committerJune McEnroe <june@causal.agency>2018-12-14 16:25:34 -0500
commitf20b767fa3c125f2cf65a620bcfcdf8f2684ca0b (patch)
treee0a684e27d1a06e360a4433e7b1f7c6b0c8fb1fd
parentUse col -b to strip formatting (diff)
downloadsrc-f20b767fa3c125f2cf65a620bcfcdf8f2684ca0b.tar.gz
src-f20b767fa3c125f2cf65a620bcfcdf8f2684ca0b.zip
Add ULOC
Diffstat (limited to '')
-rw-r--r--004-uloc.764
-rw-r--r--Makefile1
2 files changed, 65 insertions, 0 deletions
diff --git a/004-uloc.7 b/004-uloc.7
new file mode 100644
index 00000000..909a0d1c
--- /dev/null
+++ b/004-uloc.7
@@ -0,0 +1,64 @@
+.Dd December 14, 2018
+.Dt ULOC 7
+.Os "Causal Agency"
+.
+.Sh NAME
+.Nm ULOC
+.Nd unique lines of code
+.
+.Sh DESCRIPTION
+There are many tools available
+which measure SLOC: source lines of code.
+These tools are strangely complex
+for what they intend to do,
+which is to estimate the relative sizes of projects.
+They perform some amount of parsing
+in order to discount comments in various languages,
+and for reasons unknown each format their ouput
+in some oddly encumbered way.
+.
+.Pp
+I propose a much simpler method
+of estimating relative sizes of projects:
+unique lines of code.
+ULOC can be calculated with standard tools as follows:
+.
+.Bd -literal -offset indent
+sort -u *.h *.c | wc -l
+.Ed
+.
+.Pp
+In my opinion,
+the number this produces
+should be a better estimate of
+the complexity of a project.
+Compared to SLOC,
+not only are blank lines discounted,
+but so are close-brace lines
+and other repetitive code
+such as common includes.
+On the other hand,
+ULOC counts comments,
+which require just as much maintenance
+as the code around them does,
+while avoiding inflating the result
+with license headers which appear in every file,
+for example.
+.
+.Pp
+It can also be amusing
+to read all of your code sorted alphabetically.
+.
+.Sh AUTHORS
+.An C. McEnroe Aq Mt june@causal.agency
+.
+.Pp
+This document is produced from
+.Xr mdoc 7
+source available from
+.Lk https://code.causal.agency/june/text.causal.agency "Code Toilet"
+.
+.Sh CAVEATS
+Estimates such as these
+should not be used for decision making
+as if they were data.
diff --git a/Makefile b/Makefile
index 8b50a0f8..2fd9b894 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@ WEBROOT = /usr/local/www/text.causal.agency
 TXTS += 001-make.txt
 TXTS += 002-writing-mdoc.txt
 TXTS += 003-pleasant-c.txt
+TXTS += 004-uloc.txt
 
 all: $(TXTS)