Full transcript
0:01Good morning. Welcome to another uh
0:03coding with AI with Dr. Chuck. Uh this
0:06morning we're in the bathroom. It's uh
0:087:30 in the morning and I got a full cup
0:10of coffee
0:13and somehow I woke up this morning
0:15[music] wanting to make an attempt. It's
0:18like uh summiting Mount Everest,
0:20although it takes a bunch of small steps
0:22to summit Mount Everest, but I wanted to
0:24try something difficult. So, this is one
0:27of those videos where I'm going to
0:28record it and if it completely explodes,
0:31I'll decide later whether or not to
0:33[music] publish it or not. So, if you're
0:34seeing it, it probably means that um
0:38worked well enough or it worked well
0:39enough that I felt like it was a good
0:42lesson. And that brings up a a a good
0:47question that I probably should answer a
0:49little more often on these in this
0:50[music] podcast slash, you know, long
0:52form hour and a half coding sessions.
0:55um why what is my learning objective for
0:59what we're doing right now and [music]
1:02and it has to do with you know
1:04artificial intelligence and its impact
1:06on software development. Uh a lot of
1:09teachers and and professionals in the
1:11field have strong and rather divergent
1:14opinions on where this all goes. Um
1:21there are uh people who think that
1:24learning to program, learning what an
1:26assignment [music] statement is in
1:27Python is irrelevant because you just
1:29describe what you want and AI writes
1:32assignment [music] statements for you.
1:33Um that's not me. Um
1:40other people, you know, got their head
1:41in the sand. They're [music] ignoring AI
1:43and really spending all their time
1:44trying to teach without AI and tell
1:47their students [music] they can't use AI
1:48because whatever we taught 10 years ago
1:50is the right thing to teach and by
1:53[music] gosh you're going to learn it
1:55that way. I'm I'm somewhere in the
1:57middle. I believe [music] that we have
1:59to radically change software development
2:02education and everything I do leads to
2:05that to the point where we [music] focus
2:08more in our education on preparing
2:10people to use AI
2:13and only teach
2:16enough
2:18to
2:20create programmers who can have good
2:22conversations with AI. not programmers
2:25to sit and puzzle through hard little
2:28things [music] or review millions of
2:31lines of code looking for bugs by hand.
2:33Um,
2:35it it's both not as hard and harder. You
2:38[music] can do more, but it it's
2:41challenging. And so I always think of
2:43the key to AI and software development
2:45is it's a it's a conversation. [music]
2:48It's conversation between you and
2:49somebody who works for you who's really
2:51fast and really good and in many areas
2:55knows more [music] than you do in terms
2:56of detail. It just knows amazing amounts
2:59of detail.
3:01And so if you are a
3:06sophisticated programmer and you've been
3:07programmed for a while and you know how
3:08to program, I'm hope you say like, whoa,
3:11you know, he's not too bad. [laughter]
3:13Which I don't think that's a fair
3:15statement to say that I'm not too bad.
3:17Um, I'm more more interested in
3:20beginning programmers who are thinking,
3:22well, I don't think I'm going to take a
3:24course. [music]
3:24I'm just going to do AI. And I want
3:27those beginning programmers to
3:31realize that when you're doing real work
3:33with AI, the conversation requires both
3:36sides to be really smart. And if you're
3:39about programming
3:41and and what I want you to listen to is
3:43the things that I say
3:45to AI and
3:49and how complex those are and how
3:52intricate the vocabulary that I use is.
3:56I'll say something like one to many and
4:00I could write you a script and I could
4:01say say the word one to many to AI. But
4:04that's not the point. The point is the
4:07conversation not between [music]
4:09me and your AI through you where I write
4:11you a script and you say it. You got to
4:13be able to generate the script just
4:15[music] as like you could generate code
4:16before. And so you need to generate the
4:19prompts and you need to have a
4:21vocabulary to generate the prompts
4:23[music] because we don't speak to AI in
4:25simple English like dude write me
4:28something that's going to make me a
4:29billion dollar startup and with maps
4:31[music] and stuff. I mean it's never
4:33like that. you're talking about one to
4:36many and cache performances and make
4:40sure this cache is an N login cache, not
4:42an N squared cache. Um, [music] and we
4:44have to throw data away if we we just it
4:46won't work if it's n squ. What did I
4:48just say? Like what did I just say?
4:53So
4:54the if you're a advanced programmer,
4:58I I know that I'm probably in the bottom
5:00third of AI practitioners as it were. I
5:03was talking to my colleague Anthony
5:05White about the course he's teaching
5:06[music] right now on campus starting
5:08next week
5:10and he's he's going to like sort of
5:13[music] walk away from syntax first and
5:16and I'll see I'm going to go to his
5:18class [music] for a couple of weeks
5:19because I just want to see the looks on
5:21students faces who don't know how to
5:22program who are being shown this amazing
5:26AI stuff and it
5:29I don't want him to fail. I want him to
5:32succeed and I know that he won't
5:35completely fail but I [music] also know
5:37not know but I believe that he's going
5:38to meet headwinds and I want to sit and
5:41watch those headwinds cuz [music] I want
5:43to come up with a way to do what he's
5:45doing and solve the problems. If there
5:48are problems I want [music] to solve
5:49them and so I want to be there with him
5:50as he tries to teach this new way. I
5:53hope I don't intimidate him sitting
5:55[music] in his classroom, but I'm going
5:56to be sitting in the classroom this fall
5:58for at least three or four weeks
6:00and observing what it means to sort of
6:03not do syntax first because I believe
6:05the answer is syntax first, but not as
6:07much syntax as we throw at them. Um,
6:13my my approach to programming hasn't
6:15[music] changed in 15 years. So, okay,
6:20enough of the philosophy.
6:23If you're a good programmer, if you're a
6:25great AI programmer, you [music] can
6:26laugh at me. If you're a good AI
6:28programmer, maybe you can learn from me.
6:31And uh if you're a beginner, you can
6:33say, "Oh, watch Chuck, be confused,
6:38realize you still need to learn
6:39something before you can truly master
6:41AI." Because I'm not an AI master, but I
6:43use it pretty damn well. And I would say
6:46that it gives me a I was thinking about
6:49this somewhere between a 5x and a
6:51[music] 10x performance improvement. And
6:54sometimes, as you will see [music]
6:56today,
6:58it almost gives you an infinite
7:00performance [music] improvement because
7:02I will attempt things with AI that I
7:05wouldn't [music] have time to attempt on
7:07my own unless I had a couple weeks free
7:10to concentrate on the fine detail of the
7:14thing that I'm about to do.
7:17I mean, I can do it in preai because
7:20[music] I would need to spend 8 to 10
7:23hours a day, 5 days a week, wake up,
7:26think about one problem, code that
7:28problem, go to sleep, wake up, think
7:30about the same problem after sleep, and
7:33maybe 7 days, maybe 10 days of that
7:37complete like isolation in a [music]
7:39problem might get me to build what I'm
7:41about to try to build with AI by hand.
7:44It's not like I haven't done these
7:46things, but with AI, I get to try to do
7:49them and make progress in a couple hours
7:52versus make progress in 10 days. And so
7:55[music] that's the that's the 10x. But
7:59the problem is is if I [music] have a
8:0010day problem done manually
8:03um and I don't have 10 days and it's
8:05rare that I have 10 days with no
8:07interruptions
8:08um it's probably completely unlikely
8:11that I have 10 days of then that means
8:13that the speed up is infinite
8:16because I don't have the 10 days and
8:18this is a 10day problem that I'm about
8:19to solve
8:21and that's why I'm fearful in this
8:25particular one that [music] this will
8:26never see the light of day because I'm
8:27about to solve uh
8:29problem that I that I estimate would
8:32take me five or 10 days. And [music] uh
8:35I I rarely send AI at problems I think
8:39are this big. Um because this is I'm
8:42making changes to code that is in
8:46production with hundreds of thousands of
8:48users. It's making me a [music] bunch of
8:49money and if I break it, uh that's kind
8:52of ugly. But I want to evolve that code
8:56to the next level. So, enough of me um
9:00self setting myself up for failure. I
9:04mean, if you've Hey, if you've uh got
9:07this close, like, share, and subscribe.
9:08[music] Um and so what am I working on
9:12today? So, I am working on a thing I
9:14call Sugi. So, www.s.sugi.org. This is a
9:18[music] this is my innovation platform.
9:23If you look at the Sugi project on
9:25GitHub um and you look at the
9:27contributors, you see that I've been
9:30building Sugi since 2013. I used it to
9:32build Python for everybody and it it's
9:34the foundation for every course that I
9:36teach that I make all my money on. Um
9:39[music]
9:40and and so this has been around. It's a
9:42learning tools interoperability.
9:44Originally it was a LTI library and it
9:46evolved into almost a course management
9:48system, right? And so like if you go
9:51into like my Django for everybody, you
9:53got an announcements tool, a pages tool,
9:56and it's been slowly but surely going
9:58from a simple thing that had like little
10:00LTI tools [music] like um this quizzing
10:03tool that I could plug in um this quiz
10:07tool is an LTI tool. And if you're using
10:09it and you see it [music] the the top
10:10bar go away, that usually means it's an
10:12LTI launch. And you can even see here
10:14LTI Sugi is a session key that's
10:17different than the regular session. and
10:18then I go back to the original session.
10:20So you'll see that [music] I'm using
10:21what's called cookieless sessions to
10:24launch and manage LTI and that's so that
10:26they can run inside iframes. By the way,
10:28beginners who are watching this,
10:30think of the vocabulary I just used. You
10:33you can't prompt if you don't know the
10:35vocabulary. And that's my courses teach
10:38you the vocabulary so you can talk to
10:40AI. Sorry. Sorry. All those vibe coders
10:44people just piss me off. I vibe code all
10:46the time. That's what I'm doing right
10:47now. So, okay. So, Sugi is a learning
10:50management system. But the problem with
10:52the Sugi learning management system is I
10:54need a [music] different website for
10:57each course.
10:59I author the courses like this course
11:01right here. This course is authored in a
11:04file called I don't have it here. I
11:07don't have it in I'm not in Sugi.
11:08[music]
11:08I'm not in uh it's a JSON file in
11:11lessons.json. And I put it into GitHub.
11:14[music] and and this is the JSON that
11:17defines that course. Now, if you go into
11:19Canvas or Sakai or anything else or
11:21modal, it edits the course within the
11:24user interface. This one authors it, but
11:27then it saves it to a local file on the
11:29hard drive, which I then put into
11:30GitHub, which I then put into
11:32production. [music] I want to move to
11:34the point where this has multiple
11:36courses, but I'm getting ahead of
11:38myself.
11:40So, this is an interesting project. If
11:41you look, I've got 3,600 commits. The
11:44second largest is David Bower and Sam's
11:46got a couple commits in [music] here.
11:48This is pretty much a single person
11:50project. And you'll notice that now that
11:54this is kind of my preAI work. I did a
11:56whole bunch of work and then it it's
11:58hard to evolve this pre-AII, but you can
12:02see now that I've done AI, I'm getting
12:03kind of crazy and I'm making a lot of
12:05progress and evolving and [music] um
12:08it's great. Now, if you look at the
12:10source code, it's it's PHP. Um, you can
12:14laugh at me for PHP, but PHP is a
12:16stunningly uh performant system for
12:20small simple systems and it scales
12:23enough for me and it's dirt cheap for me
12:26to host. I mean, I say I've served
12:29millions of students with PHP. [music]
12:30So, you one of these days I'm going to
12:32rewrite it. I I you'll see the debates
12:35when I start to rewrite this
12:37>> [music]
12:37>> um in another uh language and and and
12:40stack the the language is less important
12:42for me than the tech stack and the tech
12:44stack has to be inexpensive on Amazon
12:46and scale well and inexpensively on
12:48Amazon and um [music] and so just
12:53PHP right now
12:55if I was choosing uh there's a whole
12:58bunch of things that are below PHP like
13:00nojs don't like [music] it Um,
13:04I thought Dena was going to deploy was
13:06going to be cool. I don't like it
13:07anymore. I don't, you know, so I thought
13:09JavaScript was the future. I'm not sure
13:11it is. Um, it's that's a different
13:14conversation. That's hours of
13:16conversation. PHP, come at me in the
13:19comments. I don't care. It scales. It's
13:22cheap. And I will write in a weirdass
13:24language with dollar signs [music] if it
13:26scales and it's cheap. But I've been
13:28working on this for a long time. and I
13:30build these these websites. Now, the
13:33interesting thing is if you go to a real
13:35learning management system like Sakai or
13:37Canvas, you see URLs like if I go into
13:40the um announcements tool, you see
13:42announcements, but there's [music]
13:44there's an what's different about Sugi
13:47than other real learning management
13:48systems is there's an implied course ID.
13:52And so if you look, you'll see um
13:54[music] in Canvas
13:57um you'll see there'll be an a
13:59slashcourses slash number. So So
14:02eventually it look like this courses
14:03[music]
14:06slash42/announcements
14:09and this [music] is the primary key of
14:12the course. Moodle does it, Sky does it.
14:14Canvas does it. Canvas they use
14:16integers. Sakai use a gooids but still
14:20it's the primary key of a record in a
14:23course. So like here's this course
14:25context and so here's the primary key
14:28context ID right [music]
14:30and so and so what I'm going to do is
14:34right now Sugi I have to have a
14:37different virtual hosted server for
14:40every instance of Sugi and the course ID
14:44is in the session now that so it's not
14:48even it's a multi-tenant system and it's
14:51and it's a multi it's not even a
14:53multiore course system except when it's
14:56doing LTI launches. So the LTI launches
14:58because they come from many learning
14:59management systems. The LTI launches are
15:02multi-tenant and multicourse. So when
15:05I'm switching from kind of Sugi learning
15:08management system to Sugi launched LTI
15:10tool in all this there is a tenant and a
15:13and a course ID. This could be different
15:16but [music] it and it is different. If I
15:19launch into the same thing from Canvas
15:21into Sugi, then that's [music] a
15:23different tenant and a different course
15:25ID. But I want to get to the point where
15:27within one tenant, you can have uh many
15:30course IDs and switch between them.
15:33Okay.
15:36Okay. So, I I'm just going to start
15:40talking and we're going to see.
15:48Let's make this a little smaller.
15:55Come on.
15:59There we go. Let's go to the get this
16:01thing over here so I can pop back and
16:03forth to my [music] browser.
16:06Um, let's start a new chat.
16:21Hello. This is a significant [music]
16:23project that we're working on. Um, I
16:26want to We've talked about it before. I
16:29don't know if you remember, but we've
16:30talked about a [music]
16:32a courses controller. So right now we
16:35have like an announcements controller
16:36that responds to slannouncements and
16:39picks up the context ID and the user ID
16:43from the session. So we don't have
16:45course ID in the URL. What I want to do
16:48is I want to build a courses controller
16:54that responds across all of Sugi whether
16:58at a top level in a parent site or
17:00within the [music] /sugi/sugi/courses
17:03or just slashcourses and I want it to
17:06take uh slashcourses [music] slashcourse
17:09id slannouncements. So, I want to put
17:12two things in the path courses and then
17:14a slug with a primary key. And so, I
17:18want to be able to respond to
17:18SLannouncements, which means use the
17:20current sessions course ID or
17:23slashcourses/42/announcements,
17:27which if we're in course 42, [music] it
17:31just behaves exactly the same as
17:32announcements. If 42 is not the course
17:35we're currently in, we got to switch
17:36courses. And eventually we're going to
17:40take well don't worry about that. So for
17:44now we're going to build a courses
17:45controller. If you go to slashcourses
17:48list all the current courses [music]
17:50that the current logged in user is lo is
17:52is a member of and give them a link to
17:56go into that course.
17:58We're probably not going to find for now
18:00because we don't do a lot of courses in
18:03a in a tenant multiple courses in a
18:05tenant yet. But slashcourses is a list
18:08of all the courses that the current
18:09logged in user is a member of. And then
18:11the URL will be like /courses
18:14one/courses/42
18:16whatever the primary key of it is. But
18:18then when we when we respond to
18:19/courses/42 we got to compare the
18:22current loggedin user in the session to
18:24that 42 and then we got to switch to
18:27that. And of course there's going to
18:28there's tons of caching and over time we
18:30have been changing the caching so that
18:33the caching is keyed by context [music]
18:36ID in the session. And so there's going
18:38to be uh some perhaps caching work
18:41[music] to make sure that the the cached
18:44information in the new course is not the
18:46cache information of [music] the old
18:47course. And so we may have to redesign
18:49some of the uh session caching. So
18:54don't make any changes. Let's kind of
18:55come up with a plan. Let's talk about
18:57that plan. Let's figure out what you
18:59think. And we've talked about this
19:01before. I don't know if you still
19:02remember it, but um and I think in our
19:07previous conversations, you were pretty
19:08confident that we could do this and I
19:10just chose not to do it on those days.
19:12And today is the day that we're going to
19:14give it a try. Maybe in a branch,
19:16[laughter] maybe we have to try several
19:18times, but let's give it a try.
19:23I'm going to copy this.
19:25Okay, send it. [laughter]
19:29Okay, some fans are turning on in some
19:32AI data centers. Yeah, we can switch to
19:33plan mode. Yes, let's do that. I'm going
19:36to grab this and paste that in. Oh, come
19:40on. Where was that [music] prompt?
19:46There we go.
19:50Save.
19:52I just put that on my desktop as
19:57context super prompt.
20:03I I may look at that later.
20:08So, here's the here's the interesting
20:10thing.
20:14Again, I I think of AI as a person
20:16that's
20:18not as architecturally clever as me.
20:22but is way more patient than me.
20:27Um, but let's just imagine that I'm
20:30talking to a human being
20:33and yeah, okay, it's looking at the
20:36parent site routing. That's good. And I
20:39just had that conversation with a human
20:40being like a graduate student that works
20:43for me or a software developer that
20:44works for me. They'd be like, "Chuck,
20:47you are crazy.
20:49I do not know enough about this Sugi
20:51code. I I can't I don't even know where
20:55to start.
20:57I
21:01And so I I I couldn't delegate this. I
21:04couldn't pay [music] I couldn't pay
21:06anyone an infinite amount of money to do
21:08this work. No matter how much money I
21:10had, no matter [music] how much time
21:11they had, I give that prompt to a human
21:13being and that human being is going to
21:15basically [music] reject the prompt.
21:17They're going to say, "No, that prompt
21:19is no good." Um, hey, it's working on
21:22caching me. I mentioned caching and I
21:24knew it was going to go look through the
21:25cache because it's [music] helped me
21:27build that cache and so it knows it. And
21:29that's one cool thing about AI building
21:31code is that means later AI can probably
21:34understand that code pretty well. Um, it
21:37may be slightly larger, not as kind of
21:39[music] tight, not as taut. Um, and it's
21:42easier to understand something some
21:44things going on. So I think that that's
21:45going to be uh important effect on code
21:48bases [music] over time.
21:52AI code is probably going to be bigger,
21:53but it's also going to be easier to
21:55understand [music] and much clearer in
21:56what it's doing because sometimes we
21:58programmers kind of have to really
22:01compartmentalize code that we do [music]
22:03um just for our own sanity, for our own
22:05sort of visual verification of what
22:07we're doing. We can't make them. But
22:09here's the thing. A normal programmer
22:12could have listened to that. here's a
22:14significant project we're working on
22:15prompt and would have rejected it and
22:17say can I work on [music] something else
22:19can I just do accessibility for a while
22:22um because the problem [music] is so big
22:25but with AI
22:28it didn't [music] say that
22:30it didn't say Chuck you're a fool that's
22:34a bad idea that is too hard [music]
22:37you should just not even build that and
22:39it and even worse you shouldn't take
22:41[music] up Sugi which has been active
22:43for 12 years and you shouldn't
22:45>> [music]
22:45>> um ask to change its internal mentality
22:48and data model so freaking much. It's
22:51crazy. You're going to break everything.
22:52Why should he even start this?
22:56AI never said that. I hit the enter key
23:00and all it said was, "Do you want to
23:01switch to plan mode?" And I go, "Yep,
23:02let's switch to plan mode."
23:04So AI doesn't know
23:08that this is a for all intents and
23:11purposes [music] impossible
23:14human task,
23:16right? This is an impossible task.
23:22What the sneakers?
23:30So, it is now drawing a picture of the
23:33new courses controller and it's using
23:36all of the examples.
23:39Yeah. Yeah.
23:42This is exactly what I told it. I'm not
23:45sure I want it to be.
23:58Is it going
24:04I think it's ready for me to talk to it
24:06again.
24:31Okay.
24:33Okay. Let me address some of [music]
24:35your issues. It is okay for this to not
24:38work after an LMS launch.
24:42It's perfectly okay for only a Google
24:44login. And we can literally in the
24:48courses controller check to see if this
24:51is a uh LTI launch from an LMS and not
24:57allow /courses to work. Uh just say
25:00look, this is an LTI launch. We're not
25:01going to do it. In terms of the [music]
25:03parent site change, um I'm not too
25:06worried about online.drch.com.
25:08I am uh [music] going to eventually
25:11change uh buildmenu.php. PHP in DJ4.
25:17Um, [music] and I'm I'm going to
25:19actually then put a parameter in and a
25:22and a setting that says, do you generate
25:24URLs in build menu.php that includes
25:27slashcourses or not? And so that [music]
25:30way I will be able to put this
25:33controller in and not reveal the
25:35controller to the average logged user uh
25:39right [music] away. So I can kind of
25:41test it for a while and leave the code
25:44kind of latent but not really expose the
25:46courses controller to any enduser
25:49navigation until I really want it to
25:52happen. And then I will probably only
25:54put it in when um with a a setting and
25:59maybe even for a particular user or
26:01maybe even for me.
26:10Let me just see.
26:55I want to talk about this.
27:37So, as you were talking and as you were
27:39thinking, uh, one thing that jumped
27:41[music] out at me from your comments and
27:44words, kind of watching them sideways,
27:47um,
27:49API [music] calls probably need to be
27:51visited. uh things like the uh
27:54announcements widget that then does an
27:56announcements API call. I'm guessing
27:58that's going to need a context ID as
28:00well. Um what do you think?
29:19So nested in page URLs uh should not
29:24generate slashcourses [music]
29:26slash id urls unless the configuration
29:29option is on.
29:39Is it working now?
29:43What is going on? How come the continue
29:44[music] is
29:56Oh, I see. I see. I see. Okay. It's
29:57asking me a multiple choice question.
30:00Okay. I think tool home already looks
30:03for announcements inside the request
30:04URI.
31:10I don't really understand the question,
31:16but I guess if we're coming in from a
31:18slashcourse of SL42,
31:22then those URLs should be generatable
31:25because this is a controller thing. It's
31:26not kind of a top level navigation
31:28thing.
31:38tool home already requests bath source
31:40of truth if you type courses course own
31:42links course. Yeah. Yeah. And it does do
31:45that that we did that on purpose months
31:48ago. I built that and I took the URL
31:51stand
31:53[music] prefix
31:55until config is on.
32:00Yeah,
32:02I agree that the configuration option
32:03mostly just changes [music] build menu
32:05rather than uh the internal function of
32:07the controllers. Once the controllers
32:10are being used with [music] the new
32:11format, they should stay with that new
32:13format.
32:21Again, beginners, do you even know what
32:23a controller is? Jesus,
32:26you've got to learn something. You got
32:27to take some classes.
32:30Can't not take classes and just vibe
32:32code your way into sophisticated
32:34software. Damn it.
32:40Controllers don't look at it. Yeah.
32:42Yeah. That I'm glad that that's
32:43architecturally elegant cuz if
32:46controllers were looking at it and sort
32:47of generating
32:50the cool thing is that whole prefix from
32:52the beginning I've had to make it
32:54flexible to look at what its base was.
32:56I'm sure stuff will break. [laughter]
33:01Lordy, lordy, lordy.
33:07I loved the multiple choice question,
33:13although
33:14it took a while to realize
33:18it was multiple choice.
33:28Okay,
33:37I think we understand each other pretty
33:38well. I think it's probably time to
33:40switch from plan mode to build mode and
33:42see how this baby works.
33:50So, let's go into GitHub. Let's go into
33:53the repo and see what we got.
34:06What are we building here? Okay, we
34:07haven't done nothing yet.
34:29Switch to agent.
34:39Where where'
34:43that file go?
35:08Switch the mode to agent.
35:23Jesus,
35:31don't freaking commit this.
35:56Okay, we we burned a lot of AI brain um
36:01on the plan mode and now we're building
36:03burning a lot of AI brain
36:06in the build mode.
36:24One thing it's been doing lately is it
36:26actually tries [music] to test the code
36:28in in itself, which confuses me.
36:35I'm just I'm going to pause for a
36:37second. And I'll be right back.
36:40Okay, we're back.
36:42It's still working. Don't know how long
36:45this is going to be.
36:52What are we doing here?
36:54Why is it digging so deep into
36:56announcements controller?
36:59Huh?
37:09Oh, maybe maybe it's just figuring out
37:12what a controller looks
37:15courses controller.
37:17See what it's doing on get.
37:23Okay, so we're on a branch courses
37:25controller, which is fine. I want it on
37:28a branch. I hope it doesn't just start
37:30committing wildly and pushing I don't
37:33know how I wish there were times where I
37:34could just like say, "Hey, I see where
37:37you're going."
37:42Okay, we're building courses.php.
37:47Here we go.
37:50Now, if all goes well, it will probably
37:59Where are my controllers at? Uh, it's
38:01going to be in source.
38:10Oh, we're already in source. Okay,
38:13source.
38:19There we go.
38:37What is this?
38:47Um
39:13what is sugot.
39:15Oh,
39:25now we're looking at code that I
39:31I didn't write.
39:34Oh, this is code I put in to kind of we
39:38put in to kind of do sanity checking.
39:42Of
39:48course it's controller.
40:18Okay,
40:23let's see what happens.
40:38Those are the courses that I'm currently
40:39a member of.
40:43That's courses seven.
40:45Now, unfortunately, the lessons don't
40:48follow very well.
40:52So, I [music] want to stay in Django for
40:53everybody.
40:57No.
41:02Oh.
41:39Something broke.
42:17Oh, d's just missing a database. base
42:20connection
42:28URLs emails.
43:02real Sugi launch. That seems like a
43:04weird place.
43:49Oh, look at that. Look at that URL
43:50staying the same.
44:05Oops.
44:17Oh, double slash.
44:44Damn it. Somehow I don't get that slash
44:46in there.
46:11Okay, this is kind of tricky. We'll see
46:12how it likes it. My goal here,
46:26the URLs
46:28generated
46:31by the discussions controller
46:36like this.
46:43Did you
46:49fix all the controllers
46:53in their URL generation
46:58to uh reflect
47:01slashcourses
47:0342
47:05dot dot dot
47:10Wow.
47:11Oh, you are
47:22[snorts]
47:45Right.
47:47It's not using tool home. That's kind of
47:49what I thought. Discussion is weird.
48:25I just checking stuff that it's
48:27currently using. I just I really wanted
48:29to explore it [music] use tool home
48:31instead.
48:42What are we doing here? What are we
48:44doing here?
48:50Whoa.
48:57Whoa. I don't like that. I don't like
48:59putting that in you.
49:24I don't like it.
49:27I don't like it. You was not supposed to
49:30He was not supposed to have anything sug
49:33Be specific in it.
49:47Stop
49:50undo all confirm.
49:55So I don't like your strategy of
49:57changing u.php. U.php should know
50:00nothing about sugi conventions. is just
50:02a bunch of beautiful PHP utility
50:06classes, not um a utility class for
50:09sugi. There might be some sugess in it.
50:12Um
50:14but but no, I would rather see you look
50:18at discussions.php and instead of using
50:21uh rest path uh just use tool home in a
50:24different way. Um, so I think the
50:26problem here is is discussions was
50:28originally a standalone LTI tool and so
50:30it used LTI tool conventions. It wasn't
50:34really a controller. I converted it from
50:35an LTI tool to a controller. And maybe
50:38we need to complete that conversion and
50:40teach the discussions controller how to
50:42use tool home better uh rather than
50:45changing U.PHP.
50:52My coffee is getting low.
50:56We're an hour in. I mean, it's going
50:59surprisingly well. There were always
51:01going to be little details.
51:05Okay. Okay. We agree. We're going to use
51:07tool home instead of rest path. I like
51:09that.
51:14Yeah.
51:53this launch controller.
52:00Okay.
52:18So what I'm doing now is we're kind
52:20[clears throat] of testing for no
52:20regressions
52:31cuz it'd be super cool if I Good.
52:59I'm just looking for regressions. Is it
53:01thinking? What are you doing up here?
53:03Still thinking
53:19cuz I would love to be able to put some
53:21of this like code and have it be
53:24unrevealed in production, but have it
53:26sit there. Um
53:31so that I can know that this new routing
53:34capability
53:36um
53:38didn't
53:42this new routing capability didn't um
53:46regress anything.
53:48Discussions already tested that.
53:52Let's try something. Let's do a thread.
54:00Okay, done.
54:04Badges
54:06progress.
54:13Do we not have badges in this
54:18profile?
54:47What are we doing back here?
54:51Okay.
54:56Okay. See what we got.
55:09I don't have the navigation there yet.
55:25Oh, did it work? It worked. It worked.
55:26It worked. Okay, so that worked. Okay,
55:31keep all I'm liking it.
55:59Do any of the controllers in particular
56:03lessons.php [music]
56:05suffer from
56:07Nope. Nope. Nope. Nope.
56:16Do any of the controllers suffer from
56:18the same problem of discussions that
56:20they were formerly LTI tools [music]
56:23that were brought in and maybe they are
56:25parsing paths incorrectly. Just by
56:27looking at them, I don't see them any
56:29other controllers that used to be LTI
56:31tools right now. A lot of those former
56:34LTI tools were pulled [music] into the
56:35/LTI folder, but they're still LTI tools
56:38at this point. Anything in controllers
56:40that looks like it might be a problem.
56:47Lessons was always a nonLTI.
56:52What do we got here?
56:57Okay, looks like it
57:00I hit the go button too fast, but it's
57:02doing the right thing. It's looking
57:03through all these controllers and seeing
57:05if any of them have um generating
57:09internal URLs using [music] the old
57:10thing. What do we get changed here?
57:17Oh, that's a little scary.
57:30We'll have to review that.
57:44Yeah,
57:46that code looks a little funky, but it
57:47was there, I think. Yeah.
57:57Okay, we're good.
58:00We're good.
58:06Um,
58:23please summarize for me whether or not
58:26you think that the context [music] per
58:30context caching is going to work.
58:31Meaning, have we already made all the
58:34context caches
58:36uh work with current context ID, whether
58:39it be in this session or um from
58:45I mean
58:48Stop.
59:07So briefly explain for me when we are
59:11using a /courses/42/announcements
59:15how the tool runs in a way that it knows
59:20what the context ID [music] is. Is it no
59:22longer in the session at that point? Is
59:24it somehow in the controller as the
59:27current context ID? I know that we made
59:30some util code [music]
59:31that um gets the current context ID. Um
59:36and it and it has to do with the fact
59:38that eventually I want to run in
59:39multiple tabs with different context
59:42IDs. [music] So switching from one
59:44context to another can't just switch the
59:46context ID in the session. It has to do
59:50something else. So how does that work?
59:55It's not listening.
59:58What the heck?
1:00:02Hi there.
1:00:06It's not listening.
1:00:20We are good.
1:00:23You checked
1:00:25what I wanted to be checked. Thanks.
1:00:35Okay.
1:00:41So at runtime when we ask what the
1:00:43current context ID is uh like for
1:00:46example to look up some cache
1:00:48information
1:00:49I'm pretty sure most of our context
1:00:51related caches [music]
1:00:53are indexed by context ID so they're
1:00:55ready for multiple contexts already. Um
1:01:00the question is at runtime when we are
1:01:03in [music] a controller that's using a
1:01:05/courses/ ID
1:01:08um how does it know that ID is the one
1:01:11to use when it's doing cache lookups for
1:01:13things like [music]
1:01:13current grades etc.
1:01:46Hang on.
1:02:43So, how is it going to work when we have
1:02:49two tabs? tabs with different course IDs
1:02:51[music] in the two tabs. And we kind of
1:02:53hit uh hit something like a submit
1:02:56button at the same time.
1:04:16So what you're saying is in multiple
1:04:18tabs that use [clears throat] different
1:04:20course IDs those are being put into the
1:04:22session but for for all intents of
1:04:25purposes the locking of the session
1:04:27means that they [music]
1:04:28ultimately will be serialized and of
1:04:30course you're not going to hit both of
1:04:31the submits at the same time. So
1:04:33serialization makes sense and the fact
1:04:35that we're kind of uh the context ID is
1:04:38kind of thrashing in the session [music]
1:04:40is really not all that significant.
1:04:52Yeah. Okay.
1:05:13Yes. If you uh switch away from a
1:05:15slashcourses prefixed URL to just
1:05:18slashcourses,
1:05:19uh then you kind of take what you get.
1:05:43Yeah, that's completely predictable. You
1:05:45know, if you go without the slashcourses
1:05:47prefix, [music] you get last course ID
1:05:49wins and uh that users would understand
1:05:52that.
1:05:55Ah, why isn't it working?
1:06:12Yes, using session leftover is kind of
1:06:15imagining predictability, right? Um, and
1:06:19given that we're going to be eventually
1:06:20making all of the top level navigation
1:06:24uh links relate to slashcourses/ ID, uh,
1:06:29then it'll be really hard to find your
1:06:30way to slashcourses, I mean to
1:06:33slashannouncements
1:06:34with no prefix.
1:06:42Okay.
1:06:50Yeah. Yeah.
1:06:55Okay. I want to tweak the uh
1:06:57configuration setting just a little bit.
1:07:00I do not want to make a brand new
1:07:02configuration [music]
1:07:02setting. Uh this is in effect a pretty
1:07:06temporary configuration [music] setting
1:07:08that's just going to be used on a few
1:07:09sites for a little while. So I want to
1:07:11use the set extension get extension
1:07:13pattern instead of a whole new uh
1:07:16[music] configuration value.
1:07:35Let's go take a look at config info.php.
1:08:46So, is this documented anywhere now that
1:08:49we've removed that code?
1:09:51So let's summarize all this work in a
1:09:55file under Sugi docs. Sugi/doccks.
1:09:59Um, and let's [music] kind of summarize
1:10:01what's going on, summarize the concepts
1:10:04of it, summarize the philosophy of it.
1:10:07Um, don't get too detailed. Don't like
1:10:09list every change. [music] Just kind of
1:10:12list
1:10:13how it kind of works.
1:10:18But
1:10:23hi there.
1:10:26So I want to write some documentation in
1:10:28sui/doccks
1:10:30that summarizes this kind of evolution
1:10:32of the codebase something like readme
1:10:37uh course routing or something like that
1:10:39that summarizes this documents the uh
1:10:42the the set extension get [music]
1:10:44extension talks about the philosophy
1:10:47walks through a little bit how the
1:10:49controllers have been uh taught [music]
1:10:52to set the course uh what happens during
1:10:55course switches, what happens during
1:10:56multiple tabs. Don't go in like gory
1:10:59detail like every diff. Don't just
1:11:01[music] kind of explain what we've done
1:11:04so that I can remember it and future AI
1:11:06sessions can remember it.
1:11:37Please
1:11:38write that as a markdown file in
1:11:42sugi/doccks.
1:11:55Why are you looking at composer? Oh,
1:11:57it's reading this docs file. Okay,
1:12:01there we go. That's what I want to see.
1:12:16liking that.
1:12:52Okay.
1:13:01Okay.
1:13:04Let's do something crazy.
1:13:08Let's alter
1:13:10build menu.php
1:13:14in the parent folder, which should be
1:13:16the DJ free folder, and have it look at
1:13:19the two configuration options, and have
1:13:23it generate URLs that have courses
1:13:27prefixes. If there is a [music] context
1:13:30ID
1:13:37in the session,
1:13:41although I'm wondering if there's going
1:13:43to be a timing problem
1:13:46because
1:13:48the context ID in the session depends on
1:13:51the controller for the courses and the
1:13:53courses controller won't run until after
1:13:57build menu happens, I think, [music]
1:14:00unless of course we've got build menu
1:14:02running as part of the output header
1:14:07creation. So, check that timing stuff
1:14:09out and let me know what you think.
1:14:14Oh, this is crazy.
1:14:17Again, that's a that's a really [music]
1:14:19complex instruction to a mid-level
1:14:22developer.
1:14:35cuz I think it's going to work. I think
1:14:38it's going to dispatch the controller
1:14:39[music] and then the controller is going
1:14:41to call call topnav just as what it's
1:14:43figuring out right now. And by the time
1:14:46nav runs, we'll have the real context ID
1:14:49will be correct.
1:14:51Let's hope.
1:14:55This is my inversion and control stuff
1:14:56that I built 15 year 14 years ago.
1:14:59[laughter]
1:15:00Um, some people don't like it, but the
1:15:03notion of a topnav [music] call back. I
1:15:05I stole some of this architecture from
1:15:07what I see as in WordPress and it's a
1:15:10[music] it's a kind of a PHP thing of uh
1:15:12so much callbacky stuff.
1:15:15Um,
1:15:17here we go.
1:15:20Timing is fine. Topnav runs.
1:15:25Okay, so it's messing with build
1:15:27menu.php. Oh boy. Oh boy. Oh boy. Oh
1:15:30boy. Let's go take a look at what it's
1:15:32doing because it's not going to show up
1:15:33here.
1:15:37Ah.
1:15:42Get status.
1:15:47Get if
1:16:07I don't think
1:16:39I'm just doing it.
1:16:50Whoops.
1:16:54So,
1:16:58so looking at that code,
1:17:02not working.
1:17:06So,
1:17:08so looking at that code, it's pretty
1:17:09clear that home is the non prefixed uh
1:17:13URL for things like login, logout, and
1:17:15profile, right?
1:17:33So the dollar home variable is the
1:17:36non-prefix URL for things like login,
1:17:39log out, and um profile.
1:17:47I guess I got to I got to pause. I can't
1:17:50just I can't hit that go button so fast.
1:17:56Okay. Well, let's just test it. Let's
1:17:58[music] see what we got here.
1:19:06So I don't get it.
1:19:21Don't get it.
1:19:48I'm confused. Okay.
1:20:13Huh?
1:20:45Huh?
1:20:48So this is not working.
1:21:05I think that it would be better
1:21:09to check the extension
1:21:15values [music]
1:21:16and when
1:21:18the extension
1:21:20is on
1:21:23always
1:21:25generate
1:21:28the slashcourses
1:21:3042 versions of the nonome
1:21:35urls.
1:21:54Did I Did I remove that dye thing?
1:21:58Yeah. Get out of there.
1:22:02I'll be right back.
1:22:08Okay, back. Let's see what we got.
1:22:20Okay, that's working better.
1:22:38Cool.
1:22:56When I go to
1:23:00to launches
1:25:29Okay. [sighs]
1:25:32What's going on in my head right now is
1:25:34I'm
1:25:36like, "Holy mackerel.
1:25:41It's kind of working."
1:25:47So, let's change config.php to turn
1:25:49[music] the extensions off. Leave them
1:25:51in there. Um, but just turn them to
1:25:53false so that I can test to make sure
1:25:56that, um, all this code doesn't regress.
1:26:01um so that I can sort of put it in and
1:26:03potentially [music] have it be latent
1:26:05for a while um in production.
1:26:09So turn them off in config.php, keep
1:26:12them in config.php [music]
1:26:14um so I can test
1:26:48Oh, wait. No, wait.
1:26:57Oh, wait.
1:26:59To Sugi settings.php was way better
1:27:02place to put that. So, take it out of
1:27:04config.php, ignore [music] it in
1:27:06config.php, and just put it back into
1:27:08Suki settings.php, but then set them all
1:27:11to false for me.
1:27:17Let's go here. Get status.
1:27:30Get status.
1:27:33Get diff.
1:27:35Sugi settings.
1:28:13I don't Think
1:28:31okay. So now I should be testing this.
1:28:36Go here.
1:28:38We should all be naked. They are naked.
1:29:18So map works.
1:29:42There's the map guy.
1:29:56Is the map controller something that is
1:30:00per context?
1:30:05I see how I've got to pause there just a
1:30:07bit [music] to let it take the last
1:30:08sentence I write and then combine it all
1:30:10into one uh big long thing.
1:30:53But how does it get the other users on
1:30:56the map? Does it get those other users
1:30:58on the map from
1:31:02the current con? Ah, it's not working.
1:31:08Hi.
1:31:10So, how does it get the rest of the
1:31:11users on the map? Does it get the rest
1:31:13of the users in the context or get all
1:31:15the users in the system?
1:31:50Okay. I'll leave that alone for now. But
1:31:53I I think that someday I'll let me think
1:31:55it through walking around. But I
1:31:58it's his profile
1:32:01and profile is the per current logged in
1:32:04user
1:32:06and it's the system. But I got to think
1:32:08it all through. So let's leave it be the
1:32:10way it is.
1:32:29So,
1:32:32let's do a final code review. Um, and I
1:32:35really [clears throat] want to try to
1:32:36put this branch into production without
1:32:40setting the extensions to true and test
1:32:46to make sure that there are no
1:32:48regressions for the nonp prefixed URLs.
1:32:53Um, I've been doing testing and my
1:32:55testing seems to work pretty well. Uh
1:32:59could you take a quick review of what it
1:33:01is that we've done and see what you
1:33:03think about uh this being a
1:33:06regressionfree modification?
1:33:13So one thing I'm going to do here
1:33:16is make a tag.
1:33:19And so I make I'm going to make a new
1:33:21release. [music] So at 2682
1:33:24um
1:33:27going to make a new release
1:33:33create new tag 26.8.2 [music]
1:33:36two. So, one of the things I do for tags
1:33:39is um pre/courses
1:33:43controller
1:33:48as we add the courses controller,
1:33:55but keep it latent.
1:33:59We need a quick
1:34:02jump backwards point.
1:34:06The initial courses work
1:34:11should be latent
1:34:14and hidden
1:34:16until it is activated.
1:34:26Until it is activated
1:34:30in the build menu.php PHP process
1:34:35in the parent site.
1:34:55Okay.
1:35:03Okay. So, so now we have
1:35:072682 [music]
1:35:09and 2681,
1:35:13right?
1:35:16Oh, okay. That's fine. That's fine.
1:35:43APIs behave nested unprefixed stays
1:35:46quiet.
1:35:54Yeah.
1:36:12Yeah.
1:36:15Yeah.
1:36:40Should
1:36:54we fix
1:37:19It's going to be a launch controller
1:37:24topics.
1:37:27Topics is really just a copy of lessons.
1:37:31It's kind of not the it's not the best
1:37:34feature. I came from Dayton
1:37:38But we'll cool. We'll drag it along.
1:38:01Opex
1:38:04launch controller.
1:38:15Oh, those labs. Did I do Did I make
1:38:26Okay.
1:38:34topics
1:38:42file.
1:38:43Might as well take a peek.
1:39:47Okay, we'll keep those.
1:39:51Okay.
1:40:15What is all this?
1:40:58Oh. is is coming up on 2 hours.
1:41:06I'll get this. Okay.
1:41:25Oh, okay. Okay.
1:41:40Okay. Okay.
1:42:12Good status.
1:42:34Okay. Oops. Come back.
1:42:39Okay. I think this is good enough to do
1:42:42a uh commit and push into a branch. in
1:42:47the uh upstream repo.
1:43:16Okay. So, it is now up in a branch.
1:43:35I'm going to do a quick get checkout
1:43:37master.
1:43:50Okay. So, I'm just checking to make sure
1:43:53that my DJ free [music] changes
1:44:00don't break anything.
1:44:10Just run a quick smoke test that the DJ
1:44:12[music] for that the DJ free changes can
1:44:16work on the old version of Sugi in the
1:44:18that's in master.
1:44:23Oh, I got to log in.
1:44:34Nice.
1:44:38Let's check a few things [music] here.
1:44:49Simons.
1:45:44Okay.
1:45:50Okay. Time to wrap up. So,
1:45:55when I started this video, I wasn't sure
1:45:57that I was going to publish it. It's
1:45:59almost two hours now. Um,
1:46:03we used AI to do something that I'm not
1:46:06sure I could have done without AI. Um,
1:46:09because it would have taken me I I mean,
1:46:11I've been working up to this feature.
1:46:12There's lots of things that, as you
1:46:14noticed, like um context scoped caching.
1:46:17I put that in knowing eventually I was
1:46:20going to do this uh context ID switching
1:46:22thing. so [music] that the caches
1:46:24wouldn't be corrupted. I'm going to have
1:46:25to review that a bunch to make sure that
1:46:27it's really still right the way I want
1:46:28it to be. Um, once I move Sugi from a
1:46:32single context mentality to a
1:46:34multicontext and context switching
1:46:36mentality, uh, I'm just going to have to
1:46:38test that a lot. And that's why I've got
1:46:40you heard me thinking about like leave
1:46:42it latent, leave it latent, [music]
1:46:44let me test, uh, in let me let me run
1:46:46production with that code in latent mode
1:46:48[clears throat] so I know it's not
1:46:50doesn't do regressions. [music]
1:46:51So, I'm testing the lack of regressions
1:46:53for a lot longer than I am going to
1:46:55well, first I'll test the lack of
1:46:57regressions and then I will uh start
1:47:00turning these features on a little tiny
1:47:02bit at a time to see what's going on.
1:47:05Um, [music]
1:47:06and so,
1:47:08uh, you know, again, uh, AI allowed me
1:47:12to do something this [music] morning
1:47:13that, uh, on one cup of coffee that I
1:47:16would have probably taken a week to 10
1:47:18days of uninterrupted concentration for
1:47:20me to do. And given [music] how few week
1:47:24to 10 days of uninterrupted
1:47:25concentration I get, uh, it wouldn't
1:47:27have been possible. And so, uh, that's
1:47:30exciting. Um, and again, I'll refer back
1:47:33to my my learning objective. Um, there
1:47:38are three personas that I'm aiming these
1:47:40videos at. One is um really great AI
1:47:45people like Chuck and Anthony [music]
1:47:47and other people who are just and and
1:47:49and Sam, Kunal, all the people that I
1:47:53look up to and Earl in the AI world and
1:47:57[music] I I always assume they use AI
1:47:59way better than me. So those are the
1:48:01people I look to to
1:48:03learn from when I'm ready. I mean right
1:48:05now I'm really happy. And then there are
1:48:07people like me, kind of mid-tier
1:48:09software developers that uh um well
1:48:13upper middle tier software developers
1:48:14that are using AI kind of like me with
1:48:17cursor and not building agents that
1:48:19[music] talk to each other in chat
1:48:21rooms. Um but then also students who are
1:48:25wondering if AI makes programming
1:48:27obsolete. [music] And again, the lesson
1:48:29I want you to take from this if you're
1:48:31deciding whether or not to take a
1:48:32software development class is you should
1:48:34take a software development class
1:48:36[music] cuz the conversations that you
1:48:37have with AI to build real complex
1:48:40production industrial-grade software,
1:48:42the conversations are so complex and all
1:48:46of my friends who are like vibe vibe
1:48:47vibe, they just don't. The smartest
1:48:50people I know pre-ai
1:48:54are also the smartest people [music] I
1:48:55know with AI. I have never seen nor met
1:49:00[music] someone who wasn't very very
1:49:03smart
1:49:06doing the kinds of things that very
1:49:08smart programmers can do with AI, but a
1:49:11notsmart person can do those things. And
1:49:13[music] again, it's because AI is a
1:49:15conversation between people hopefully
1:49:18with equivalent understanding of the
1:49:19world. I have enough understanding to
1:49:22have a valid conversation with AI. If
1:49:25you're a beginner and you've never even
1:49:26taken a single Python class, you don't
1:49:28know what to say. You've just dropped
1:49:30into a world that's like a foreign
1:49:33language and you're like, "Taxi."
1:49:36[music] Now, good news, taxi is
1:49:39universal across many languages, but
1:49:41you're asking like, "Um,
1:49:45what day of the week do the trains run
1:49:49to Paris?"
1:49:51and you're talking in a language that
1:49:53they don't understand. So, well, I'm out
1:49:56of coffee
1:50:00and uh so if you got this far, which I
1:50:02don't think anybody did, um I'm looking
1:50:05forward to the
1:50:08future things that this enables [music]
1:50:10in Sugi. Um this is the beginning of
1:50:12Sugi turning from a an a 70% LMS into
1:50:17100% LMS. [music] And uh and that's a
1:50:20really exciting moment for me because I
1:50:21have been laying the groundwork in Sugi
1:50:23for a long time for this to work. This
1:50:26whole courses URL is something that I've
1:50:28been sort of sneaking up to kind of like
1:50:31summiting Everest. You have base camps
1:50:33and you get resources at base [music]
1:50:35camps and so this has been in the plan
1:50:37all along. I'm just finally doing it. So
1:50:41you'll see more work on Sugi. I haven't
1:50:44been working on it in a while, but part
1:50:46of it I needed to get ready to summit.
1:50:47And you have to pick the right weather
1:50:49to summit. Uh, so if you got this far,
1:50:52like, share, subscribe, visit
1:50:56drchuck.jango,
1:50:57uh, jango.drchchuck.com
1:50:59or udei.duck.com drchuck.com to see
1:51:02[music] my latest and craziest online
1:51:06course operate op course inventions
1:51:09because I'm always changing not just the
1:51:11technology [music] for educational
1:51:12technology but also just how we teach
1:51:15with that technology. Cheers.