... | ... | @@ -41,46 +41,14 @@ I am going to pull from CS 330, CS 350, CS 411W, and CS 417 lecture notes |
|
|
- [Python non-linear solver discussion](https://www.cs.odu.edu/~tkennedy/cs417/f20/Public/solverDiscussion/)
|
|
|
|
|
|
I will also pull a couple examples from my previous Git workshop, <https://www.cs.odu.edu/~tkennedy/git-workshop>.
|
|
|
i
|
|
|
|
|
|
# The Broad Strokes
|
|
|
|
|
|
T.B.W
|
|
|
|
|
|
## Best Practices
|
|
|
|
|
|
- Design Paradigms
|
|
|
- *S.O.L.I.D*
|
|
|
- Iterators - *(CS 330)*
|
|
|
- Modern Language Constructs
|
|
|
|
|
|
## Tools of the Trade
|
|
|
|
|
|
- **Vim (the only editor anyone ever needs)**
|
|
|
- Configuration Management
|
|
|
- External Libraries
|
|
|
- Cross-compilation
|
|
|
- Continuous Integration & Deployment
|
|
|
- [Jenkins](https://jenkins.io/)
|
|
|
- [Gitlab CI](https://about.gitlab.com/product/continuous-integration/)
|
|
|
- [Travis CI](https://travis-ci.org/)
|
|
|
- [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/)
|
|
|
- [AWS CodePipeline](https://aws.amazon.com/codepipeline/)
|
|
|
- Documentation
|
|
|
- Javadoc
|
|
|
- Pydoc
|
|
|
- Doxygen
|
|
|
- Rustdoc
|
|
|
- Code Style
|
|
|
- Static Code Analysis
|
|
|
- Code Linters
|
|
|
- Style Checkers
|
|
|
|
|
|
|
|
|
## Testing & Development
|
|
|
|
|
|
- Test Driven Development
|
|
|
- [Unit Testing & Integration Testing](https://doc.rust-lang.org/book/ch11-03-test-organization.html)
|
|
|
- [Hamcrest Matchers](http://hamcrest.org/)
|
|
|
|
|
|
|
|
|
---
|
... | ... | @@ -88,9 +56,9 @@ T.B.W |
|
|
# Topics
|
|
|
|
|
|
|
|
|
* A quick overview of procedural, object-oriented and functional style programming (very briefly).
|
|
|
* PEP 8, <https://www.python.org/dev/peps/pep-0008/> and PEP 20, <https://www.python.org/dev/peps/pep-0020/>
|
|
|
* Loops, context managers, and list/generator comprehensions, <https://www.cs.odu.edu/~tkennedy/cs330/f20/Public/switchingToPython/index.html>.
|
|
|
* ~~A quick overview of procedural, object-oriented and functional style programming (very briefly).~~
|
|
|
* ~~PEP 8, <https://www.python.org/dev/peps/pep-0008/> and PEP 20, <https://www.python.org/dev/peps/pep-0020/>~~
|
|
|
* ~~Loops, context managers, and list/generator comprehensions, <https://www.cs.odu.edu/~tkennedy/cs330/f20/Public/switchingToPython/index.html>.~~
|
|
|
* ~~The basic Python data structures (List, Dictionary, and Set)~~
|
|
|
* Generator Expressions
|
|
|
* A few Python modules, including Zip, json, and argparse, <https://www.cs.odu.edu/~tkennedy/cs330/f20/Public/switchingToPython/index.html#python-includes-batteries>
|
... | ... | @@ -183,7 +151,7 @@ Other rules come from the community... |
|
|
|
|
|
1. Always have a `if __name__ == "__main__"`.
|
|
|
2. Use f-strings over format where possible.
|
|
|
3. Use `with` closures`
|
|
|
3. Use `with` closures
|
|
|
4. Write pydoc style documentation.
|
|
|
5. Use functions and modules.
|
|
|
6. No global variables.
|
... | ... | @@ -196,12 +164,9 @@ Other rules come from general software engineering practices: |
|
|
2. Use top down design
|
|
|
3. Do not write monolithic functions
|
|
|
4. Use a code linter or style checker (e.g., pylint)
|
|
|
5. Use self-dcoumenting names
|
|
|
|
|
|
|
|
|
# Loops, Context Managers, and List/Generator Comprehensions
|
|
|
|
|
|
This section is based on [notes from CS 330 Object Oriented Programming & Design](https://www.cs.odu.edu/~tkennedy/cs330/f20/Public/switchingToPython/index.html).
|
|
|
5. Use self-dcoumenting name
|
|
|
6. Remember *S.O.L.I.D*.
|
|
|
7. Iterators are magic *(CS 330)*.
|
|
|
|
|
|
|
|
|
# Data Structures
|
... | ... | @@ -224,6 +189,13 @@ If we want to map these to (modern) C++, Java, and Rust... we end up with... |
|
|
| `dict` | `std::unordered_map` | `java.util.HashMap` | `std::collections::HashMap` |
|
|
|
| `set` | `std::unordered_set` | `java.util.HashSet` | `std::collections::HashSet` |
|
|
|
|
|
|
I am not listing tuple as a *true* data structure.
|
|
|
|
|
|
|
|
|
# Loops, Context Managers, and List/Generator Comprehensions
|
|
|
|
|
|
This section is based on [notes from CS 330 Object Oriented Programming & Design](https://www.cs.odu.edu/~tkennedy/cs330/f20/Public/switchingToPython/index.html).
|
|
|
|
|
|
|
|
|
## Lists & List Comprehensions
|
|
|
|
... | ... | @@ -455,4 +427,9 @@ popular build and configuration management tool. |
|
|
|
|
|
|
|
|
|
|
|
## Testing & Development
|
|
|
|
|
|
- Test Driven Development
|
|
|
- [Unit Testing & Integration Testing](https://doc.rust-lang.org/book/ch11-03-test-organization.html)
|
|
|
- [Hamcrest Matchers](http://hamcrest.org/)
|
|
|
|