Posted on Jun 15th, 2021
📅 Today’s topics
- Review HTTP request-response
- Learn about MVC web applications
- Get to know Django!
🎯 Project
For our first Django app, we’ll use the excellent tutorial provided by the Django Girls organization. The assignment repo only contains a README file. The tutorial will guide you through creating a Django project; create the project inside this repo.
Django Girls Tutorial
🔖 Resources
Django
HTTP
🦉 Code
Posted on Jun 14th, 2021
Today, we’ll take a brief survey of classes and objects in Python to get us ready to take on Django.
Today’s topics
- Python Classes
- Instantiating an Object
- Attributes
- Instance Methods
- “Magic” Methods
❓❓❓ Mystery Word Project Retrospective
- Something I learned by doing this project is…
- Something I want to understand better or know more about is…
- In this project, I was happy that I was able to…
🐍 Code Break
Creating classes and objects
🎯 Project
Word Frequency OO
🔖 Resources
🦉 Code
Posted on Jun 10th, 2021
Breaking down programming problems into their smallest pieces is one of the most critical skills in programming. You’ll need to practice this for the weekend assignment.
Today’s topics
- Modules and
import
- Exceptions
- Program shape & design
How to approach a large project
Sketch it out before you write code
Developers need to sketch out their ideas. (This is the true purpose of whiteboards for engineering teams, not grilling job candidates on obscure algorithms…) A pencil and paper is a great tool for programming. If that isn’t your style, use a stylus and tablet, a Google Doc, or whatever you like to jot things down. Don’t start in the code editor, in other words.
- What is the program/product’s purpose or goal? Restate it in your own words to be sure you get it.
- What is the core of its purpose? See if you can clear away the bells and whistles and get down to the simplest version of what it does.
- Bullet list out the main things it needs to do to achieve its purpose.
- Then go back and look at each bullet, and break it down further. What steps might need to happen first?
- each step could be something you know how to do OR something you don’t know how to do. Examples:
Get the contents of a file
Figure out some way to choose a random word
Keep track of what letters have been guessed
- Go back and re-read your list. What are you missing? Is there anything out of order? Have a realization about a step that could be made clearer? Revise it until it looks solid to you.
- You will probably have to revisit your plan and revise it as you discover new problems to solve while you work. This is expected and ok. It is all in a day’s work for a software developer.
Once you have a plan you think is somewhat doable, then you can start writing code. Work through your steps in the order that makes sense, keeping in mind that you can hard-code values as placeholders where you need to.
You must run your program repeatedly to get feedback about what is happening.
Change one thing at a time and work methodically.
Take breaks.
Talk to other developers when you are stuck. Talking through the problem will often clarify what you need to do. See Rubber Duck Debugging.
Don’t forget to use your print statements to give you necessary information as your program runs.
🐍 Code Break
Try working with a module
🎯 Project
This is due on Monday morning.
Mystery Word
Weekend Project Groups
groups = [
['Ellie', 'Dee', 'Logan'],
['Roan', 'Sara', 'Robert'],
['Wendy', 'Quinten', 'Brian'],
['Emily', 'Greg', 'Shaune']
]
🔖 Resources
Posted on Jun 9th, 2021
Today’s topics
- Dictionaries
- Tuples
- Lists and list comprehensions
🐍 Code Break
🎯 Project
Continue yesterday’s project, Word Frequency. A dictionary will help you solve the problem of counting words.
At minimum you should be able to count words and print that count, even if the formatting of your output is not 100% on point.
Working groups for tonight
Don’t struggle through code by yourself! Work together with these folks so you can get to the finish line with Word Frequency.
groups = [
['Sara', 'Dee', 'Roan'],
['Greg', 'Brian', 'Emily'],
['Shaune', 'Wendy', 'Robert'],
['Logan', 'Quinten', 'Ellie'],
]
🔖 Resources
🦉 Code & Notes
Posted on Jun 8th, 2021
We can use the generic term sequence for any object that provides an ordered structure for a number of items, such as a string (a group of characters), a list, or a dictionary (keys and values).
📅 Today’s Topics
- Lists and tuples
- More Strings
- Dictionaries
- Working with files
🐍 Code Break
Try working with lists
🎯 Project
This project is not due until Thursday of this week, but you should start working on it today.
Word Frequency
🔖 Resources
🦉 Code & Notes