0% found this document useful (0 votes)
10 views

A2SV Python Track - Best Coding Practices

The document outlines best coding practices to enhance efficiency, reduce bugs, and improve readability. Key practices include meaningful naming, writing modular code, consistent indentation, and essential commenting. These practices are emphasized as important for both coding quality and impressing interviewers.

Uploaded by

remidan37
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

A2SV Python Track - Best Coding Practices

The document outlines best coding practices to enhance efficiency, reduce bugs, and improve readability. Key practices include meaningful naming, writing modular code, consistent indentation, and essential commenting. These practices are emphasized as important for both coding quality and impressing interviewers.

Uploaded by

remidan37
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Best Coding

Practices
Lecture Flow
● Why Best Practices?
● Meaningful Naming
● Writing Modular Code
● Consistent Indentation
● Essential Comments
● The Good the Bad and the Ugly
● For Interviews
Why Best Practices?
Why Best Practices?
● Do things faster
● Reduce bugs
● Concise code
● Readability
Meaningful Naming
Meaningful Naming
Bad Practice Good Practice
Meaningful Naming

1. Interviewers seriously care


2. Reduces ambiguity and bugs
3. Helps debugging and readability
Writing Modular Code
Writing Modular Code

Bad Good
Writing Modular Code
● Helps transiting from solution to code
● Helps seeing the commonalities between similar problems
● Interviewers seriously care
● Reduces bugs
● Helps debugging
● Reusable
Consistent Indentation
Consistent Indentation

Bad Practice Good Practice


Consistent Indentation

Bad Practice Good Practice


Consistent Indentation

Bad Practice Good Practice


Consistent Indentation

Bad Practice Good Practice


Consistent Indentation
● Increases code quality and readability
● Interviewers seriously care
● Reduces bugs
● Helps debugging
Essential Comments
Essential Comments
Essential Comments
● Helps understanding
● Shows your care to code quality
● Impresses the interviewer
The Good the Bad and the Ugly
The Good
The Bad
ThE Ugly.
A2SV Example - 1
A2SV Example - 1
Code example taken from G31 - Submission

Bad Practice Good Practice


A2SV Example - 2
A2SV Example - 2
Function Parameters
Quote of the day
““Any fool can write code that a computer can understand.
Good programmers write code that humans can
understand.”
– Martin Fowler

You might also like