... | ... | @@ -4,7 +4,7 @@ Author: Thomas J Kennedy |
|
|
Email: tkennedy@cs.odu.edu
|
|
|
---
|
|
|
|
|
|
# Draft
|
|
|
# Introduction
|
|
|
|
|
|
**This page is a draft**
|
|
|
|
... | ... | @@ -17,7 +17,7 @@ Email: tkennedy@cs.odu.edu |
|
|
> available at <https://www.cs.odu.edu/~tkennedy/python-workshop>).
|
|
|
|
|
|
|
|
|
# Who am I?
|
|
|
## Who am I?
|
|
|
|
|
|
I have taught various courses, including:
|
|
|
|
... | ... | @@ -34,9 +34,10 @@ configuration, or learning a new (programming) language. My current language of |
|
|
interest is Rust (at the time of writing).
|
|
|
|
|
|
|
|
|
# Referenced Courses & Materials
|
|
|
## Referenced Courses & Materials
|
|
|
|
|
|
I am going to pull from CS 330, CS 350, CS 411W, and CS 417 lecture notes.
|
|
|
I will reference materials (e.g., lecture notes) and topics from from CS 330,
|
|
|
CS 350, CS 411W, and CS 417.
|
|
|
|
|
|
- **CS 330 - Object Oriented Programming & Design**
|
|
|
- [S.O.L.I.D](https://www.cs.odu.edu/~tkennedy/cs330/f20/Public/reviewSOLID/)
|
... | ... | @@ -52,7 +53,7 @@ I will also reference a couple examples from the previous: |
|
|
- [Rust workshop](https://www.cs.odu.edu/~tkennedy/rust-workshop)
|
|
|
|
|
|
|
|
|
# The Broad Strokes
|
|
|
## The Broad Strokes
|
|
|
|
|
|
This workshop is intended as discussion on how to write Rust code that makes
|
|
|
use of:
|
... | ... | @@ -61,15 +62,16 @@ use of: |
|
|
|
|
|
I will focus on:
|
|
|
|
|
|
- Lambda functions, usage, syntax, and expressions
|
|
|
- Structuring large python codebases
|
|
|
- Profiling python, engineering best practices
|
|
|
- Advanced tutorials for modern development : Classes, Polymorphism,
|
|
|
Interfaces, etc.
|
|
|
- Debugging options in python ( A language that promotes rapid development is
|
|
|
usually hard to debug. How can we do it in python? )
|
|
|
- Multithreading/Concurrent python
|
|
|
- Documenting code
|
|
|
|
|
|
1. Documenting code
|
|
|
2. Advanced tutorials for modern development : Classes, Polymorphism,
|
|
|
Interfaces, etc.
|
|
|
3. Structuring large python codebases
|
|
|
4. Lambda functions, usage, syntax, and expressions
|
|
|
5. Multithreading/Concurrent python
|
|
|
|
|
|
Classes and OOP will take a while (the topic is quite vast). I will also
|
|
|
discuss testing python code (with unit testing and integration testing) and
|
... | ... | @@ -89,28 +91,6 @@ I should be able to fit in some discussion of NumPy. |
|
|
|
|
|
---
|
|
|
|
|
|
# Object Oriented
|
|
|
|
|
|
We need to discuss the [rules of a class
|
|
|
checklist](https://www.cs.odu.edu/~tkennedy/cs330/f20/Public/classChecklistCrossLanguage/).
|
|
|
|
|
|
| C++ | Java | Python 3 | Rust |
|
|
|
| :------------------------ | :------------------------------ | :--------------- | :---- |
|
|
|
| Default Constructor | Default Constructor | `__init__` | `new()` or Default trait |
|
|
|
| Copy Constructor | Clone and/or Copy Constructor | `__deepcopy__` | `Clone` trait |
|
|
|
| Destructor | | | |
|
|
|
| | finalize (deprecated/discouraged) | `__del__` | `Drop` trait |
|
|
|
| Assignment Operator (=) | | | |
|
|
|
| Accessors (Getters) | Accessors (Getters) | Accessors (`@property`) | Accessors (Getters) |
|
|
|
| Mutators (Setters) | Mutators (Setters) | Setter (`@attribute.setter`) | Mutators (setters) |
|
|
|
| Swap | | | |
|
|
|
| Logical Equivalence Operator (==) | equals | `__eq__` | `std::cmp::PartialEq` trait |
|
|
|
| Less-Than / Comes-Before Operator (<) | hashCode | `__hash__` | `std::cmp::PartialOrd` trait |
|
|
|
| `std::hash` *(actual hashing)* | hashCode | `__hash__` | `std::hash::Hash` trait |
|
|
|
| Stream Insertion Operator (<<) | toString | `__str__` | `std::fmt::Display` trait |
|
|
|
| | | `__repr__` | `std::fmt::Debug` trait |
|
|
|
| `begin()` and `end()` | `iterator` | `__iter__` | `iter()` and `iter_mut()` |
|
|
|
|
|
|
|
|
|
# Code Documentation
|
|
|
|
... | ... | @@ -351,3 +331,26 @@ def one_flip(p: float) -> bool: |
|
|
```
|
|
|
|
|
|
|
|
|
# Object Oriented
|
|
|
|
|
|
We need to discuss the [rules of a class
|
|
|
checklist](https://www.cs.odu.edu/~tkennedy/cs330/f20/Public/classChecklistCrossLanguage/).
|
|
|
|
|
|
| C++ | Java | Python 3 | Rust |
|
|
|
| :------------------------ | :------------------------------ | :--------------- | :---- |
|
|
|
| Default Constructor | Default Constructor | `__init__` | `new()` or Default trait |
|
|
|
| Copy Constructor | Clone and/or Copy Constructor | `__deepcopy__` | `Clone` trait |
|
|
|
| Destructor | | | |
|
|
|
| | finalize (deprecated/discouraged) | `__del__` | `Drop` trait |
|
|
|
| Assignment Operator (=) | | | |
|
|
|
| Accessors (Getters) | Accessors (Getters) | Accessors (`@property`) | Accessors (Getters) |
|
|
|
| Mutators (Setters) | Mutators (Setters) | Setter (`@attribute.setter`) | Mutators (setters) |
|
|
|
| Swap | | | |
|
|
|
| Logical Equivalence Operator (==) | equals | `__eq__` | `std::cmp::PartialEq` trait |
|
|
|
| Less-Than / Comes-Before Operator (<) | hashCode | `__hash__` | `std::cmp::PartialOrd` trait |
|
|
|
| `std::hash` *(actual hashing)* | hashCode | `__hash__` | `std::hash::Hash` trait |
|
|
|
| Stream Insertion Operator (<<) | toString | `__str__` | `std::fmt::Display` trait |
|
|
|
| | | `__repr__` | `std::fmt::Debug` trait |
|
|
|
| `begin()` and `end()` | `iterator` | `__iter__` | `iter()` and `iter_mut()` |
|
|
|
|
|
|
|