Do you have any good advice/links to a set of coding standards or best practices to follow?

前端 未结 20 2234
再見小時候
再見小時候 2021-02-01 10:40

For those of us that have programmed enough I’m sure we have come across many different flavours of coding standards that you can use when it comes to programming.

e.g.

相关标签:
20条回答
  • 2021-02-01 11:10

    For C# I recommend Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries (2nd Edition) (Microsoft .NET Development Series).

    0 讨论(0)
  • 2021-02-01 11:11

    If you plan to introduce a code-formatting standard to an existing programming team, get input from each member of the team so they'll have "buy in" and be more likely to write code to that standard.

    Programming styles are as difficult to change as habits, and you'll have to accept that some people won't make their code 100% compliant 100% of the time. It would be worth your time to find (or write your own) pretty-printer program and periodically run all your code through it to enforce consistency. (I always felt uneasy when manually checking in source code changes that only consisted of formatting corrections for other peoples' code; I worried that others would label me a nitpicker.)

    0 讨论(0)
  • 2021-02-01 11:13

    Camel and pascal casing alone solves a lot of coding standard problems

    0 讨论(0)
  • 2021-02-01 11:16

    Coding standards are great. We've been using Lance Hunt's C# Coding Standards for .NET almost without modifications

    0 讨论(0)
  • 2021-02-01 11:18

    For Java and other C-family languages I recommend Sofware Monkey's coding standards (of course, since they're mine).

    In general, keep them simple, and provide examples and justification for every requirement.

    0 讨论(0)
  • 2021-02-01 11:21

    Very popular are Ellemtel rules for C++.

    0 讨论(0)
提交回复
热议问题