Opened 6 months ago

Last modified 5 weeks ago

#29219 new defect

Write (more) guidelines for Tor coding best practices

Reported by: nickm Owned by:
Priority: Medium Milestone: Tor: 0.4.2.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: doc, ex-catalyst-20190619
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 (7)

comment:1 Changed 4 months ago by nickm

Milestone: Tor: 0.4.1.x-final

comment:2 Changed 2 months ago by nickm

Keywords: doc added

Mark a few documentation tickets as "doc"

comment:3 Changed 2 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 7 weeks ago by catalyst

Owner: set to catalyst
Status: newassigned

comment:5 Changed 6 weeks ago by catalyst

Status: assignednew

comment:6 Changed 5 weeks 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 5 weeks ago by catalyst

Status: assignednew
Note: See TracTickets for help on using tickets.