<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://teaching.healthtech.dtu.dk:443/22101/index.php?action=history&amp;feed=atom&amp;title=Good_code</id>
	<title>Good code - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://teaching.healthtech.dtu.dk:443/22101/index.php?action=history&amp;feed=atom&amp;title=Good_code"/>
	<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22101/index.php?title=Good_code&amp;action=history"/>
	<updated>2026-04-23T16:12:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22101/index.php?title=Good_code&amp;diff=49&amp;oldid=prev</id>
		<title>WikiSysop: /* Quality */</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22101/index.php?title=Good_code&amp;diff=49&amp;oldid=prev"/>
		<updated>2024-03-01T16:13:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Quality&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:13, 1 March 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l32&quot;&gt;Line 32:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 32:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The teachers solutions are (mostly) examples of good code. Often various solutions to the same problem are shown and pro&amp;#039;s and con&amp;#039;s of each discussed - read them.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The teachers solutions are (mostly) examples of good code. Often various solutions to the same problem are shown and pro&amp;#039;s and con&amp;#039;s of each discussed - read them.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Online: [https://teaching.healthtech.dtu.dk/material/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;36610&lt;/del&gt;/clean_code.html Clean Code] by Lukasz Dynowski. This resource gives a lot of practical advice on how to make good code.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Online: [https://teaching.healthtech.dtu.dk/material/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;22101&lt;/ins&gt;/clean_code.html Clean Code] by Lukasz Dynowski. This resource gives a lot of practical advice on how to make good code.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22101/index.php?title=Good_code&amp;diff=48&amp;oldid=prev</id>
		<title>WikiSysop: Created page with &quot;Good code is both &#039;&#039;&#039;Correct&#039;&#039;&#039; and have good &#039;&#039;&#039;Quality&#039;&#039;&#039;.  === Correctness === This is simply to which degree does the solution(s) give the right answer when using the data set supplied with the exercise - &#039;&#039;&#039;or&#039;&#039;&#039; similar natural data sets.&lt;br&gt; &quot;Natural data sets&quot; in this context are data set, that * are NOT specially constructed to catch minor flaws in the programming. * do NOT differ significantly from what has been used in exercises. * are NOT unlikely to occur in...&quot;</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22101/index.php?title=Good_code&amp;diff=48&amp;oldid=prev"/>
		<updated>2024-03-01T16:13:13Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Good code is both &amp;#039;&amp;#039;&amp;#039;Correct&amp;#039;&amp;#039;&amp;#039; and have good &amp;#039;&amp;#039;&amp;#039;Quality&amp;#039;&amp;#039;&amp;#039;.  === Correctness === This is simply to which degree does the solution(s) give the right answer when using the data set supplied with the exercise - &amp;#039;&amp;#039;&amp;#039;or&amp;#039;&amp;#039;&amp;#039; similar natural data sets.&amp;lt;br&amp;gt; &amp;quot;Natural data sets&amp;quot; in this context are data set, that * are NOT specially constructed to catch minor flaws in the programming. * do NOT differ significantly from what has been used in exercises. * are NOT unlikely to occur in...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Good code is both &amp;#039;&amp;#039;&amp;#039;Correct&amp;#039;&amp;#039;&amp;#039; and have good &amp;#039;&amp;#039;&amp;#039;Quality&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Correctness ===&lt;br /&gt;
This is simply to which degree does the solution(s) give the right answer when using the data set supplied with the exercise - &amp;#039;&amp;#039;&amp;#039;or&amp;#039;&amp;#039;&amp;#039; similar natural data sets.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;Natural data sets&amp;quot; in this context are data set, that&lt;br /&gt;
* are NOT specially constructed to catch minor flaws in the programming.&lt;br /&gt;
* do NOT differ significantly from what has been used in exercises.&lt;br /&gt;
* are NOT unlikely to occur in Real Life.&lt;br /&gt;
&lt;br /&gt;
=== Quality ===&lt;br /&gt;
The quality of the code is reflected in a lot of properties.&lt;br /&gt;
* Easy to read&lt;br /&gt;
* Easy to maintain&lt;br /&gt;
* Easy to extend&lt;br /&gt;
* Easy to use&lt;br /&gt;
* Explicit code&lt;br /&gt;
* Comments explaining the code - what is happening. Usually 10-20% of the chars used should be comments. There is such thing as too many comments - when you have more comments than code you are over the limit.&lt;br /&gt;
* Well-chosen placement of comments. They should not disrupt the reading of the code.&lt;br /&gt;
* Well-chosen descriptive names for variables, subroutines, etc.&lt;br /&gt;
* Modular construction of the code&lt;br /&gt;
* No special cases, but general programming&lt;br /&gt;
* Not bloated code - slim and elegant&lt;br /&gt;
* Demonstrating overview of the problem&lt;br /&gt;
* Avoiding using &amp;#039;&amp;#039;break&amp;#039;&amp;#039; and &amp;#039;&amp;#039;sys.exit&amp;#039;&amp;#039; in ways that break the natural flow of the code&lt;br /&gt;
* Catches errors in the input - and explains what the error is&lt;br /&gt;
* Code is optimized and logical&lt;br /&gt;
* Code does not unnecessarily use memory - like slurping files for no good reason&lt;br /&gt;
* Using correct data structures and understanding the basis of the various types&lt;br /&gt;
* Using efficient and clear algorithms&lt;br /&gt;
* Correct use of Python idioms, concepts and constructs&lt;br /&gt;
Many of these properties overlap to a lesser or greater extent. It does not matter. What matters is that they explain in different ways what code quality is.&lt;br /&gt;
The teachers solutions are (mostly) examples of good code. Often various solutions to the same problem are shown and pro&amp;#039;s and con&amp;#039;s of each discussed - read them.&lt;br /&gt;
&lt;br /&gt;
* Online: [https://teaching.healthtech.dtu.dk/material/36610/clean_code.html Clean Code] by Lukasz Dynowski. This resource gives a lot of practical advice on how to make good code.&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
</feed>