Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#49, #50] Merge basic/intermediate/advanced in code quality #77

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions codeQuality/avoidShortcuts/basic/index.md

This file was deleted.

1 change: 0 additions & 1 deletion codeQuality/avoidShortcuts/basic/path.md

This file was deleted.

10 changes: 0 additions & 10 deletions codeQuality/avoidShortcuts/basic/text.md

This file was deleted.

5 changes: 0 additions & 5 deletions codeQuality/avoidShortcuts/intermediate/index.md

This file was deleted.

1 change: 0 additions & 1 deletion codeQuality/avoidShortcuts/intermediate/path.md

This file was deleted.

8 changes: 0 additions & 8 deletions codeQuality/avoidShortcuts/intermediate/text.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
This guideline is closely related to the <trigger for="modal:duplication-dry" trigger="click">DRY Principle<trigger>.

<modal title="**{{icon_preview}} DRY Principle**" id="modal:duplication-dry">
<include src="../../../../principles/dryPrinciple/unit-inElsewhere-asFlat.md" boilerplate />
<include src="../../../principles/dryPrinciple/unit-inElsewhere-asFlat.md" boilerplate />
</modal>

</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<panel header="{{ icon_Q_A }} Which oare unsafe practices?">
<panel header="{{ icon_Q_A }} Which are unsafe practices?">
<question>

Which of these are unsafe coding practices?
Expand Down
14 changes: 12 additions & 2 deletions codeQuality/avoidShortcuts/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
<div id="body">

<include src="introduction/unit-inParent-asPanel.md" boilerplate />
<include src="basic/container-inParent-asPanel.md" boilerplate />
<include src="intermediate/container-inParent-asPanel.md" boilerplate />
<include src="useDefaultBranch/unit-inParent-asPanel.md" boilerplate />
<include src="dontRecycleVarsOrParams/unit-inParent-asPanel.md" boilerplate />
<include src="avoidEmptyCatchBlocks/unit-inParent-asPanel.md" boilerplate />
<include src="deleteDeadCode/unit-inParent-asPanel.md" boilerplate />
<include src="minimiseVariableScope/unit-inParent-asPanel.md" boilerplate />
<include src="minimiseCodeDuplication/unit-inParent-asPanel.md" boilerplate />

</div>

<div id="extras">

<include src="exercises.md" />

</div>
5 changes: 0 additions & 5 deletions codeQuality/commentMinimally/basic/index.md

This file was deleted.

1 change: 0 additions & 1 deletion codeQuality/commentMinimally/basic/path.md

This file was deleted.

8 changes: 0 additions & 8 deletions codeQuality/commentMinimally/basic/text.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,7 @@ return (isLeftEndCorrect && isRightEndCorrect) || isSameSize;
</div>

<div id="extras">

<include src="exercises.md" />

</div>
5 changes: 0 additions & 5 deletions codeQuality/commentMinimally/intermediate/index.md

This file was deleted.

1 change: 0 additions & 1 deletion codeQuality/commentMinimally/intermediate/path.md

This file was deleted.

7 changes: 0 additions & 7 deletions codeQuality/commentMinimally/intermediate/text.md

This file was deleted.

5 changes: 3 additions & 2 deletions codeQuality/commentMinimally/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<div id="body">

<include src="introduction/unit-inParent-asPanel.md" boilerplate />
<include src="basic/container-inParent-asPanel.md" boilerplate />
<include src="intermediate/container-inParent-asPanel.md" boilerplate />
<include src="dontRepeatObvious/unit-inParent-asPanel.md" boilerplate />
<include src="writeToReader/unit-inParent-asPanel.md" boilerplate />
<include src="explainWhatWhyNotHow/unit-inParent-asPanel.md" boilerplate />

</div>
2 changes: 1 addition & 1 deletion codeQuality/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<frontmatter>
title: "Code Quality"
siteNav: mainNav.md
pageNav: 3
pageNav: 4
</frontmatter>

<include src="container-inPage-asFlat.md" boilerplate />
5 changes: 0 additions & 5 deletions codeQuality/maximiseReadability/advanced/index.md

This file was deleted.

1 change: 0 additions & 1 deletion codeQuality/maximiseReadability/advanced/path.md

This file was deleted.

7 changes: 0 additions & 7 deletions codeQuality/maximiseReadability/advanced/text.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@

