Opened 8 months ago

Last modified 4 days ago

#29219 new enhancement

Write (more) guidelines for Tor coding best practices

Reported by: nickm Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: doc, ex-catalyst-20190619, s31-docs, 042-deferred-20190918
Cc: catalyst Actual Points:
Parent ID: Points: 3
Reviewer: Sponsor: Sponsor31-can

Description

We should extend our best practices guidelines in doc/HACKING with all/most of the following:

  • Avoiding layer violations
  • Fewer levels of block nesting
  • Small functions
  • Small files
  • Few includes per file
  • Smaller state objects
  • Making new features compile-time optional modules
  • incremental implementation and testing
  • Fewer branches
  • Fewer callers/callees per function
  • "Leave it better than you find it"
  • Well-bounded modules
  • Fewer data dependencies

Some of these can be quantified; the ones that can be should have targets.

I'm putting an optimistically low time estimate on this one under the assumption that we will have only minimal debate. :)

Child Tickets

Change History (10)

comment:1 Changed 6 months ago by nickm

Milestone: Tor: 0.4.1.x-final

comment:2 Changed 4 months ago by nickm

Keywords: doc added

Mark a few documentation tickets as "doc"

comment:3 Changed 4 months ago by nickm

Milestone: Tor: 0.4.1.x-finalTor: 0.4.2.x-final

Move various s31 refactoring tasks to 0.4.2

comment:4 Changed 4 months ago by catalyst

Owner: set to catalyst
Status: newassigned

comment:5 Changed 3 months ago by catalyst

Status: assignednew

comment:6 Changed 3 months ago by catalyst

Cc: catalyst added
Keywords: ex-catalyst-20190619 added
Owner: catalyst deleted
Status: newassigned

Remove myself from tickets I'm not actively working on.

comment:7 Changed 3 months ago by catalyst

Status: assignednew

comment:8 Changed 2 weeks ago by nickm

Type: defectenhancement

Mark a number of current 0.4.2.x "defects" as "enhancements."

comment:9 Changed 12 days ago by nickm

Keywords: s31-docs added

comment:10 Changed 4 days ago by nickm

Keywords: 042-deferred-20190918 added
Milestone: Tor: 0.4.2.x-finalTor: unspecified

Deferring various tickets from 0.4.2 to Unspecified.

Note: See TracTickets for help on using tickets.