Hacker News new | past | comments | ask | show | jobs | submit login
Google's Shell Style Guide (googlecode.com)
5 points by seanp2k2 on Oct 31, 2014 | hide | past | favorite | 1 comment



I've been using the same already without knowing about this, but with a few exceptions. Most notably, I indent with tabs, because I can use a heredoc with tabs, i.e.

    hello() {
        cat <<-MSG
            Hello, world!
        MSG
    }
Here, I have tabs before "Hello, world!" and those are ignored by Bash. I also have tabs before MSG, i.e. I don't need to start the line with it, which would be pretty ugly. I understand the rationale about not using tabs, but I think tabs are needed for more readable code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: