Search for tag: "precondition"
SOIL Seminar: An Indexed Type System for Fast and Safe WebAssemblyTitle: An Indexed Type System for Fast and Safe WebAssembly Speaker: Adam Geller—University of British Columbia Summary: Often in low-level languages (i.e., assembly languages), potentially…
From Ross Tate
22 plays
|
|
Lesson 25.4 The raise StatementUp until now, the only way that we knew how to create an error is with an assert statement. But these always create errors with the type AssertionError. In this video we show how to create errors…
From Hannah Lee
71 plays
|
|
Lesson 23.5 Mixed-Type OperatorsOperator overloading allows us to redefine the meaning of + or * on objects of our class. But sometimes we want to mix together types like a fraction and integer. In this video we show that it is…
From Hannah Lee
77 plays
|
|
Lesson 21.4 Invariant EnforcementWe know how to enforce preconditions, but how do we force invariants for our attributes? As we see in this video, we do it much the same as for preconditions. But that is because we are going to…
From Hannah Lee
115 plays
|
|
Lesson 21.3 Interface ImplementationOnce you have the interface to a class, it is time to start writing code. As we see in this video, the idea is much the same as writing functions. However, attributes – and specifically…
From Hannah Lee
100 plays
|
|
Lesson 20.5 Method DefinitionsIn addition to attributes, objects also have methods. In this video, we show how to add a method definition to a class. For the most part, it is as simple as indenting a function definition inside of…
From Hannah Lee
121 plays
|
|
Lesson 17.5 Divide and Conquer DesignNow that we understand divide-and-conquer, it is type to implement it in Python. In this video we show you a three-step sequence for writing a function definition using this technique.
From Hannah Lee
126 plays
|
|
Lesson 14.4 Try-Except and TestingWe have a new control structure, so it is time once again to talk about testing. In this video we revisit the concept of code coverage and show testing a try-except is very similar to testing a…
From Hannah Lee
64 plays
|
|
Lesson 13.6 Assert HelpersSometimes we absolutely need to enforce all of our preconditions, and we cannot live with the compromises of the previous video. In this video we show how to use top-down design to give us more…
From Hannah Lee
75 plays
|
|
Lesson 13.5 Assert Trade-OffsPreconditions can get really complicated, and sometimes it is unclear how to enforce all of the preconditions. In this video we talk about why it is okay to break up a precondition and…
From Hannah Lee
59 plays
|
|
Lesson 13.4 Assert MessagesWe now know how to do assert statements to create errors. But the error messages are a little cryptic. In this video we talk about how we can do a better job.
From Hannah Lee
69 plays
|
|
Lesson 13.3 Assert StatementsDetermining responsibility can get really tedious. In this video, we show how we can responsibility explicit by creating errors on purpose. We introduce the assert statement, which will allow us to…
From Hannah Lee
82 plays
|
|
Lesson 13.2 Error ResponsibilityWhen we introduced specifications, we talked about responsibility; if there is a problem with a function, it is either the fault of the definer or the caller. In this video, we show how we read an…
From Hannah Lee
65 plays
|
|
Zoom Sep. 29. Algorithm DesignIn this session we do a deep dive in how we might design a series of functions to acomplish a single task.This class will be highly interactive. We will start with a specification – one more…
From Hannah Lee
33 plays
|
|
Lesson 10.6 Top-Down DesignTop-down design is a widely–used design technique. Your instructor used it to design the first assignment, and you will use it yourself in later assignments. In this video we take a closer look…
From Hannah Lee
93 plays
|
|
Zoom Sep. 22. Specifications and TestingBoth specifications and testing are critical for the first assignment. But many students struggle with them because they are so “fuzzy”.To help you improve your skills here, we have are…
From Hannah Lee
29 plays
|