Skip to content

Commit 79e346a

Browse files
committed
2 parents 3580f8e + df6cbdb commit 79e346a

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

docs/src/developers/style.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Styling protocol
22

3-
Ana Ernst & Alejandro Morales
4-
Centre for Crop Systems Analysis - Wageningen University
3+
Ana Ernst & Alejandro Morales
4+
Centre for Crop Systems Analysis - Wageningen University
55

66
A styling protocol is essential for code readability, consistency, and maintainability. It ensures that code follows predefined formatting rules, prevents errors, and suggests best practices for overall quality of the code. This type of protocol not only plays a crucial role in code quality but also when it comes to collaboration and long-term software project success.
77

@@ -25,18 +25,19 @@ This section outlines programming guidelines and best practices to ensure the qu
2525
* Define accessor for all fields and document these rather than the fields themselves
2626
Accessors provides controlled access to data is important as it allows for future changes to the internal structure without affecting users that rely on accessors.
2727
*For example, in the [tutorial](https://virtualplantlab.com/stable/tutorials/Tree/Tree/) to build the representation of a 3D binary tree, we can set accessor functions as it follows*
28-
````julia
29-
module TreeTypes
30-
import VirtualPlantLab
31-
# ... (previously defined types)
32-
# Accessor functions for treeparams parameters
33-
# Accessor for growth parameter
34-
function get_growth(params::treeparams)
35-
return params.growth
36-
end
37-
# ... (other previously defined functions)
38-
end
39-
````
28+
29+
````julia
30+
module TreeTypes
31+
import VirtualPlantLab
32+
# ... (previously defined types)
33+
# Accessor functions for treeparams parameters
34+
# Accessor for growth parameter
35+
function get_growth(params::treeparams)
36+
return params.growth
37+
end
38+
# ... (other previously defined functions)
39+
end
40+
````
4041

4142
## General style
4243

0 commit comments

Comments
 (0)