Posted on Jun 24th, 2020
Today we’re learning about keys of all sorts – primary keys and foreign keys. These keys are used in Django for looking up models in the database and relating them to each other.
Project
Continue with day 2 of Uptact.
Resources
Class Videos
Posted on Jun 23rd, 2020
Today, we’ll start learning about Django. To work with this framework that helps us build web applications, we need to know about two other things:
Project
This is a week-long project, due next Monday.
Resources
Class Videos
Posted on Jun 22nd, 2020
Today, we’ll take a survey of object-oriented programming to get us ready to take on Django.
Today’s topics
- Object-oriented programming
- Classes and objects
Mystery Word Project review questions
- What’s something I learned in doing this project?
- What’s something I want to understand better or know more about after doing this project?
- What was my biggest accomplishment doing this project?
🐍 Code Break
Creating classes and objects
Project
Word Frequency OO
Resources
Code & Video from Class
Posted on Jun 18th, 2020
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 may have to revisit this plan and revise it as you discover new problems to solve while you work! This is 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
Mystery Word
Resources
Code from class
Posted on Jun 17th, 2020
Today’s topics
- Dictionaries
- List comprehensions
🐍 Code Break
Practice with list comprehensions
Project
Continue yesterday’s project. A dictionary will help you solve the problem of counting words.
Resources