1. 11
  1.  

  2. 5

    As a NetBSD user and a follower of the Advanced Programming in the UNIX Environment, I am glad to see that; though, I am slightly disappointed it is not available as a manual page as in OpenBSD.

    EDIT: I particularly started to enjoy the definition of function as in

    int
    main(int argc, char *argv[])
    {
    	⋮
    }
    

    because a simple [1] egrep -nH '^main\>' *.c is enough to show me exactly where the function I am looking for is.

    [1]: I actually use a longer trick to find the file I want which that main definition:

    find $PWD -path '*/.git' -prune -o -type f -regextype egrep -regex '.*\.(c|h)(pp)?' -exec egrep -nH '^main\>' {} \+
    
    1. 2

      This is a good point actually. I always tend to use a search on the function name and then have to find which entry is the definition. Writing the return type a line above the function name actually gives a quick way to find the function location in codebases that use this style. Too bad I hated on this style because of the aesthetic or I would’ve realized on my own. :p

      1. 2

        Hi it comes under /usr/share/misc/style in install :)

        1. 3

          @jaypatelani, I saw that in your OpenGrok’s link.

          However, my point is about uniformity: the canonical point for UNIX documentation is man, and if afterboot(8) exists, why not style(9) as in OpenBSD—or, even better, style(7)?

          I like the style is available in the system. I am disappointed it is not in the man: to find it, one has to know it is here, or egrep / 'style', which is counterintuitive and I think it is never chosen over man -k.

          EDIT: Given that orders(7) exists, I am shocked style(7) doesn’t.

          However, I want to state that my opinion is: I really like the existence of it, and I like it very much: it helps a lot to read and find code, and I tried to push such coding style to few companies that I worked for, more than once.

          1. 1

            Okay.I will pass your suggestion to developers. :)

      2. 2

        Reminds me of one of my favorite man page BUGS entries, for indent(1), relevant to the coding style guide:

        BUGS

        indent has even more switches than ls(1).