Nixers Book Club - Book #4: The Art of UNIX Programming - Community & Forums Related Discussions

Users browsing this thread: 1 Guest(s)
seninha
Long time nixers
Chapter 5 is about text files for data storage and text protocols.
In this chapter, as in the next ones, the author describes several case studies.
He also describes the metaformats for file formats, that is, their general syntax.
There are several metaformats, such as delimiter-separated values (as /etc/passwd), RFC 822, cookie jar, XML, etc.

He also describes some general conventions for the metaformats.

Quote:Do not allow the distinction between tab and whitespace to be significant.
This is a recipe for serious headaches when the tab settings on your users' editors are different; more generally, it's confusing to the eye. Using tab alone as a field separator is especially likely to cause problems; allowing any run of tabs and spaces to be a field separator, on the other hand, works well.

Well, I'm doing wrong then.
Both xprompt and xmenu, as well as other utilities of mine use tab as delimiter character and indentation character. I thought it was a good idea. Other people also had that idea. Tab as delimiter might be a good option for data serialization generated by a program for the user to read; but not when generate by the user for a program to parse. It's too late now, my programs already have this flaw. I will follow the other general conventions: support backslash escape sequences for nonprintable characters, use # as comments, etc.
As the book says, using tabs as delimiter was initially used in the beginning of the UNIX tradition (and survives in utilities like cut(1) and paste(1)).

Chapter 6 is about transparency, discoverability and maintainability in the design of programs.
The chapter has some studying cases, which include GUI KDE utilities and CLI utilities.

Quote:Discoverability is about reducing barriers to entry; transparency is about reducing the cost of living in the code.

The chapter explains about transparency and discoverability both for user interfaces and for code.
A transparent and discoverable UI is intuitive.
A transparent and discoverable code is maintainable.


Messages In This Thread
RE: Nixers Book Club - Book #4: The Art of UNIX Programming - by seninha - 22-05-2021, 09:24 AM