In particular, avoid [_arrowhead_ style code](https://blog.codinghorror.com/flattening-arrow-code/).

<img src="{{baseUrl}}/codeQuality/maximiseReadability/basic/avoidDeepNesting/images/arrowheadStyle.png" width="500" />
<img src="{{baseUrl}}/codeQuality/maximiseReadability/avoidDeepNesting/images/arrowheadStyle.png" width="500" />
<p/>

<box>

{{ icon_example }} A real code example:

<div class="alt-java">
<include src="../../introduction/example-java.md" />
<include src="../introduction/example-java.md" />
</div>
<div class="alt-python">
<include src="../../introduction/example-python.md" />
<include src="../introduction/example-python.md" />
</div>

</box>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<panel header="{{ icon_exercise }} Exercises" expandable>
<include src="q-tick-trueFalse.md" />
<include src="q-tick-drawback.md" />
<include src="q-tick-saying.md" />
</panel>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<panel header="{{ icon_Q_A }} Drawbacks of prepature optimizations">
<panel header="{{ icon_Q_A }} Drawbacks of premature optimizations">
<question>

What are the drawbacks of trying to optimize code too soon?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ Note that **there are cases where optimizing takes priority over other things**
</div>

<div id="extras">

<include src="exercises.md" />

</div>
5 changes: 0 additions & 5 deletions codeQuality/maximiseReadability/basic/index.md

This file was deleted.

1 change: 0 additions & 1 deletion codeQuality/maximiseReadability/basic/path.md

This file was deleted.

11 changes: 0 additions & 11 deletions codeQuality/maximiseReadability/basic/text.md

This file was deleted.

5 changes: 0 additions & 5 deletions codeQuality/maximiseReadability/intermediate/index.md

This file was deleted.

1 change: 0 additions & 1 deletion codeQuality/maximiseReadability/intermediate/path.md

This file was deleted.

11 changes: 0 additions & 11 deletions codeQuality/maximiseReadability/intermediate/text.md

This file was deleted.

3 changes: 3 additions & 0 deletions codeQuality/maximiseReadability/slapHard/exercises.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<panel header="{{ icon_exercise }} Exercises" expandable>
<include src="q-tick-trueFalse.md" />
</panel>
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ displayResult();
</box>

<modal title="" id="modal:slap-abstraction">
<include src="../../../../designFundamentals/abstraction/what/unit-inElsewhere-asFlat.md" boilerplate/>
<include src="../../../designFundamentals/abstraction/what/unit-inElsewhere-asFlat.md" boilerplate/>
</modal>


</div>

<div id="extras">

<include src="exercises.md" />

</div>
14 changes: 11 additions & 3 deletions codeQuality/maximiseReadability/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
<div id="body">

<include src="introduction/unit-inParent-asPanel.md" boilerplate />
<include src="basic/container-inParent-asPanel.md" boilerplate />
<include src="intermediate/container-inParent-asPanel.md" boilerplate />
<include src="advanced/container-inParent-asPanel.md" boilerplate />
<include src="avoidLongMethods/unit-inParent-asPanel.md" boilerplate />
<include src="avoidDeepNesting/unit-inParent-asPanel.md" boilerplate />
<include src="avoidComplicatedExpressions/unit-inParent-asPanel.md" boilerplate />
<include src="avoidMagicNumbers/unit-inParent-asPanel.md" boilerplate />
<include src="makeCodeObvious/unit-inParent-asPanel.md" boilerplate />
<include src="structureCodeLogically/unit-inParent-asPanel.md" boilerplate />
<include src="dontTripReader/unit-inParent-asPanel.md" boilerplate />
<include src="practiceKISSing/unit-inParent-asPanel.md" boilerplate />
<include src="avoidPrematureOptimizations/unit-inParent-asPanel.md" boilerplate />
<include src="slapHard/unit-inParent-asPanel.md" boilerplate />
<include src="makeHappyPathProminent/unit-inParent-asPanel.md" boilerplate />

</div>
5 changes: 0 additions & 5 deletions codeQuality/nameWell/basic/index.md

This file was deleted.

1 change: 0 additions & 1 deletion codeQuality/nameWell/basic/path.md

This file was deleted.

8 changes: 0 additions & 8 deletions codeQuality/nameWell/basic/text.md

This file was deleted.

5 changes: 0 additions & 5 deletions codeQuality/nameWell/intermediate/index.md

This file was deleted.

1 change: 0 additions & 1 deletion codeQuality/nameWell/intermediate/path.md

This file was deleted.

9 changes: 0 additions & 9 deletions codeQuality/nameWell/intermediate/text.md

This file was deleted.

7 changes: 5 additions & 2 deletions codeQuality/nameWell/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<div id="body">

<include src="introduction/unit-inParent-asPanel.md" boilerplate />
<include src="basic/container-inParent-asPanel.md" boilerplate />
<include src="intermediate/container-inParent-asPanel.md" boilerplate />
<include src="nounsAndVerbsAsNames/unit-inParent-asPanel.md" boilerplate />
<include src="useStandardWords/unit-inParent-asPanel.md" boilerplate />
<include src="useNameExplain/unit-inParent-asPanel.md" boilerplate />
<include src="notTooLongNorShort/unit-inParent-asPanel.md" boilerplate />
<include src="avoidMisleadingNames/unit-inParent-asPanel.md" boilerplate />

</div>
35 changes: 25 additions & 10 deletions codeQuality/print.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,17 @@ title: "Code Quality [Printable]"
## Guideline: Maximise Readability

<include src="maximiseReadability/introduction/unit-inParent-asFlat-print.md" boilerplate />
<include src="maximiseReadability/basic/unit-inParent-asFlat-print.md" boilerplate />
<include src="maximiseReadability/intermediate/unit-inParent-asFlat-print.md" boilerplate />
<include src="maximiseReadability/advanced/unit-inParent-asFlat-print.md" boilerplate />
<include src="maximiseReadability/avoidComplicatedExpressions/unit-inParent-asFlat-print.md" boilerplate />
<include src="maximiseReadability/avoidDeepNesting/unit-inParent-asFlat-print.md" boilerplate />
<include src="maximiseReadability/avoidLongMethods/unit-inParent-asFlat-print.md" boilerplate />
<include src="maximiseReadability/avoidMagicNumbers/unit-inParent-asFlat-print.md" boilerplate />
<include src="maximiseReadability/avoidPrematureOptimizations/unit-inParent-asFlat-print.md" boilerplate />
<include src="maximiseReadability/dontTripReader/unit-inParent-asFlat-print.md" boilerplate />
<include src="maximiseReadability/makeCodeObvious/unit-inParent-asFlat-print.md" boilerplate />
<include src="maximiseReadability/makeHappyPathProminent/unit-inParent-asFlat-print.md" boilerplate />
<include src="maximiseReadability/practiceKISSing/unit-inParent-asFlat-print.md" boilerplate />
<include src="maximiseReadability/slapHard/unit-inParent-asFlat-print.md" boilerplate />
<include src="maximiseReadability/structureCodeLogically/unit-inParent-asFlat-print.md" boilerplate />

## Guideline: Follow a Standard

Expand All @@ -30,21 +38,28 @@ title: "Code Quality [Printable]"
## Guideline: Name Well

<include src="nameWell/introduction/unit-inParent-asFlat-print.md" boilerplate />
<include src="nameWell/basic/unit-inParent-asFlat-print.md" boilerplate />
<include src="nameWell/intermediate/unit-inParent-asFlat-print.md" boilerplate />
<include src="nameWell/avoidMisleadingNames/unit-inParent-asFlat-print.md" boilerplate />
<include src="nameWell/notTooLongNorShort/unit-inParent-asFlat-print.md" boilerplate />
<include src="nameWell/nounsAndVerbsAsNames/unit-inParent-asFlat-print.md" boilerplate />
<include src="nameWell/useNameExplain/unit-inParent-asFlat-print.md" boilerplate />
<include src="nameWell/useStandardWords/unit-inParent-asFlat-print.md" boilerplate />

## Guideline: Avoid Unsafe Shortcuts

<include src="avoidShortcuts/introduction/unit-inParent-asFlat-print.md" boilerplate />
<include src="avoidShortcuts/basic/unit-inParent-asFlat-print.md" boilerplate />
<include src="avoidShortcuts/intermediate/unit-inParent-asFlat-print.md" boilerplate />

<include src="avoidShortcuts/avoidEmptyCatchBlocks/unit-inParent-asFlat-print.md" boilerplate />
<include src="avoidShortcuts/deleteDeadCode/unit-inParent-asFlat-print.md" boilerplate />
<include src="avoidShortcuts/dontRecycleVarsOrParams/unit-inParent-asFlat-print.md" boilerplate />
<include src="avoidShortcuts/minimiseCodeDuplication/unit-inParent-asFlat-print.md" boilerplate />
<include src="avoidShortcuts/minimiseVariableScope/unit-inParent-asFlat-print.md" boilerplate />
<include src="avoidShortcuts/useDefaultBranch/unit-inParent-asFlat-print.md" boilerplate />

## Guideline: Comment Minimally, But Sufficiently

<include src="commentMinimally/introduction/unit-inParent-asFlat-print.md" boilerplate />
<include src="commentMinimally/basic/unit-inParent-asFlat-print.md" boilerplate />
<include src="commentMinimally/intermediate/unit-inParent-asFlat-print.md" boilerplate />
<include src="commentMinimally/dontRepeatObvious/unit-inParent-asFlat-print.md" boilerplate />
<include src="commentMinimally/explainWhatWhyNotHow/unit-inParent-asFlat-print.md" boilerplate />
<include src="commentMinimally/writeToReader/unit-inParent-asFlat-print.md" boilerplate />

</div>

Expand Down
Loading