Skip to content

Coding Standards Document

Farai edited this page Jun 6, 2022 · 2 revisions

Coding Standards and Practices

1.Introduction

The following document will explore the various standards and practices that are meant to be followed by the CapsOn team whilst developing the TutorMe application. We will use Prettier with a .prettierrc file to standardize everybody’s environment. This will be enforced using the Prettier extension for VSCode, which will be the IDE of choice for the team

2.Naming convention and Standards

2.1 Variables names should be descriptive

const nameToEdit = " Carol Timith"; ✔️ const temp = " Carol Timith";❌

2.2 Variable names should not be abbreviated

Tutee tutee = Tutee();✔️ Tutee tt = Tutee();❌

2.3 Use Camel casing for variables and method parameters

final screenHeightSize = MediaQuery.of(context).size.height; SizedBox(height: screenHeightSize),

2.4 Use Camel casing for method names

void search(String search) {

2.5 Use Pascal casing for class names

class TutorProfilePageView extends StatefulWidget {}

3.Naming convention and Standards

  • Use snake_case for ALL file names
  • All controllers, services and configuration files should each be in their own standalone files.

4.Indentation and Spacing Conventions and Standards

  • Use TAB for indentation. NEVER USE SPACES
  • Tab size will be set to 2
  • Methods with 4 or more parameters should have each parameter in its own line
builder: (BuildContext context) => TutorProfilePageView(
                person: tutorList[i].getFirstName,
                bio: tutorList[i].getBio,
                age: tutorList[i].getAge.toString(),
                location: tutorList[i].getLocation,
                gender: tutorList[i].getInstitution) 

5.UI Styling

  • All our apps color themes will all be stored in in one “colorpallete.dart” file for ease of change of theme.