Skip to content

Commit 4dbea0e

Browse files
committed
Add style guide to README
1 parent a3bda70 commit 4dbea0e

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,39 @@
11
# aima-python
22

3-
Python code for the book *Artificial Intelligence: A Modern Approach."
3+
Python 3 code for the book *Artificial Intelligence: A Modern Approach.*
44

55
Eventually, this repository should have code for everything in the book.
66

7-
What languages are instructors recommending? To get an approximate
7+
# Style Guide
8+
9+
We default to [Pep 8](https://www.python.org/dev/peps/pep-0008), but with a few exceptions:
10+
11+
- I'm not too worried about an occasional line longer than 79 characters.
12+
- You don't need two spaces after a sentence-ending period.
13+
- Strunk and White is [not a good guide for English](http://chronicle.com/article/50-Years-of-Stupid-Grammar/25497).
14+
- I prefer more concise docstrings; I don't follow [Pep 257](https://www.python.org/dev/peps/pep-0257/).
15+
- Not all constants have to be UPPERCASE.
16+
- [Pep 484](https://www.python.org/dev/peps/pep-0484/) type annotations are allowed but not required. If your
17+
parameter name is already suggestive of the name of a type, you don't need an annotation, e.g.:
18+
19+
def retry(url: Url) -> None: # This 'Url' annotation should be avoided; but '-> None' is useful
20+
21+
# Language Popularity
22+
23+
Are we right to concentrate on Java and Python versions of the code?
24+
What languages do students already know? The [TIOBE Index](http://www.tiobe.com/tiobe_index) says the top five are:
25+
26+
Java, C, C++, C#, Python
27+
28+
What languages are instructors recommending for their AI class?
29+
To get an approximate
830
idea, I gave the query <tt>norvig russell "Modern Approach"</tt> along with
931
the names of various languages and looked at the estimated counts of results on
1032
various dates. However, I don't have much confidence in these figures...
1133

1234
<p>
1335
<table border=1>
14-
<tr><th>Language<th>Sep 2004<th>Feb 2005<th>Jun 2007<th>Jan 2010<th>Feb 2016
36+
<tr><th>Language<th>2004<th>2005<th>2007<th>2010<th>2016
1537
<tr><td> <a href="http://www.google.com/search?q=norvig+russell+%22Modern+Approach%22"> <i>none</i></a><td align=right> 8,080<td align=right>20,100<td align=right>75,200<td align=right>150,000<td align=right>132,000
1638
<tr><td> <a href="http://www.google.com/search?q=java+norvig+russell+%22Modern+Approach%22">java </a><td align=right> 1,990<td align=right>4,930<td align=right>44,200<td align=right>37,000<td align=right>50,000
1739
<tr><td> <a href="http://www.google.com/search?q=c%2B%2B+norvig+russell+%22Modern+Approach%22">c++ </a><td align=right> 875<td align=right>1,820<td align=right>35,300<td align=right>105,000<td align=right>35,000

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy