IISc Bangalore · Computer Science

Programming with Generative AI

Prof. Viraj Kumar · 219 free video lectures

Generative AI tools are being rapidly integrated into professional software development workflows because, for well-specified problems, they often (but not always!) write accurate code. To help students use generative AI tools effectively, this course teaches programming using such tools. It…

▶ Play on Open Lecture HallCourse page ↗

Lectures

  1. What do Programmers Do?
  2. What is (and isn't) an algorithm?
  3. Algorithms for prime numbers
  4. Key Programming Trends
  5. Test Your Understanding
  6. How effective is GenAI at coding?
  7. Refuting an Algorithm
  8. Why is GenAI so effective at coding?
  9. Assumptions in AI-generated code
  10. Test Your Understanding
  11. Summary
  12. Python resources
  13. The REPL
  14. Basic Arithmetic Operators
  15. Test Your Understanding
  16. Complex Expressions
  17. Limits to arithmetic computation
  18. Investigation sys.float_info
  19. Binary digits (bits)
  20. Naming Things
  21. Introducing "our friend"
  22. Test Our Friend's Understanding
  23. Limits to float computation
  24. Python Objects
  25. Textual data
  26. Strings
  27. Summary
  28. Evaluating a complex expression
  29. Assignment statements in Python
  30. Assignment statements and a common misconception
  31. Clarifying the misconception
  32. Another misconception with assignments
  33. A final misconception with assignments
  34. Introduction to PythonTutor
  35. Swapping two variables (incorrect)
  36. Swapping two variables (correct)
  37. Good, Poor, and Illegal Variable names
  38. Summary
  39. Representing complex programs abstractly as functions
  40. Properties of mathematical functions
  41. Other built-in functions
  42. The input function
  43. Celcius to Fahrenheit (buggy)
  44. Reviewing our friend's critique of buggy code
  45. Debugging the code
  46. Nested function calls
  47. AI-generated program 1
  48. AI-generated program 1
  49. Another example: Patient Data (buggy)
  50. Using ChatGPT to debug
  51. Fixing ChatGPT assumptions
  52. Using GitHub Copilot to debug
  53. Further model assumptions
  54. Fixing GitHub Copilot assumptions
  55. ChatGPT vs GitHub Copilot
  56. Summary
  57. Poorly designed and well designed functions
  58. Principles of good function design
  59. Improvement 1
  60. Improvement 2
  61. Example of a poorly designed function
  62. Improvement 2 continued
  63. Improvement 3
  64. Simple conditional statements
  65. Critiquing AI-generated code
  66. Complex conditional statements
  67. Introduction to Refute problems
  68. Summary
  69. Example 1 (is_multiple)
  70. Visualizing Example 1
  71. Visualizing a function call
  72. The error in Example 1
  73. Fixing the code
  74. Key Observations
  75. Example 2 (modified is_multiple)
  76. Fixing the error, Simplification 1
  77. Elements of a Refute Problem
  78. Refuting the median function
  79. Simplification 2
  80. Feedback for Refute Problems
  81. Attempting to refute
  82. Refuting the num_days function
  83. Critique our friend's function
  84. Boolean/logical operators
  85. Simplification 3
  86. Identifying an unexpected behaviour
  87. Understanding and fixing the error
  88. Short-circuiting
  89. Inequivalence due to short-circuiting
  90. Summary
  91. Solving a problem with a helper function
  92. Calling a helper function
  93. Tracing a call to the helper function
  94. Definition of a leap year
  95. Refuting our friend's code
  96. Introduction to recursion
  97. Infinite recursion
  98. A correct recursive function
  99. Using the default visualization
  100. A non-recursive solution
  101. Refuting the buggy code
  102. Summary
  103. "Ask the Client" problems
  104. Clarifying the task
  105. Our friend's recursive function
  106. Tracing our friend's code
  107. Refuting our friend's code
  108. Clarifying questions: num_vowels
  109. Strings in Python
  110. Testing our understanding
  111. Testing out understanding further
  112. String operations and methods
  113. Testing your understanding
  114. Our friend's code: num_vowels
  115. Refuting our friend's code
  116. Immutable objects
  117. Summary
  118. Modifying existing code
  119. Poor code readability
  120. Improving code readability
  121. Asking clarifying questions
  122. Clarifying the code's expected behaviour
  123. Lists are mutable
  124. Step 1: Suggested modification
  125. Exceptions
  126. Tuples
  127. Sequence unpacking
  128. Summary
  129. A mystery (recursive) function
  130. Visualizing the mystery function
  131. A better (iterative) solution
  132. Visualizing a for-loop
  133. Pattern 1: Iterate until "success"
  134. Examples of Pattern 1
  135. An error in AI-generated code
  136. A buggy function using Pattern 1
  137. Refuting the buggy function
  138. Pattern 2: Accumulate
  139. The is_prime function
  140. Visualizing prime_product
  141. Another version of prime_product
  142. Visualizing the new version
  143. An example of Pattern 2
  144. Another example of Pattern 2
  145. Visualizing appending to a list
  146. Our friend's suggestion
  147. List comprehension
  148. A buggy function using Pattern 2
  149. Refuting the buggy function
  150. An interesting takeaway
  151. Summary
  152. A recursive mystery function
  153. Iterative version
  154. Replacing while with for: Example 1
  155. Replacing while with for: Example 2
  156. Searching in a sorted list
  157. Implementing binary search
  158. The num_unique function
  159. Incorrect implementations of num_unique
  160. A correct implementation of num_unique
  161. Visualizing num_unique
  162. An important case (nobreak with no iterations)
  163. Pattern 3: All pairs
  164. Example (Pattern 3): max_profit
  165. Refuting the buggy function
  166. Representing tabular data
  167. Basic dict operations
  168. Example: substring_count
  169. Clarifying the task
  170. Reviewing ChatGPT's solution
  171. Test Driven Development
  172. Writing doctests for is_prime
  173. Summary
  174. Clarifying the task: count_between
  175. Understanding the interpretation of "between"
  176. Are ChatGPT suggestions "good"?
  177. Generating the code after clarifying (using ChatGPT)
  178. Additional ChatGPT inputs
  179. Revised code after additional clarifications
  180. Learning a new programming language
  181. Python vs C: Similarities and differences
  182. Python: Example 1
  183. Translating Example 1 to C
  184. Key syntactic differences: Python vs C
  185. Visualizing Python and C code
  186. C programming style
  187. Python: Example 2
  188. Example 2, Attempt 2
  189. Semantics of integer division
  190. Example 2, Attempt 3
  191. Summary
  192. Example 1 (is_upper)
  193. Visualizing the incorrect is_upper function
  194. Correcting the error
  195. Basics of strings in C
  196. Strings in C (char [])
  197. Strings in C (char *)
  198. Mutable and immutable strings
  199. Example 2 (to_ind_lower)
  200. Visualizing the modified to_ind_lower function
  201. Our friend's translation
  202. Visualizing our friend's translation
  203. Preventing accidental mutation
  204. Copying a string (Attempt 1)
  205. Copying a string (Attempt 2)
  206. Fixing one error, revealing another
  207. Allocating memory on the heap
  208. Visualizing the revised version (with malloc)
  209. Summary
  210. Algorithm-centric improvements (to_ind_lower)
  211. Data-centric improvements (to_ind_lower)
  212. Processing textual data: C or Python
  213. Understanding (simplified) Python lists
  214. A simple implementation of Python lists (Part 1)
  215. A simple implementation of Python lists (Part 2)
  216. A simple implementation of Python lists (Part 3)
  217. A simple implementation of Python lists (Part 4)
  218. Testing the list implementation
  219. Summary

From NPTEL (IITs and IISc) · CC BY-NC-SA. More from IISc Bangalore.

Open Lecture Hall is free, with no ads and no sign-up. It is not run by or connected to any university; the lectures are the universities' own free recordings, played from where they host them. About & rights