-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbest-practices.html
95 lines (94 loc) · 7.29 KB
/
best-practices.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Impact calculator</title>
<link rel="stylesheet" href="styles.css">
<link rel="icon" href="img/surf.svg" type="image/icon type">
</head>
<body>
<header class="header">
<nav class="navbar" aria-label="Main Navigation">
<ul class="nav-list">
<li><a href="index.html">Home</a></li>
<li><a href="impact-calculator.html">Impact Calculator</a></li>
<li><a href="best-practices.html">Best Practices</a></li>
</ul>
</nav>
</header>
<div class="scrollable-container">
<main>
<h1>Best Practices Guide</h1>
<section class="cards">
<div class="card">
<h2>Minimise Loops, Nesting, and Iterations</h2>
<p>Choose appropriate data structures and algorithms for your problem domain. Understanding their time and space complexities can greatly enhance code performance. Limit the use of loops, as they are processor-intensive; excessive looping can degrade performance. </p>
</div>
<div class="card">
<h2>Comment on Your Code</h2>
<p>Commenting your code effectively enhances understanding and aids in development, code reviews, deployments, and troubleshooting. Descriptive comments should complement well-designed code, providing insights into decisions and nuances. </p>
</div>
<div class="card">
<h2>Benchmarks and Performance Testing</h2>
<p>Use benchmarks and performance tests to identify and fix inefficiencies, such as bottlenecks. Do this by tracking resource utilisation, improving code review guidelines, automating tests and deployments, measuring performance via input/output operations, and assessing space and time complexity of algorithms and data structures. </p>
</div>
<div class="card">
<h2>Utilise Collaborative Code Reviews</h2>
<p>Collaborating on code traditionally involves passing versions back and forth, leading to inefficiencies and version control issues. A better approach is using Git, a version control system enabling simultaneous work on code. Git facilitates seamless merging of changes into a central repository, ensuring everyone works on the latest version. This improves code quality, facilitates knowledge sharing, and reduces the risks of code bugs. While conducting code reviews, encourage honest feedback and focus on team effort. </p>
</div>
<div class="card">
<h2>Regular Code Refactoring</h2>
<p>Refactoring involves restructuring code without altering its behavior to enhance readability, efficiency, maintainability, and to reduce the risk of bugs. To do this in the best way possible, write automated tests, make small, incremental changes, and document those changes. </p>
</div>
<div class="card">
<h2>Consider the Coding Language</h2>
<p>Understanding the nuances of programming languages is crucial, considering factors like syntax, data types, and multi-threading capabilities. Adopting a coding standard ensures consistency, readability, and maintainability of code. Popular standards like PEP 8 for Python and the Google Java Style Guide enhance code quality. </p>
</div>
<div class="card">
<h2>Other Small Tips</h2>
<p>Avoid unnecessary variable declarations, optimise database queries, reduce or eliminate code duplication, cache results, optimise network requests, and use asynchronous programming. </p>
</div>
<div class="card">
<h2>Make Sure Your Code Is Properly Structured</h2>
<p>Adding structure to your code and packages enhances efficiency and scalability, aiding in seamless implementation and version control management. Poor structure can lead to confusion, tedious debugging, and unnecessary refactoring. Good structure saves time by facilitating development, maintenance, and debugging processes. It includes proper formatting, dependency tracking, module organisation, and documentation. Choosing appropriate data structures and algorithms further improves code performance and efficiency.</p>
</div>
<div class="card">
<h2>Write Reusable and Repeatable Code</h2>
<p>Writing reusable and repeatable code improves code quality, security, and reliability. This involves considering code structure, templates, dynamic values, and Object-Oriented Programming (OOP) practices. Advocating for writing reusable code fosters efficiency and consistency in the Software Development Lifecycle (SDLC), ultimately enhancing the overall quality of the codebase.</p>
</div>
<div class="card">
<h2>Sources</h2>
<p>
<a href='https://dev.to/akashakki/10-tips-for-optimizing-your-code-efficiency-21ol'>10 tips for optimizing code efficiency</a><br>
<a href='https://stackify.com/7-steps-to-improve-code-quality'>7 steps to improve code quality</a><br>
<a href='https://www.cloudzero.com/blog/best-practices-for-efficient-code'>Best practices for efficient code</a><br>
<a href=https://www.datacamp.com/tutorial/coding-best-practices-and-guidelines'>Coding practices and guidelines</a></p>
</div>
</section>
</main>
<div class="about-section">
<h1>About Us</h1>
<section class="about-cards">
<div class="about-card">
<h2 class="card-header">Who are we?</h2>
<p><img src="img/university.svg" alt="University Icon"> We are six students of Computational Social Science at the University of Amsterdam. This website is our Digital Behavioural Change Intervention to incentivize researchers to practice more environmentally sustainable coding. </p>
</div>
<div class="about-card">
<h2 class="card-header">Our goals:</h2>
<p><img src="img/awareness.svg" alt="Awareness Icon"> Spread awareness</p>
<p><img src="img/target.svg" alt="Impact Icon"> Incenvitize more sustainable coding</p>
</div>
<div class="about-card">
<h2 class="card-header">Our collaborators:</h2>
<p style="display: flex; align-items: center; justify-content: center;">
<a href="https://uva.nl"><img src="img/uva.svg" alt="UvA Logo" style="width: 50px; height: auto; margin-right: 10px;"></a>
<a href="https://www.surf.nl"><img src="img/surf.svg" alt="SURF Logo" style="width: 80px; height: auto;"></a>
</p>
<p>We are in collaboration with SURF. This website aims to help SURF's interests, while following our program at the UvA.</p>
</div>
</section>
</div>
</div>
</body>
</html>