WEBVTT
1
00:00:01.080 --> 00:00:03.799
How'd you like to listen to dot NetRocks with no ads?
2
00:00:04.440 --> 00:00:04.799
Easy?
3
00:00:05.320 --> 00:00:08.560
Become a patron for just five dollars a month you
4
00:00:08.599 --> 00:00:11.320
get access to a private RSS feed where all the
5
00:00:11.359 --> 00:00:14.560
shows have no ads. Twenty dollars a month will get
6
00:00:14.599 --> 00:00:17.679
you that and a special dot net Rocks patron mug.
7
00:00:18.160 --> 00:00:34.960
Sign up now at Patreon dot dot NetRocks dot com. Hey,
8
00:00:35.079 --> 00:00:38.960
welcome back to dot net Rocks episode two thousand and four.
9
00:00:39.119 --> 00:00:43.640
I'm Carl Franklin at Averagre Camra and Scott Sobers here.
10
00:00:43.640 --> 00:00:45.039
We're going to be talking to him in a minute,
11
00:00:45.039 --> 00:00:47.479
but you might hear him jump in on the intro here,
12
00:00:47.560 --> 00:00:49.640
because that's what we do now, right.
13
00:00:49.719 --> 00:00:52.920
Yeah, go to be at least for the next twenty
14
00:00:53.000 --> 00:00:56.479
or so episode, right, yeah, right, twenty two. I'm a
15
00:00:56.479 --> 00:00:59.560
little stressed about actually getting to the current history.
16
00:00:59.799 --> 00:01:02.200
Well well you know the shows won't have that wonderful
17
00:01:02.280 --> 00:01:06.040
intro again. Well we'll do something, but all right, something.
18
00:01:06.159 --> 00:01:09.799
I regret to inform everybody that I've got another cold
19
00:01:10.439 --> 00:01:13.959
luck at you and the gig tomorrow. Nice, just like
20
00:01:14.239 --> 00:01:17.560
last time. Save your voice, brother, Yeah, I'm gonna save
21
00:01:17.599 --> 00:01:18.159
it all.
22
00:01:18.159 --> 00:01:19.599
Right, A I fixed up?
23
00:01:19.840 --> 00:01:25.359
Or no, you know the best line when I get
24
00:01:25.439 --> 00:01:28.640
up on the microphone with the band is thank you
25
00:01:28.680 --> 00:01:32.840
for coming tonight. And tonight's show has absolutely no AI
26
00:01:33.079 --> 00:01:37.040
and people lose their minds, they roar, I'm sure, all right.
27
00:01:37.079 --> 00:01:40.159
So being two thousand and four, let's talk about the
28
00:01:40.200 --> 00:01:43.719
top events or the news events, the major news events
29
00:01:43.719 --> 00:01:47.359
so that year, unfortunately, we'll start with the Indian Ocean
30
00:01:47.359 --> 00:01:50.640
earthquake and tsunami. And we remember that, Yeah, I did.
31
00:01:50.680 --> 00:01:52.599
We did a bunch of fundraising for that, that's right.
32
00:01:52.680 --> 00:01:56.400
I remember Julie Lherman kind of spearheaded that she.
33
00:01:56.400 --> 00:02:01.359
Had friends in Bandahar right and needed help. Yeah, so
34
00:02:01.519 --> 00:02:03.680
they happened to be there. We're just wrapping up a
35
00:02:03.719 --> 00:02:06.959
charitable project when the tsunami and everyone needs a lot
36
00:02:06.959 --> 00:02:09.479
of help, and so we all dove in. We did
37
00:02:09.840 --> 00:02:13.199
a bunch of eBay auctions for time and resources and
38
00:02:13.240 --> 00:02:14.680
things like that and raised a lot of money.
39
00:02:14.759 --> 00:02:16.639
I think this might was am I wrong? Or is
40
00:02:16.680 --> 00:02:19.960
this one of the events that got you to consider
41
00:02:20.080 --> 00:02:21.919
doing the your charity?
42
00:02:22.120 --> 00:02:25.280
Yep, it's one of the catalysts of H two Box
43
00:02:25.439 --> 00:02:28.479
was watching what Julie was able to do, like she's
44
00:02:28.520 --> 00:02:29.840
such an inspiration mm hm.
45
00:02:30.400 --> 00:02:34.919
And we're talking about the humanitarian toolbox that Richard spearheaded. Okay,
46
00:02:35.000 --> 00:02:39.800
the Iraq war an insurgency escalation, So it didn't go
47
00:02:39.840 --> 00:02:40.479
well at first.
48
00:02:40.919 --> 00:02:44.879
No, Sadam is now gone right at that point, and
49
00:02:44.919 --> 00:02:48.199
now that comes the whole you broke it, you bought
50
00:02:48.240 --> 00:02:49.240
it phase.
51
00:02:49.159 --> 00:02:52.840
M Yeah, the Abu Grab prisoner abuse scandal. That was
52
00:02:52.879 --> 00:02:53.400
pretty bad.
53
00:02:53.719 --> 00:02:53.800
Ye.
54
00:02:54.240 --> 00:02:57.639
Madrid train bombings I remember this, Yeah, killed one hundred
55
00:02:57.639 --> 00:03:00.479
and ninety three people. I don't remember it having that
56
00:03:00.599 --> 00:03:03.840
big of a casualty number, but I guess it did.
57
00:03:04.439 --> 00:03:08.479
Trains are packed. Yeah, it was a right. Some more
58
00:03:08.520 --> 00:03:15.080
bad news. Darfur conflict escalated, big humanitarian crisis in Sudan.
59
00:03:16.280 --> 00:03:19.639
In the US, the presidential election of two thousand and four,
60
00:03:19.840 --> 00:03:22.919
George W. Bush defeated John Carry to win a second term.
61
00:03:23.280 --> 00:03:27.520
This September Eleventh Commission Report, which was a detailed report
62
00:03:27.560 --> 00:03:31.159
on the nine to eleven tax, the US Patriot Act
63
00:03:31.360 --> 00:03:36.400
reauthorization debates, so people were debating over civil liberties versus
64
00:03:36.560 --> 00:03:41.479
national security. NSA was big. And I remember interviewing Christian
65
00:03:41.520 --> 00:03:46.840
Bayer and he said NSA stands for no security anymore.
66
00:03:50.319 --> 00:03:54.120
Same sex marriage got legal in Massachusetts. Yeah, Mars. The
67
00:03:54.199 --> 00:03:58.240
Stewart went to jail. Yeah, and it wasn't even that much.
68
00:03:58.280 --> 00:04:00.919
It was like thirty grand or something something like that. Yeah,
69
00:04:00.960 --> 00:04:05.199
but insider trading is insider trading. The controversy over Mel
70
00:04:05.240 --> 00:04:09.039
Gibson's The Passion of the Christ boy, Oh Boy. And
71
00:04:09.280 --> 00:04:11.599
speaking of other movies, let's go through the top ten.
72
00:04:13.000 --> 00:04:17.360
National Treasure, which was a great fun movie. Nicholas Cage,
73
00:04:17.639 --> 00:04:21.120
Nicholas Cage. Yeah, Ocean's twelve, a bad Colooney, which was
74
00:04:21.160 --> 00:04:23.680
great at all. Think it was still pretty good. Shark Tale,
75
00:04:23.720 --> 00:04:25.399
which I never saw.
76
00:04:25.560 --> 00:04:27.000
But well you're not you don't have the little kids
77
00:04:27.000 --> 00:04:27.439
at that point.
78
00:04:27.519 --> 00:04:29.720
Well that's true, but I kind of still watched these
79
00:04:29.839 --> 00:04:34.279
big ones. Troy epic retelling of the Trojan War starring
80
00:04:34.279 --> 00:04:37.959
Brad Pitt. Brad Pitt is a gladiator. All the women's
81
00:04:38.000 --> 00:04:45.000
loved it. Day The Day after Tomorrow. I don't remember
82
00:04:45.040 --> 00:04:48.240
that one, but it was like a change global disaster film.
83
00:04:49.000 --> 00:04:51.199
And of course The Passion of the Christ to number five,
84
00:04:51.279 --> 00:04:53.759
The Incredibles number four. I did watch that and it
85
00:04:53.879 --> 00:04:58.600
was fun, fantastic, It was fun. And you know, my
86
00:04:58.680 --> 00:05:00.720
youngest daughter was only two years old, so I was
87
00:05:00.759 --> 00:05:05.920
watching these kind of things. Spider Man two. Okay, how
88
00:05:06.040 --> 00:05:08.680
much to say about that? Harry Potter and The Prisoner
89
00:05:08.759 --> 00:05:14.759
of Azba Khan Azkaban oz Kban. This is number two,
90
00:05:14.759 --> 00:05:17.240
and the number one grossing movie of two thousand and
91
00:05:17.279 --> 00:05:21.839
four is Shrek two. Yay, Shrek It again, Shrek and
92
00:05:21.920 --> 00:05:25.639
again and wow, I think Shrek and.
93
00:05:27.439 --> 00:05:28.959
Is it? Yeah?
94
00:05:29.199 --> 00:05:32.000
Shark Tail and Shrek were both from DreamWorks. Yeah, and
95
00:05:32.040 --> 00:05:34.399
they're both the number one, well in the top ten
96
00:05:34.560 --> 00:05:35.079
of that year.
97
00:05:35.480 --> 00:05:42.240
Awesome. Interesting forget what about Action's Janet Jackson's wardrobe malfunction.
98
00:05:42.439 --> 00:05:48.639
Wardrobe malfunction, Yes, at the at the power at Super Bowl. Yeah,
99
00:05:48.639 --> 00:05:50.240
we don't even remember the year, but that's what happened.
100
00:05:50.360 --> 00:05:53.160
The funniest part about that was her interview on Letterman
101
00:05:53.920 --> 00:05:57.240
the next day or whatever, and she was like, it
102
00:05:57.480 --> 00:06:04.560
just happened. I don't know, so I don't know. You
103
00:06:04.600 --> 00:06:07.959
guys got anything. I know, Richard, you've got space and technology.
104
00:06:08.000 --> 00:06:10.199
But Scott, do you remember anything about two thousand and
105
00:06:10.240 --> 00:06:11.079
four you want to share?
106
00:06:11.319 --> 00:06:14.319
Ah, Man, I don't know anything off hand. I mean
107
00:06:14.319 --> 00:06:17.439
I would have been a junior in high school at
108
00:06:17.439 --> 00:06:22.000
the time, but yeah, well that's an event. Yeah, it's
109
00:06:22.120 --> 00:06:24.040
almost done with high school all right, tell us about
110
00:06:24.040 --> 00:06:24.680
space and tech.
111
00:06:24.720 --> 00:06:27.279
Well, we're in the midst of the Columbia accident investigation.
112
00:06:28.079 --> 00:06:30.079
Columbia was lost in two thousand and three, so there's
113
00:06:30.120 --> 00:06:33.040
no Shuttle flying that year while the investigation's ongoing, and
114
00:06:33.079 --> 00:06:36.560
that means no additional building of the International Space Station easier.
115
00:06:36.639 --> 00:06:39.079
So the Russians are supporting the space station with progress
116
00:06:39.079 --> 00:06:42.480
and so used flights to bring cruise down. But there's
117
00:06:42.480 --> 00:06:44.399
plenty of other things going on at the time. The
118
00:06:44.839 --> 00:06:48.240
Stardust mission in January actually reaches Comet eighty one p
119
00:06:48.480 --> 00:06:51.800
wild and collects dust from a comet, which was its
120
00:06:51.839 --> 00:06:54.680
mission to return to the Earth, which is cool. Also
121
00:06:54.680 --> 00:06:59.439
in January, the Spirit Rover lands at the Gustev crater.
122
00:07:00.040 --> 00:07:04.439
Month later, the Opportunity Rover at Murdi and planum So
123
00:07:04.600 --> 00:07:09.600
and Nose rovers were designed to operate for ninety days. Yeah,
124
00:07:09.639 --> 00:07:12.560
and one lasted nine years and the other lasted fourteen.
125
00:07:13.040 --> 00:07:17.720
So for a variety of reasons, mostly to do with
126
00:07:18.120 --> 00:07:21.399
they got really good at understanding how the very thin
127
00:07:21.560 --> 00:07:25.480
atmosphere can actually kick up enough wind to blow the
128
00:07:25.600 --> 00:07:28.319
dust off the solar panels, and so they're able to
129
00:07:28.360 --> 00:07:30.959
keep clearing the solar panels off and keep the machines running.
130
00:07:31.199 --> 00:07:34.600
They loose spirit first, because it'll get stuck in sand
131
00:07:35.120 --> 00:07:38.000
at the wrong angle and ultimately we'll run out of power.
132
00:07:38.240 --> 00:07:40.160
The issue here for them primarily is to make sure
133
00:07:40.199 --> 00:07:43.240
they charged with the batteries enough to last overnight, because
134
00:07:43.279 --> 00:07:45.439
it gets very cold at night and equipment will freeze,
135
00:07:45.720 --> 00:07:47.560
and so you need to charge the batteries off solar
136
00:07:47.560 --> 00:07:50.560
panels to generate enough heat to be operational the next day,
137
00:07:50.639 --> 00:07:53.560
and so you're positioning before nightfall is super important.
138
00:07:53.560 --> 00:07:56.639
I remember doing a bit with Professor Schmackel on Mondays,
139
00:07:56.680 --> 00:07:59.240
which also started in two thousand and four. By the way,
140
00:07:59.319 --> 00:08:02.920
goodness forgot I left that one off the cultural list, Yeah,
141
00:08:03.120 --> 00:08:08.319
such as it is counter cultural, but yeah, I do
142
00:08:08.439 --> 00:08:10.040
remember that that happened.
143
00:08:10.040 --> 00:08:13.519
That was a big deal. Yeah. Also in two thousand
144
00:08:13.519 --> 00:08:16.319
and four, in June, the first flight of Spaceship one.
145
00:08:16.439 --> 00:08:20.279
This was Bert Rutan's technology trying to capture the Ansari prize.
146
00:08:20.480 --> 00:08:22.240
It's a subordable flight, but it does get above the
147
00:08:22.319 --> 00:08:25.480
Carmen line, and so Mike Melville becomes the first civilian
148
00:08:25.480 --> 00:08:29.160
astronaut ever in order to win the and sorry, prize,
149
00:08:29.279 --> 00:08:31.279
we'll have to do it again, which he will in
150
00:08:31.319 --> 00:08:37.240
September and so demonstrate that a reusable spacecraft. I mean,
151
00:08:37.240 --> 00:08:40.200
it's funny to think about, but in two thousand and
152
00:08:40.200 --> 00:08:42.240
four was an incredible breakthrough. Yeah.
153
00:08:42.399 --> 00:08:45.559
Wasn't the Shuttle supposed to be a reusable spacecraft? Is
154
00:08:45.600 --> 00:08:46.639
that what you're laughing about?
155
00:08:46.799 --> 00:08:49.720
Yes, it's also government not civilian. Yeah, And that was
156
00:08:49.759 --> 00:08:52.679
the whole point. Was privately funded, and that private funding
157
00:08:52.759 --> 00:08:56.600
was mostly Paul Allen. In July, the Cassini spacecraft, this
158
00:08:56.879 --> 00:09:01.000
bus size spacecraft flying to Saturn, reaches Saturday and gets
159
00:09:01.320 --> 00:09:03.120
into orbit round surround, the first thing to ever go
160
00:09:03.200 --> 00:09:06.080
into orbit around Saturn. And by December we'll release the
161
00:09:06.159 --> 00:09:09.159
Huygens probe onto Titan, the first time we'll ever soft
162
00:09:09.240 --> 00:09:10.919
land and the only time so far was soft landed
163
00:09:11.000 --> 00:09:11.679
anything on Titan.
164
00:09:11.759 --> 00:09:15.519
And Cassini also the name given by I think it
165
00:09:15.559 --> 00:09:17.240
was Scott gu three and team to the.
166
00:09:17.759 --> 00:09:21.759
Web server and visual studio. Okay, Cassini, there was a
167
00:09:21.759 --> 00:09:25.480
few of them. Messenger is the first spacecraft to go
168
00:09:25.480 --> 00:09:29.480
into orbit around Mercury. It launches in August of two
169
00:09:29.480 --> 00:09:31.200
thousand and four. It won't actually get into orbit around
170
00:09:31.200 --> 00:09:34.360
Mercury till twenty eleven seven years. It'll take longer than
171
00:09:34.399 --> 00:09:37.240
it takes Cassini to get to Jupiter because it needs
172
00:09:37.279 --> 00:09:40.759
to slow down so much to actually be able to
173
00:09:40.799 --> 00:09:44.519
be captured by Mercury that it'll do a flyby of Earth,
174
00:09:44.600 --> 00:09:47.879
two fly bys of Venus, and three flybys of Mercury
175
00:09:48.519 --> 00:09:50.600
to slow itself down enough to finally be captured by
176
00:09:50.639 --> 00:09:53.480
Mercury twenty eleven, and it'll do a complete map of
177
00:09:53.480 --> 00:09:55.720
Mercury and a bunch of further cool mission.
178
00:09:55.759 --> 00:09:59.840
See scientists, real folks, it's tricky laws of physics. Yeah,
179
00:10:00.120 --> 00:10:01.000
not just a good idea.
180
00:10:01.120 --> 00:10:03.759
And as you get closer to the Sun, it accelerates
181
00:10:03.759 --> 00:10:07.480
you a lot, so scrapping speed is hard. Finally, in December,
182
00:10:07.559 --> 00:10:11.000
Voyage Year one, launched in seventy seven or seventy nine,
183
00:10:11.639 --> 00:10:15.399
reaches the termination shock. That's the point at which the
184
00:10:15.440 --> 00:10:19.440
solar wind being pressed out from our star is pushed
185
00:10:19.480 --> 00:10:23.679
back by the interstellar wind, and so he crosses through
186
00:10:23.720 --> 00:10:27.279
that and we get new information from it. So that's
187
00:10:27.320 --> 00:10:29.440
all we get from space. Let's talk a little bit
188
00:10:29.440 --> 00:10:31.000
on the compute side, because I find I feel like
189
00:10:31.000 --> 00:10:33.759
two thousand and four is more important year than you realize. Okay,
190
00:10:33.840 --> 00:10:36.720
I would argue that this is the year that we
191
00:10:36.759 --> 00:10:39.799
recover from the dot com boom, Right, So, I mean
192
00:10:39.799 --> 00:10:41.360
the dot com boom it sort of ended in two
193
00:10:41.360 --> 00:10:43.360
thousand and one, and all the money it sort of disappeared.
194
00:10:43.360 --> 00:10:45.440
It's not like the web or anything went away. But
195
00:10:45.720 --> 00:10:49.519
I would argue that the harbinger event was Google's IPO,
196
00:10:50.600 --> 00:10:52.720
So they you know, had been born during the dot
197
00:10:52.799 --> 00:10:54.519
com boom, but they were in one of the companies
198
00:10:54.519 --> 00:10:57.840
that did not fail became the fundamental search tool of
199
00:10:57.879 --> 00:11:01.320
all time arguably still is today, and they were essentially
200
00:11:01.360 --> 00:11:03.440
forced to IPO they had too many shareholders and the
201
00:11:03.480 --> 00:11:07.240
SEC required it, so that they went somewhat reluctantly, but
202
00:11:07.360 --> 00:11:10.039
the response by the market was very positive. It's sort
203
00:11:10.080 --> 00:11:14.840
of the first good news about the web post dot com.
204
00:11:15.279 --> 00:11:17.320
This is also the year that O'Riley starts their Web
205
00:11:17.360 --> 00:11:21.360
two point zero conference where they talk about the focus
206
00:11:21.399 --> 00:11:25.399
on user contributed content things like wikis and blogs and
207
00:11:26.039 --> 00:11:28.240
ultimately social media, so how that comes from that. And
208
00:11:28.240 --> 00:11:31.879
speaking of social media, this is the year that a
209
00:11:31.919 --> 00:11:35.320
young Harvard student named Mark Zuckerberg starts a website called
210
00:11:35.679 --> 00:11:39.360
the Facebook. The Facebook. Oh, and also speaking of Google,
211
00:11:39.440 --> 00:11:42.320
on April first, they launch Gmail and everybody thinks it's
212
00:11:42.320 --> 00:11:45.120
a joke. Yeah, yeah, why I remember you had to
213
00:11:45.480 --> 00:11:47.759
thinking you had to be invited to that program. Yeah,
214
00:11:47.759 --> 00:11:49.799
that's right. It was the longest beta ever and just
215
00:11:49.879 --> 00:11:52.759
kept going and going and going. That turned out for them.
216
00:11:53.000 --> 00:11:56.360
On the Intel side, Intel final delivers the EM sixty
217
00:11:56.399 --> 00:11:58.559
four t on a Xenon. This is based on Dave
218
00:11:58.639 --> 00:12:01.919
Cutler's Windows on Windows mindset of like can we make
219
00:12:01.960 --> 00:12:04.039
sixty four bit process? It'll run thirty two bit properly.
220
00:12:04.039 --> 00:12:06.559
It actually makes sixty four come true because it has
221
00:12:06.639 --> 00:12:10.720
become the Itanic and so the Zenon No Kona is
222
00:12:10.759 --> 00:12:14.320
sort of the first towards that Cutler had actually worked
223
00:12:14.320 --> 00:12:17.480
with AMD first. So AMD had solved this problem and
224
00:12:17.480 --> 00:12:19.519
now Intel was playing catch up. One would argue this
225
00:12:19.559 --> 00:12:22.320
is the point where Intel really fell behind. Two thousand
226
00:12:22.320 --> 00:12:25.759
and four, the year of XP s P two. Oh boy,
227
00:12:25.799 --> 00:12:28.440
what a year that was. Yeah, one would argue the
228
00:12:28.519 --> 00:12:31.720
setup for the debacle that becomes Vista. You know, The
229
00:12:31.840 --> 00:12:34.000
argument here is that it was a breaking change to
230
00:12:34.080 --> 00:12:36.840
Windows XP, so it should have been XP version two.
231
00:12:37.720 --> 00:12:40.240
But in back in those days, you charged for a
232
00:12:40.279 --> 00:12:42.960
new version of an operating system, and Microsoft rannted everybody
233
00:12:42.960 --> 00:12:45.080
to install SP two, So making it a service pack
234
00:12:45.360 --> 00:12:47.080
was the right thing to do from a let's get
235
00:12:47.080 --> 00:12:50.600
this security out into the world perspective, but with lots
236
00:12:50.600 --> 00:12:54.039
of long term consequences from that yep. Two thou four
237
00:12:54.200 --> 00:12:57.240
is the year of the final version of fox Pro
238
00:12:57.399 --> 00:13:00.159
visual fox Pro nine, which had been booted out a
239
00:13:00.279 --> 00:13:03.679
visual studio as a visual Studio dot net in two
240
00:13:03.720 --> 00:13:05.600
thousand and two. It's now living on its own, and
241
00:13:05.639 --> 00:13:07.519
this is the final version of they will Ship. Beth
242
00:13:07.600 --> 00:13:10.600
Massy wasn't happy, No, none of the They can't really
243
00:13:10.600 --> 00:13:12.960
blame him, it's fair now. Two thousand and four is
244
00:13:13.000 --> 00:13:16.720
the year that Miguel diac has a Ship's the first
245
00:13:16.799 --> 00:13:20.039
version of Mono. He'd announced it in two thousand and
246
00:13:20.080 --> 00:13:22.960
one at another O'Reilly conference that he thought it was
247
00:13:23.000 --> 00:13:25.879
a good idea and effectively destroyed his career because all
248
00:13:25.919 --> 00:13:27.799
the Microsoft people are like, are you that Linux guy?
249
00:13:27.879 --> 00:13:29.799
And all thewis people are like, don't you work with
250
00:13:29.879 --> 00:13:35.120
Microsoft technology? So he couldn't win. It's hard to be Miguel,
251
00:13:35.279 --> 00:13:37.799
But yeah, that's the first time Mona comes out. Another
252
00:13:38.159 --> 00:13:44.159
important open source product Ruby on rails. In July, David
253
00:13:44.559 --> 00:13:48.840
Heinemeier Hansen DHH, who is a very controversial figure today,
254
00:13:49.000 --> 00:13:53.840
certainly guy behind base Camp. Takes an old language from
255
00:13:53.840 --> 00:13:55.919
the nineties Ruby that nobody cared all that much about,
256
00:13:56.000 --> 00:13:58.879
combines it with a scaffolding he calls rails and makes
257
00:13:58.919 --> 00:14:01.960
a phenomenal an old web tool, and again we talk
258
00:14:02.000 --> 00:14:05.279
about the rebirth of the web, reinterest in the web.
259
00:14:05.720 --> 00:14:09.679
Ruby all rails became this incredible prototyping tool for building
260
00:14:09.720 --> 00:14:13.200
websites fast. Yeah. People thought of it as like visual
261
00:14:13.200 --> 00:14:15.679
basic for the web. Yeah really, and you know, build
262
00:14:15.679 --> 00:14:17.360
it up, tear it down, just give data off you go.
263
00:14:17.440 --> 00:14:19.960
It was amazing. And I'm gonna mention two games only
264
00:14:19.960 --> 00:14:22.960
because I think they're profoundly important in gaming even today.
265
00:14:23.399 --> 00:14:26.279
This is the year that World of Warcraft launches under Blizzard,
266
00:14:26.600 --> 00:14:30.159
so that massive multiplayer game. It's still ongoing today. Wow
267
00:14:30.200 --> 00:14:35.000
and Wow from Valve Half Life two, and that's all
268
00:14:35.000 --> 00:14:35.320
I got.
269
00:14:35.360 --> 00:14:37.679
All right, I got I got one from two thousand
270
00:14:37.679 --> 00:14:41.240
and four tech related me. Firefox got released.
271
00:14:41.720 --> 00:14:45.159
So yeah, they they came out. It was no longer Phoenix,
272
00:14:45.679 --> 00:14:47.519
right as the first version was called Phoenix. Then they
273
00:14:47.519 --> 00:14:49.879
found oh you can't call it Phoenix, so they rebranded
274
00:14:49.919 --> 00:14:51.240
as Firefox. In two thousand and four.
275
00:14:51.480 --> 00:14:54.360
Yeah, and I don't think Firebug wasn't out at the time,
276
00:14:54.440 --> 00:14:57.480
but I did credit Firefox for like the developer tools
277
00:14:57.519 --> 00:15:00.000
that we have today in inspiring that with fire firebugg.
278
00:15:00.519 --> 00:15:03.519
So what about Firebase. Was that part of that whole
279
00:15:03.639 --> 00:15:05.600
thing or is that a separate thing part of the
280
00:15:05.600 --> 00:15:06.279
suite as well?
281
00:15:06.559 --> 00:15:08.759
All right, you're right. It does tie you into my
282
00:15:08.840 --> 00:15:12.559
larger message of this is the webabilitating because what the
283
00:15:12.720 --> 00:15:15.759
Mozilla Foundation was doing was building real dev tools for
284
00:15:15.799 --> 00:15:18.679
web devs. You weren't just hacking away like your ability
285
00:15:18.720 --> 00:15:21.279
to work in fire I was not necessarily a Firewok
286
00:15:21.399 --> 00:15:24.639
Fox fan, but if you had to build a web
287
00:15:24.679 --> 00:15:26.519
page and you weren't using Firefox, you were just torturing
288
00:15:26.559 --> 00:15:30.720
yourself like they figured out all F twelve before everybody else. Yep, yeah,
289
00:15:30.919 --> 00:15:33.559
like that's where that came from. Good enough that everybody
290
00:15:33.559 --> 00:15:36.000
copied it. All right, are we ready for better? No framework,
291
00:15:36.240 --> 00:15:38.679
Let's do the thing with the stuff, roll the music?
292
00:15:46.240 --> 00:15:46.639
All right, man?
293
00:15:46.639 --> 00:15:47.519
What do you got? All right?
294
00:15:47.559 --> 00:15:50.919
Well, although he didn't write it, our friend Simon Kropp
295
00:15:51.000 --> 00:15:52.120
brought this to my attention.
296
00:15:52.559 --> 00:15:55.919
I'm shocked Shock has done. This is cool.
297
00:15:56.000 --> 00:16:00.600
This is a Windows Defender performance tool interesting. It's a
298
00:16:00.639 --> 00:16:04.879
dot net application that monitors Windows Defender ETW events and
299
00:16:05.000 --> 00:16:09.399
visualizes scan durations in real time using a stacked bar chart.
300
00:16:09.879 --> 00:16:15.120
It can also visualize snapshots recorded offline with the PowerShell
301
00:16:15.120 --> 00:16:20.799
command lit and so listens to the Anti Malware Engine
302
00:16:21.480 --> 00:16:26.559
stream scan request tasks, stop ETW events, displays the scan
303
00:16:27.120 --> 00:16:29.759
durations per process, and a stacked bar chart. This is
304
00:16:29.799 --> 00:16:32.519
all real time. You can drag and drop files or
305
00:16:32.559 --> 00:16:34.840
folders onto the window to trigger an immediate scan of
306
00:16:34.879 --> 00:16:38.600
the dropped items and export to CSB when more than
307
00:16:38.639 --> 00:16:42.879
one snapshot is dragged to the window. It's all I know.
308
00:16:43.200 --> 00:16:47.159
It looks really cool. It's MIT licensed, and you know that.
309
00:16:47.360 --> 00:16:48.080
I think.
310
00:16:49.399 --> 00:16:56.080
There's an urgency about knowing what threats are out there
311
00:16:56.200 --> 00:16:58.879
as soon as possible, because by the time you see it,
312
00:16:58.919 --> 00:16:59.559
you're vulnerable.
313
00:17:00.000 --> 00:17:02.799
ILS argue that people blame Defender for performance problems all
314
00:17:02.799 --> 00:17:05.039
the time, and this is a tool that surfaces this
315
00:17:05.119 --> 00:17:06.799
is what Defender's actually doing. Yep.
316
00:17:06.920 --> 00:17:09.519
So it's very very cool. And Defender should always be on.
317
00:17:09.640 --> 00:17:11.720
If you ask me, that's you have to fight to
318
00:17:11.759 --> 00:17:12.240
turn it off.
319
00:17:12.279 --> 00:17:14.119
Yeah, right, And it's on by default mostly you know,
320
00:17:14.279 --> 00:17:16.200
the average mortal has it on, doesn't even know it
321
00:17:16.279 --> 00:17:19.000
doesn't even know, right, I think for us in dev,
322
00:17:19.039 --> 00:17:21.480
because we torture our machines, so you're often looking for
323
00:17:21.519 --> 00:17:23.839
like what's eating up all the resources? And let's be clear,
324
00:17:24.559 --> 00:17:28.880
you dump, especially new executables that you have generated that
325
00:17:28.960 --> 00:17:32.119
are unsigned. You trigger a defender when you do that,
326
00:17:32.480 --> 00:17:34.799
and sometimes those things can really hit a lot of cycles.
327
00:17:34.880 --> 00:17:40.240
Yeah, so hats off to Alexander Eulatin for putting this
328
00:17:40.359 --> 00:17:40.799
out there.
329
00:17:41.920 --> 00:17:45.039
Go get it. I'm gonna awesome. So who's talking to
330
00:17:45.160 --> 00:17:48.279
us today? Richard grad to comment off a show two thousand?
331
00:17:48.559 --> 00:17:48.960
Wow.
332
00:17:49.079 --> 00:17:51.200
Yeah, we published two thousand episodes. When do you know
333
00:17:51.359 --> 00:17:54.279
what a great show? And Aaron Old said, this podcast
334
00:17:54.279 --> 00:17:58.200
has been my longest continually listened to podcasts. The information
335
00:17:58.279 --> 00:17:59.960
that you have shared has been instrument to my twenty
336
00:18:00.079 --> 00:18:02.680
five plus year career in dot net. I remember the
337
00:18:02.720 --> 00:18:05.000
first time that one of my comments was read on
338
00:18:05.079 --> 00:18:07.519
the air. I was driving to work and I had
339
00:18:07.559 --> 00:18:09.359
to pull off on the road in the parking lot
340
00:18:09.400 --> 00:18:11.799
and listen to Richard read my comment. I was so excited.
341
00:18:12.160 --> 00:18:15.039
I do hope you guys continue to do the good work. Yeah, well,
342
00:18:15.039 --> 00:18:18.599
there you go eron, I read another one, so don't crash.
343
00:18:18.880 --> 00:18:21.240
Yeah right, it's gonna be fine, it's gonna be fun.
344
00:18:21.279 --> 00:18:23.920
Everything's okay. Yeah, and thanks so much for sticking with us,
345
00:18:23.960 --> 00:18:28.000
because we've been we're still doing this thing somehow Sometimes
346
00:18:28.039 --> 00:18:30.640
I wonder how all right? Yeah, two thousand shows in
347
00:18:31.039 --> 00:18:32.319
so thank you so much for your comment. And a
348
00:18:32.359 --> 00:18:33.960
copy of music co buy is on its way to you.
349
00:18:34.079 --> 00:18:35.759
And if you'd like copy of musicobe I read a
350
00:18:35.799 --> 00:18:37.720
comment on the website at dot NetRocks dot com or
351
00:18:37.759 --> 00:18:39.799
on the facebooks publish every show there. And if you
352
00:18:39.799 --> 00:18:41.319
comment there and to reading the show, well, I do
353
00:18:41.279 --> 00:18:41.880
you copy music?
354
00:18:41.960 --> 00:18:43.920
Go buy music to code by dot net if you
355
00:18:43.960 --> 00:18:46.559
want to just go get it? Okay, nice, go get it.
356
00:18:46.599 --> 00:18:47.000
Good link.
357
00:18:48.440 --> 00:18:52.240
So let's introduce Scott. You heard from him before just
358
00:18:52.359 --> 00:18:54.960
recently a couple of things. Scott Sober is the director
359
00:18:55.000 --> 00:18:59.200
of Engineering at Lean Techniques, a consultancy of about one
360
00:18:59.279 --> 00:19:02.799
hundred and seventy people based in the Midwest. Besides advising
361
00:19:02.839 --> 00:19:05.519
clients and delivering solutions for them, he enjoys helping teams
362
00:19:05.559 --> 00:19:10.759
realize their potential through technical practices and working more effectively together.
363
00:19:11.279 --> 00:19:16.000
He's a Microsoft MVP a Redgate Community Ambassador, international speaker,
364
00:19:16.200 --> 00:19:19.720
dome train author. He co organizes the Iowa dot Net
365
00:19:19.799 --> 00:19:23.119
User group and co organizes the Iowa Code Camp. You
366
00:19:23.160 --> 00:19:27.640
can find him pretty much anywhere online at Scottsaber. Welcome Scott.
367
00:19:27.680 --> 00:19:30.119
Yeah, thanks for having me, guys, first time, right it is.
368
00:19:30.279 --> 00:19:32.759
It is my first time. So excited to be here.
369
00:19:33.279 --> 00:19:36.680
Awesome. We've seen each other at the conferences for many,
370
00:19:36.720 --> 00:19:39.480
many years, so sorry about that. Shouldn't have been this lot,
371
00:19:39.599 --> 00:19:42.880
But I think his talk You've got is really cool,
372
00:19:42.960 --> 00:19:45.359
Like it's such a good idea to just sort of
373
00:19:45.480 --> 00:19:47.720
have a I gues you call it a checklist of
374
00:19:47.880 --> 00:19:49.680
things you're going to do in a dot net app.
375
00:19:49.759 --> 00:19:53.079
Yeah, totally, and uh yeah, just fair warning. This might
376
00:19:53.119 --> 00:19:54.799
be a little bit of a dense show of just
377
00:19:55.240 --> 00:19:58.519
random fire of different tips, but hopefully people will be
378
00:19:58.519 --> 00:20:00.680
able to walk away with something that they and literally
379
00:20:00.880 --> 00:20:03.200
take and apply immediately after the show.
380
00:20:03.440 --> 00:20:04.960
So it's called nutritional value.
381
00:20:05.200 --> 00:20:11.720
Unlike what we just did for the last twenty minutes.
382
00:20:10.200 --> 00:20:16.240
Dark here comes to Broccoli, right, Yeah, well where do
383
00:20:16.319 --> 00:20:16.640
we start?
384
00:20:16.680 --> 00:20:17.680
All right? All right?
385
00:20:17.759 --> 00:20:21.440
You go, Yeah, so probably one of the first things
386
00:20:21.480 --> 00:20:23.319
I talked about, and I know you guys have had
387
00:20:23.359 --> 00:20:26.160
people on the show talking about this topic is around
388
00:20:26.200 --> 00:20:30.559
feature folders. So I'm a big fan of organizing my
389
00:20:30.680 --> 00:20:34.480
code around feature folders as opposed to the traditional kind
390
00:20:34.519 --> 00:20:37.839
of way. So to kind of talk through that, a
391
00:20:37.880 --> 00:20:39.680
lot of people are familiar with, like you know, you
392
00:20:39.759 --> 00:20:42.119
might have like a data project or like you know,
393
00:20:42.240 --> 00:20:46.400
repository services, and like those all kind of live in
394
00:20:46.480 --> 00:20:50.799
different folders. You know, if you're doing NBC and rendering
395
00:20:50.839 --> 00:20:53.039
that on the server, you got like your views folder,
396
00:20:53.039 --> 00:20:55.279
your controllers folder, models folder.
397
00:20:55.640 --> 00:20:59.359
And just the way you don't look for anything exactly right.
398
00:20:59.480 --> 00:21:01.680
Yeah, So anytime you need to add a feature, you
399
00:21:01.720 --> 00:21:04.880
got to go touch upwards of you know, five ten
400
00:21:04.960 --> 00:21:07.240
folders just to add a feature. And if you want
401
00:21:07.240 --> 00:21:09.319
to delete a feature, now you got to go find
402
00:21:09.359 --> 00:21:12.200
it everywhere too, and it's just kind of scattered. So
403
00:21:12.880 --> 00:21:14.799
future folders kind of flips that on its head, and
404
00:21:14.880 --> 00:21:17.559
rather than organizing by like type of things, rather than
405
00:21:17.599 --> 00:21:21.279
having like a model's folder, controllers folder, you organized by feature.
406
00:21:21.440 --> 00:21:25.079
So let's say you've got my profile feature for instance,
407
00:21:25.839 --> 00:21:28.720
anything to do with that feature goes in a folder
408
00:21:28.759 --> 00:21:31.680
called my profile, so it's all kind of co located together.
409
00:21:32.160 --> 00:21:34.240
It's very easy to see at a glance what your
410
00:21:34.279 --> 00:21:39.000
features are, and so we want that code by future.
411
00:21:39.160 --> 00:21:41.079
Yep, it makes sense really. I mean it's kind of
412
00:21:41.160 --> 00:21:44.640
like we do that with projects, right. We have projects
413
00:21:44.799 --> 00:21:48.119
that are based you know, components or DLLs or whatever,
414
00:21:48.160 --> 00:21:50.400
they are based on what they do, and just take
415
00:21:50.400 --> 00:21:54.160
it another step inside those projects organizing feature folders.
416
00:21:54.240 --> 00:21:54.400
Yeah.
417
00:21:54.400 --> 00:21:56.279
Great, So I kind of use the analogy if in
418
00:21:56.319 --> 00:21:58.799
case somebody still thinks that this is like heresy, I
419
00:21:59.359 --> 00:22:00.960
challenge people think about, Oh.
420
00:22:00.880 --> 00:22:03.200
It's it's heresy, but it's good heresy.
421
00:22:03.480 --> 00:22:08.079
Yeah, exactly. If you think about like your house or
422
00:22:08.119 --> 00:22:11.160
your apartment or wherever you live, think about where you
423
00:22:11.279 --> 00:22:13.920
keep the soap in your house, Like do you have
424
00:22:13.960 --> 00:22:17.799
a closet full of all the different soap like hand soap, shampoo,
425
00:22:18.880 --> 00:22:24.440
body soap, dishwasher soap. Yeah, probably not. You probably keep
426
00:22:24.519 --> 00:22:27.079
that soap close to where it's used, Like you keep
427
00:22:27.119 --> 00:22:31.119
the hand soap by the sink, the shampoo in the shower,
428
00:22:31.519 --> 00:22:34.920
and so you use it where it's most used. You
429
00:22:34.960 --> 00:22:37.319
don't just have a soap closet you go reach into
430
00:22:37.440 --> 00:22:38.480
to go grab the soap.
431
00:22:38.720 --> 00:22:41.559
So God, I love the idea of a soap closet, the.
432
00:22:41.559 --> 00:22:44.839
First time I heard about feature folders, I was just like, duh,
433
00:22:45.400 --> 00:22:48.119
why didn't I do that? You know, it's it's just
434
00:22:48.720 --> 00:22:49.720
makes your life easier.
435
00:22:49.920 --> 00:22:52.240
Any any gotcha's what do you have to do to
436
00:22:52.240 --> 00:22:53.359
make feature folders work?
437
00:22:53.359 --> 00:22:56.079
Well, honestly, not a whole lot. I mean, if you're
438
00:22:56.079 --> 00:23:01.279
doing like server rendered NBC or raise the pages, is
439
00:23:01.319 --> 00:23:05.720
just a slight change you need to do to have
440
00:23:05.759 --> 00:23:08.119
a go look in that folder. But it's usually one
441
00:23:08.119 --> 00:23:10.880
liner to add that. I've got a blog post on
442
00:23:10.880 --> 00:23:12.279
how to do that, so we could drop that in
443
00:23:12.319 --> 00:23:14.400
the show notes in case people are interested. But otherwise,
444
00:23:14.400 --> 00:23:17.359
if you're just building an API, it should just work.
445
00:23:17.640 --> 00:23:17.839
Yep.
446
00:23:18.440 --> 00:23:20.960
So there's nothing magic about a controller's folder, for instance,
447
00:23:21.680 --> 00:23:25.839
as long as you are you know, there's a few
448
00:23:25.839 --> 00:23:29.240
different ways that can discover it. Whether you know it
449
00:23:29.279 --> 00:23:33.279
has the API controller attribute or the suffix of the
450
00:23:33.440 --> 00:23:38.599
classes controller, it'll find it that way. So there's really
451
00:23:38.640 --> 00:23:41.359
nothing magical about these folders for the most part, other
452
00:23:41.400 --> 00:23:43.240
than in like server rendered NBC.
453
00:23:43.799 --> 00:23:45.960
So how many folders deep like you do you have
454
00:23:46.079 --> 00:23:49.000
like my profile and under that controllers or do you
455
00:23:49.079 --> 00:23:52.720
just have the if you have one or two controller files,
456
00:23:52.720 --> 00:23:53.799
you just put them right there.
457
00:23:53.880 --> 00:23:57.000
Yeah, that's that's a good question. Usually I'll I won't
458
00:23:57.480 --> 00:24:03.440
start with nesting more folders underneath that until I find i,
459
00:24:03.480 --> 00:24:05.519
you know, starting to get tons of files in there
460
00:24:05.519 --> 00:24:08.400
and things like that. Yeah, it just kind of depends.
461
00:24:08.480 --> 00:24:11.240
But a lot of times I'll just kind of put
462
00:24:11.400 --> 00:24:13.680
things in there, and usually it's not more than you know,
463
00:24:13.799 --> 00:24:16.480
four to six files or so. So I find that
464
00:24:16.559 --> 00:24:17.799
usually pretty easy to manage.
465
00:24:18.160 --> 00:24:19.839
Very good, cool, good stuff.
466
00:24:20.640 --> 00:24:23.279
That's number two, all right, moving on to number two.
467
00:24:24.759 --> 00:24:28.200
So this is treat warnings as errors.
468
00:24:28.559 --> 00:24:29.759
Look at your believer.
469
00:24:29.960 --> 00:24:36.039
You being consultant, you get dropped into different projects all
470
00:24:36.039 --> 00:24:38.680
the time, and it's always not the best experience when
471
00:24:38.680 --> 00:24:40.200
you pull down a project for the first time you
472
00:24:40.240 --> 00:24:43.160
build it and there's like hundreds or even thousands of
473
00:24:43.359 --> 00:24:47.599
warnings of compiler warnings that you know, you're like, okay,
474
00:24:47.640 --> 00:24:49.559
which ones of these are valid? Which ones are not?
475
00:24:50.279 --> 00:24:53.920
I don't know what to do, And so I like
476
00:24:54.480 --> 00:24:57.960
treating warnings as errors. And so basically warnings don't exist
477
00:24:58.000 --> 00:25:00.279
in my world. It should either be something that I
478
00:25:00.400 --> 00:25:03.799
fix or something like I explicitly ignore because for whatever
479
00:25:03.839 --> 00:25:05.480
reason that warning is invalid.
480
00:25:05.559 --> 00:25:08.720
It's not necessary. Yeah, I mean and to your point there,
481
00:25:08.759 --> 00:25:11.759
it's more about don't be blind to the warnings that
482
00:25:11.759 --> 00:25:14.240
are actually important. So when you leave all those warnings on,
483
00:25:14.839 --> 00:25:17.319
you ignore them all correct, Yeah, because.
484
00:25:17.079 --> 00:25:20.279
A lot of times you're getting those warnings and there's
485
00:25:20.400 --> 00:25:22.960
something that's going to happen, might not be right away.
486
00:25:23.279 --> 00:25:25.079
Yeah, like there deprecation warning.
487
00:25:25.000 --> 00:25:30.519
Yeah, that you should be making the change to actually,
488
00:25:30.960 --> 00:25:33.279
you know, go go fix whatever the thing is.
489
00:25:33.680 --> 00:25:37.119
So yeah, often those warnings suddenly become real errors when
490
00:25:37.119 --> 00:25:39.200
you move up a version of the framework because there
491
00:25:39.200 --> 00:25:41.000
were a deprecation warning has been going on for like
492
00:25:41.119 --> 00:25:43.519
three versions that you've been ignoring you and would have
493
00:25:43.519 --> 00:25:45.400
been easy to fix yep at some point.
494
00:25:45.480 --> 00:25:47.559
And that's as simple in case people are wondering, that's
495
00:25:47.559 --> 00:25:49.680
a simple as going in your csprog and there's a
496
00:25:49.759 --> 00:25:52.799
treat warnings as errors flag and you just split that
497
00:25:52.839 --> 00:25:53.960
to true in the XML.
498
00:25:54.119 --> 00:25:55.160
So that's very good.
499
00:25:55.200 --> 00:25:55.920
As simple as that.
500
00:25:55.960 --> 00:25:56.640
Awesome cool.
501
00:25:57.160 --> 00:26:03.039
So the third one is authorization using something called fallback
502
00:26:03.119 --> 00:26:07.000
policy in asp DO core. So let's talk about why
503
00:26:07.119 --> 00:26:10.640
the why first before we get into the what it is.
504
00:26:10.920 --> 00:26:15.119
So the problem is, by default, ASPI core security is
505
00:26:15.240 --> 00:26:18.000
opt in, meaning if you're doing controller, you got to
506
00:26:18.000 --> 00:26:21.119
add an authorized attribute and have to remember to do that,
507
00:26:21.559 --> 00:26:25.599
or in minimal APIs you have to remember to say
508
00:26:25.640 --> 00:26:30.160
like require authorization on a minimal API, and if you forget,
509
00:26:31.000 --> 00:26:34.240
now that API is exposed to the whole world, which
510
00:26:34.279 --> 00:26:38.640
is obviously not great. And so instead what I want
511
00:26:38.799 --> 00:26:43.240
is secure by default. So with something called the fallback
512
00:26:43.279 --> 00:26:47.200
policy and ASP do core. The idea there is, if
513
00:26:47.200 --> 00:26:52.160
you haven't specified anything else, you apply this fallback policy.
514
00:26:52.200 --> 00:26:54.240
So you can set the fallback policy to say, hey,
515
00:26:54.279 --> 00:26:57.440
require an authenticated user, and so at least you have
516
00:26:57.480 --> 00:27:00.240
to be logged in to hit that API or or
517
00:27:00.559 --> 00:27:04.000
whatever the case is. Or you know, if you are
518
00:27:04.000 --> 00:27:06.680
building like Razor pages or Blazer app, you have to
519
00:27:06.680 --> 00:27:09.680
be logged in to hit that page. Now, you can
520
00:27:09.720 --> 00:27:11.880
still opt out, so you can add like an allow
521
00:27:11.920 --> 00:27:15.839
anonymous attribute on a controller, endpoint, or whatever the case is,
522
00:27:16.640 --> 00:27:20.720
and that will take precedence over the fallback policy. The
523
00:27:20.720 --> 00:27:22.960
fallback policy is basically like, hey, if you didn't add
524
00:27:22.960 --> 00:27:26.720
anything else, this is what security policy is going to run.
525
00:27:26.799 --> 00:27:29.240
So by default you're secure and you can always add
526
00:27:29.279 --> 00:27:31.279
more security saying hey, you have to be an admin
527
00:27:31.359 --> 00:27:33.440
to hit this endpoint or whatever the case.
528
00:27:33.240 --> 00:27:36.039
Is if you have no fallback policy, is it fallback
529
00:27:36.119 --> 00:27:37.759
then no security?
530
00:27:38.079 --> 00:27:38.480
Correct?
531
00:27:38.799 --> 00:27:39.960
Yes? Yi?
532
00:27:41.079 --> 00:27:45.319
So that's that's the default in ASPI core because it
533
00:27:45.319 --> 00:27:47.079
doesn't know what you want to do, and so this
534
00:27:47.160 --> 00:27:49.000
kind of flips that on its head. And it's really
535
00:27:49.039 --> 00:27:53.200
just like a one liner. When you're setting up authorization,
536
00:27:53.400 --> 00:27:55.880
you can just say, hey, set the fallback policy to
537
00:27:56.200 --> 00:27:57.839
require authenty kid, you use her right?
538
00:27:58.000 --> 00:28:00.400
Good? Yeah, that's a good fault.
539
00:28:00.559 --> 00:28:07.440
Yep, all right. Next one logging best practices. So, uh,
540
00:28:07.799 --> 00:28:12.119
just see a lot of people who uh spray logs
541
00:28:12.119 --> 00:28:15.000
and don't really know what what it is that they're doing,
542
00:28:15.079 --> 00:28:17.920
or you know, they go to the hitting exception and
543
00:28:18.000 --> 00:28:20.920
suddenly they don't have all the information that they need.
544
00:28:21.599 --> 00:28:23.720
And I'm not going to get into like open telemetry
545
00:28:23.759 --> 00:28:25.680
and things like that because it's like its own show
546
00:28:25.920 --> 00:28:31.000
and whatnot. More so, just I use a package called saraalog.
547
00:28:31.319 --> 00:28:32.240
It's really popular.
548
00:28:32.400 --> 00:28:33.880
Great the donet I.
549
00:28:33.920 --> 00:28:37.880
Use it too, ye, And you'll serialize your objects and
550
00:28:37.880 --> 00:28:40.400
put them in the log messages.
551
00:28:40.079 --> 00:28:43.119
Yep, yep for sure. And yeah, so I'll do like
552
00:28:43.119 --> 00:28:46.559
the structured logging you're talking about, and so you can
553
00:28:46.599 --> 00:28:49.440
like query off those things. So like basically you can
554
00:28:49.480 --> 00:28:52.680
write essentially SQL like queries saying like, hey, grab me
555
00:28:52.720 --> 00:28:54.799
all the logs from this user, and you don't have
556
00:28:54.880 --> 00:28:56.759
to like search through strings and things like that.
557
00:28:56.960 --> 00:28:58.960
Yeah. Right, it's really good game changer.
558
00:28:59.119 --> 00:29:01.119
Yep, and sarah loogs got a good feature in pretty
559
00:29:01.160 --> 00:29:03.680
much every logging framework out there has this feature too,
560
00:29:04.119 --> 00:29:08.680
of you can add certain properties to every single log.
561
00:29:08.880 --> 00:29:11.960
So for instance, you might want the user.
562
00:29:11.720 --> 00:29:15.440
ID yep, yeah, you want the user yes.
563
00:29:15.559 --> 00:29:18.000
Or like whatever point are they trying to hit? Or
564
00:29:18.359 --> 00:29:20.880
you know what version of the app is deployed. Is
565
00:29:20.920 --> 00:29:23.200
also another thing that's useful because let's say you fix
566
00:29:23.240 --> 00:29:25.640
something and ship it out. You can say like, okay,
567
00:29:25.720 --> 00:29:29.319
do I have any exceptions from this latest version I
568
00:29:29.400 --> 00:29:30.079
just deployed out?
569
00:29:30.319 --> 00:29:34.680
And so I typically use a class that I write
570
00:29:34.720 --> 00:29:38.680
around zero log that had that takes a dictionary of
571
00:29:38.720 --> 00:29:42.759
strings as parameters, so a string string dictionary.
572
00:29:42.880 --> 00:29:45.119
Right. So right there in.
573
00:29:45.119 --> 00:29:49.200
The you know, in the catch, you add the parameters
574
00:29:49.240 --> 00:29:52.200
that you want to put in there, which might include
575
00:29:52.400 --> 00:29:54.000
the objects or you know.
576
00:29:53.960 --> 00:29:56.039
The things that you were for. First of all, the
577
00:29:56.079 --> 00:29:56.759
thing that you were.
578
00:29:56.599 --> 00:30:00.160
Calling is in there, but you know, all the detai
579
00:30:00.359 --> 00:30:06.799
that one would need to make intent intentional queries yep, yeah.
580
00:30:06.519 --> 00:30:09.519
And Sarah loog so yeah, Sarah logs, yeah, log context
581
00:30:09.559 --> 00:30:12.720
you can slap uh slap those things together too, so
582
00:30:13.440 --> 00:30:16.440
on every log statement you don't. You kind of just
583
00:30:16.440 --> 00:30:21.559
get those things for free, which is pretty nice. So
584
00:30:21.559 --> 00:30:23.920
so yeah, that's some logging best practices. But I kind
585
00:30:23.920 --> 00:30:27.799
of want to transition into like this concept of logs.
586
00:30:28.440 --> 00:30:32.720
Sometimes I hear like, let's say we're doing some refinement
587
00:30:32.880 --> 00:30:35.079
or something and talking like, oh, yeah, we should log
588
00:30:35.400 --> 00:30:39.960
that piece of information, And I think there's a subtle
589
00:30:39.960 --> 00:30:44.319
difference between like logging versus metrics versus audits. And again
590
00:30:44.359 --> 00:30:46.319
I'm not going to get into open telemetry stuff, but
591
00:30:47.480 --> 00:30:53.000
technically sarah log does not guarantee delivery, meaning a lot
592
00:30:53.000 --> 00:30:55.359
of that a lot of times depending on what they
593
00:30:55.359 --> 00:30:58.839
call sinks, which is kind of like your end destination,
594
00:30:58.960 --> 00:31:01.680
like are you sending this to measure or where wherever
595
00:31:01.720 --> 00:31:05.960
you're sending it to. They don't guarantee delivery, so like
596
00:31:06.039 --> 00:31:08.960
they might depending on your settings, they might buffer those
597
00:31:09.000 --> 00:31:11.359
messages and memory. So what happens if the app suddenly
598
00:31:11.400 --> 00:31:14.079
crashes when all that stuff was in memory? Now all
599
00:31:14.119 --> 00:31:16.559
of those logs are gone. Yeah, and did not actually
600
00:31:16.599 --> 00:31:19.799
get flushed out, and so there's no guarantee of delivery,
601
00:31:19.839 --> 00:31:23.039
which is fine if you're using logs as they're meant
602
00:31:23.039 --> 00:31:25.480
to be used, which is like more of a developer tool,
603
00:31:25.640 --> 00:31:28.319
But if you're using it for like a replacement for
604
00:31:28.400 --> 00:31:31.880
like an audit tracking or audit logs, that's the problem.
605
00:31:32.200 --> 00:31:35.480
And right, so it's almost it a log everything except
606
00:31:35.559 --> 00:31:38.240
you accept the stuff you needed to understand what happened. Yeah.
607
00:31:38.319 --> 00:31:40.559
So with the logging system, though, can't you set up
608
00:31:40.640 --> 00:31:43.200
multiple sinks? Like you could have it right locally to
609
00:31:43.279 --> 00:31:47.680
a file so so it's there, and then on top
610
00:31:47.720 --> 00:31:50.200
of that you would have you know, some process to
611
00:31:50.200 --> 00:31:52.839
get it to another place that might you know, need
612
00:31:52.880 --> 00:31:55.240
to use poly or something. Yep, make sure it goes.
613
00:31:55.440 --> 00:31:58.039
Yeah, I just see some people like let's say you
614
00:31:58.039 --> 00:32:00.640
have a user management system and you want to log hey,
615
00:32:00.680 --> 00:32:04.559
who added who adds a user, changed the role or
616
00:32:04.599 --> 00:32:07.599
whatever the case is. Technically Sarah Loog's not going to
617
00:32:07.680 --> 00:32:10.039
guarantee that you get it to the place you set
618
00:32:10.079 --> 00:32:11.799
it too, so like instead you should just use it
619
00:32:11.839 --> 00:32:14.000
a good old fashioned audit table or something like that
620
00:32:14.000 --> 00:32:20.279
that has more guarantees around those things. And I've been
621
00:32:20.319 --> 00:32:23.680
in the healthcare industry at various points, and like they
622
00:32:23.680 --> 00:32:25.599
have some laws around like HIPPA that you have to
623
00:32:25.680 --> 00:32:29.599
keep data around for sure seven years, and so it's
624
00:32:29.920 --> 00:32:32.960
really not good if you don't keep that data around
625
00:32:33.000 --> 00:32:36.720
for seven years. And that's another problem with logging if
626
00:32:36.759 --> 00:32:41.559
you use audits as logs is your logging system might
627
00:32:41.599 --> 00:32:43.680
only keep things around for like thirty days or a
628
00:32:43.759 --> 00:32:46.079
year or something like that. So that's like another thing.
629
00:32:46.119 --> 00:32:48.759
You got to kind of consider the data store that
630
00:32:48.839 --> 00:32:49.599
you're using there.
631
00:32:49.680 --> 00:32:52.240
Yeah, it's usually a circular store and it has it's
632
00:32:52.240 --> 00:32:55.240
limited by space or time whatever that may be. Is
633
00:32:55.279 --> 00:32:57.359
also where you should call your friendly system men, who
634
00:32:57.400 --> 00:33:00.000
is also responsible for how long that stuff should be stored.
635
00:33:00.119 --> 00:33:01.720
So even if you are in a thirty day rotation,
636
00:33:02.519 --> 00:33:04.759
we take a snap of it periodically so that we
637
00:33:04.839 --> 00:33:08.559
have another copy somewhere. Like, yep, they have conversations. You're
638
00:33:08.559 --> 00:33:10.359
not the only one of this problem. Yep.
639
00:33:10.519 --> 00:33:12.480
This seems like a good place to take a break
640
00:33:12.799 --> 00:33:15.599
and we'll be right back after these very important messages
641
00:33:15.599 --> 00:33:20.920
don't go away. Hey Carl here, you probably know text
642
00:33:20.920 --> 00:33:25.160
control is a powerful library for document editing and PDF generation,
643
00:33:25.880 --> 00:33:28.240
But did you know they're also a strong supporter of
644
00:33:28.279 --> 00:33:31.559
the developer community. It's part of their mission to build
645
00:33:31.599 --> 00:33:35.680
and support a strong developer community by being present, listening
646
00:33:35.720 --> 00:33:39.519
to users, and sharing knowledge at conferences across Europe and
647
00:33:39.559 --> 00:33:43.079
the United States. So if you're heading to a conference soon,
648
00:33:43.680 --> 00:33:46.440
check if text Control will be there and stop buy
649
00:33:46.519 --> 00:33:49.799
to say hi. You can find their full conference calendar
650
00:33:50.200 --> 00:33:54.279
at dubdubdub dot textcontrol dot com and make sure you
651
00:33:54.319 --> 00:33:57.160
thank them for supporting dot NetRocks.
652
00:34:00.200 --> 00:34:01.799
And we're back. It's dot net Rocks.
653
00:34:02.039 --> 00:34:05.119
I'm Carl Franklin, that's Richard Campbell eight and we're talking
654
00:34:05.119 --> 00:34:07.920
to Scott Sober with his ten things that he does
655
00:34:07.960 --> 00:34:09.679
in every dot net project.
656
00:34:10.119 --> 00:34:12.360
Yeah, stealing something from David Letterman.
657
00:34:12.400 --> 00:34:14.679
I guess, and I think we're on four or five?
658
00:34:14.719 --> 00:34:15.920
Are we on five?
659
00:34:16.000 --> 00:34:17.440
Or six? Where are we?
660
00:34:17.440 --> 00:34:20.440
We've gone through five? Now we are non number six?
661
00:34:20.960 --> 00:34:25.039
So how about that six to one? Is we? I
662
00:34:25.159 --> 00:34:28.400
like to do validation with a library called Fluent Validation,
663
00:34:28.920 --> 00:34:33.119
so out of the box, uh you it's kind of
664
00:34:33.679 --> 00:34:37.159
I don't know, encouraged to use something called data annotations,
665
00:34:37.159 --> 00:34:40.880
which are just like little attributes saying hey, this field's required,
666
00:34:40.920 --> 00:34:44.320
and things like that when you're let's say you're taking
667
00:34:44.360 --> 00:34:46.519
in a form and you're someone signing up and you
668
00:34:46.519 --> 00:34:49.039
know their first name, last name, email, all that kind
669
00:34:49.039 --> 00:34:52.440
of stuff is required. Like data notations work well for
670
00:34:52.519 --> 00:34:56.119
those scenarios, but I find making custom ones when you
671
00:34:56.159 --> 00:35:00.280
have more advanced scenarios is a little awkward to make.
672
00:35:00.760 --> 00:35:04.079
Like let's say you're taking their birth date and you
673
00:35:04.119 --> 00:35:06.760
know they have to be above a certain age to
674
00:35:06.960 --> 00:35:10.639
sign up for the website. That's not out of the
675
00:35:10.639 --> 00:35:12.559
box and something customer you'd have to make, and that
676
00:35:12.559 --> 00:35:16.039
gets a little awkward. With data annotations, Yes, they're also
677
00:35:16.079 --> 00:35:20.159
hard to unit test. If you want to get really particular,
678
00:35:20.480 --> 00:35:24.000
you could argue the single responsibility principles violated because like
679
00:35:24.400 --> 00:35:27.599
you're kind of mixing your model business rules that you
680
00:35:27.679 --> 00:35:31.920
have with your validation. Yep. So instead, I like using
681
00:35:31.920 --> 00:35:35.079
fluent validation, which allows you to kind of separate your
682
00:35:35.079 --> 00:35:38.079
model from your validation, and it basically gives you this
683
00:35:38.159 --> 00:35:41.039
fluent like syntax, so you can say, like, hey, first
684
00:35:41.119 --> 00:35:44.280
name should not be empty, and you can write customer
685
00:35:44.360 --> 00:35:47.480
rules super easily. They read super nice, And I've even
686
00:35:47.559 --> 00:35:51.239
given the rules like literally screenshotted the c sharp and
687
00:35:51.239 --> 00:35:53.760
send it to a business person said hey, are these
688
00:35:53.840 --> 00:35:56.000
rules right, and they're like, yep, that's good.
689
00:35:56.039 --> 00:35:58.559
It all makes sense and they can read them. Yeah, yes,
690
00:35:59.440 --> 00:36:01.480
it makes sense to them, versus that's.
691
00:36:01.280 --> 00:36:04.920
Important showing them like, you know, attributes and things like that,
692
00:36:05.000 --> 00:36:09.119
and it's like, good luck with that. And so Flume
693
00:36:09.199 --> 00:36:11.880
validation also has a test helper built in too, so
694
00:36:11.920 --> 00:36:14.519
you can write automated tests around it super easily. So
695
00:36:15.360 --> 00:36:17.679
I really like Fluent validation for this.
696
00:36:17.719 --> 00:36:19.840
Was a better no framework a couple of years ago,
697
00:36:20.119 --> 00:36:21.880
and yeah I love it.
698
00:36:22.039 --> 00:36:25.719
Yep, yeah, cool, just a better way think about the problem. Yeah, sure, awesome.
699
00:36:25.800 --> 00:36:29.840
All right, Numero seven, we're going to talk about just
700
00:36:29.920 --> 00:36:33.679
generic coding guidelines. So you can probably make the argument
701
00:36:33.719 --> 00:36:36.960
there's like twenty five plus tips in here, but total,
702
00:36:37.159 --> 00:36:39.440
but I'm going to kind of bucket all these into
703
00:36:39.519 --> 00:36:43.880
generic coding guidelines. So, okay, I try and structure my
704
00:36:44.039 --> 00:36:47.800
methods where I put the happy path at the bottom
705
00:36:47.920 --> 00:36:50.719
of a method. And part of the reason for that
706
00:36:51.000 --> 00:36:54.000
is I don't like having to scan like a new
707
00:36:54.039 --> 00:36:56.360
code base, like what what does this method even do?
708
00:36:56.960 --> 00:36:57.079
Right?
709
00:36:57.280 --> 00:36:59.320
And let's say it's one hundred lines long and somewhere
710
00:36:59.320 --> 00:37:02.480
at lines sixty to seventy is the happy path of
711
00:37:02.480 --> 00:37:05.480
what went well? Like everything went right right? This is
712
00:37:05.719 --> 00:37:06.880
this is what this method does.
713
00:37:07.039 --> 00:37:10.840
Don't nest your success states, yes, and then get into
714
00:37:11.000 --> 00:37:15.159
something that's tabbed in you know, eight tabs or something exactly.
715
00:37:15.199 --> 00:37:18.679
You do your centuries, you return if you need to return,
716
00:37:18.719 --> 00:37:20.800
and at the bottom happy path yep.
717
00:37:20.880 --> 00:37:23.679
Yeah, don't test if it have nested if ELS's do
718
00:37:23.840 --> 00:37:27.280
early returns like you said, so you know, if let's
719
00:37:27.280 --> 00:37:29.480
say I've got an endpoint. If I'm if the request
720
00:37:29.519 --> 00:37:31.320
isn't valid, I'm going to bomb out and return a
721
00:37:31.360 --> 00:37:33.679
four hundred. If I'm not authorized, I'm a bomb out,
722
00:37:33.679 --> 00:37:36.960
returning forbidden, whatever the case is, and then kind of
723
00:37:37.000 --> 00:37:37.960
get to my happy path.
724
00:37:38.199 --> 00:37:41.920
It's just just a legibility thing that it's easier to
725
00:37:42.000 --> 00:37:44.280
see the correct path out if you put it at
726
00:37:44.320 --> 00:37:44.639
the end.
727
00:37:44.920 --> 00:37:48.719
Yes, and it forces you into that early return pattern
728
00:37:48.760 --> 00:37:51.519
that Carl was talking about, where you kind of bomb
729
00:37:51.519 --> 00:37:54.920
out if things aren't aren't good, versus that nested success
730
00:37:54.960 --> 00:37:57.800
case like oh I am valid, oh I am authorized? Okay,
731
00:37:57.840 --> 00:37:58.679
now let's do the thing.
732
00:37:58.760 --> 00:38:01.360
Well what about this? What about that? Yeah, fail early
733
00:38:01.400 --> 00:38:03.280
and often and only succeed at the.
734
00:38:03.280 --> 00:38:06.679
End and the kind of way I think about this
735
00:38:06.960 --> 00:38:12.239
too is a principle called the indentation proclamation. Now, if
736
00:38:12.239 --> 00:38:14.239
you google that, that doesn't exist. I made it up
737
00:38:14.960 --> 00:38:17.159
just to honest indentation proclamation.
738
00:38:17.679 --> 00:38:18.000
Nice.
739
00:38:18.119 --> 00:38:20.920
But the idea is the more indented your code is
740
00:38:21.159 --> 00:38:23.239
usually the harder it is to read. If you have
741
00:38:23.360 --> 00:38:27.719
nested if statements, if you have nested loops, all those
742
00:38:27.800 --> 00:38:29.920
kinds of things. So I try and avoid.
743
00:38:29.800 --> 00:38:33.079
Psychlomatic complexity yep. Not good, yep.
744
00:38:33.119 --> 00:38:35.880
And then I just have some like generic warning lights
745
00:38:36.039 --> 00:38:37.920
and not hard and fast rules. Now I'm about to
746
00:38:37.960 --> 00:38:42.039
offend somebody if I haven't already is and these are
747
00:38:42.519 --> 00:38:45.280
not like hard stops. Just like when I get over
748
00:38:45.360 --> 00:38:47.360
this number, I start to think, hmm, is there a
749
00:38:47.360 --> 00:38:49.639
better way to do this? Should I break this out?
750
00:38:50.880 --> 00:38:54.320
So classes that get, you know, a few hundred lines long,
751
00:38:54.480 --> 00:38:56.719
I start to think, like, hm, could I start breaking
752
00:38:56.719 --> 00:38:59.599
this out methods? Over twenty lines? I start thinking, hey,
753
00:38:59.599 --> 00:39:02.880
can I break this out? If people are using regions?
754
00:39:03.039 --> 00:39:05.559
I am not a regions fan, and I feel like
755
00:39:05.719 --> 00:39:09.679
when somebody uses a region, I feel like Clippy should
756
00:39:09.679 --> 00:39:12.760
pop up in their ID and say, hey, you're trying
757
00:39:12.800 --> 00:39:14.400
to use a region? Did you mean to add a
758
00:39:14.440 --> 00:39:17.800
new class or method instead, because we already have these
759
00:39:17.840 --> 00:39:22.800
code organization tools called classes and methods, and a lot
760
00:39:22.840 --> 00:39:25.480
of times I see people use regions when they really
761
00:39:25.519 --> 00:39:27.320
should have reached for a new class or method.
762
00:39:27.079 --> 00:39:29.760
And covering up code. Yeah, so fair.
763
00:39:29.800 --> 00:39:31.320
I know there's some region fans out there, so I
764
00:39:31.320 --> 00:39:34.280
know I offended somebody out there with with that. So
765
00:39:34.280 --> 00:39:40.880
sorry in advance opinions defense, yep. And it's also getting
766
00:39:40.880 --> 00:39:43.639
into the point. I mean we're kind of talking AI.
767
00:39:43.920 --> 00:39:48.679
We briefly talked about AI earlier, but I mean, some
768
00:39:48.719 --> 00:39:52.920
of these things are kind of interesting as we started
769
00:39:52.960 --> 00:39:57.400
to get into a world of how much does code
770
00:39:57.519 --> 00:40:00.639
quality matter? And I'm still in only in the camp
771
00:40:00.679 --> 00:40:04.199
of it does, but as agents are writing more and
772
00:40:04.280 --> 00:40:06.960
more of our code, I think it's.
773
00:40:06.880 --> 00:40:09.360
An interesting including more and more of our test Yes.
774
00:40:09.599 --> 00:40:13.440
I think it's a kind of an interesting question. I
775
00:40:13.480 --> 00:40:16.519
know Uncle Bob who wrote the Clean Code Book, who
776
00:40:18.079 --> 00:40:21.480
he tweeted out saying that he's actually not looking at
777
00:40:21.519 --> 00:40:24.719
the code that he's generating anymore, which I thought was interesting.
778
00:40:24.760 --> 00:40:28.599
But he is writing like he has code coverage enforcement
779
00:40:28.639 --> 00:40:33.599
he enforces like cyclomatic complexity constraints and those kinds of things,
780
00:40:33.599 --> 00:40:36.320
so he has a lot of automation around those things
781
00:40:37.199 --> 00:40:40.000
to enforce code quality. So he says, if passes all
782
00:40:40.039 --> 00:40:41.960
those things, then I'm not actually looking at what the
783
00:40:42.000 --> 00:40:46.440
agent generates. I'm not quite there yet, but I understand
784
00:40:46.480 --> 00:40:48.519
how some people are starting to get there.
785
00:40:48.920 --> 00:40:50.679
I've had a few folks say I never got to
786
00:40:50.679 --> 00:40:52.840
one hundred percent code coverage until I had automation to
787
00:40:52.880 --> 00:40:56.760
generate tests. Yep, humans won't create one hundred percent code coverage,
788
00:40:56.760 --> 00:40:58.400
but you can torment in the LLM to do it.
789
00:40:58.840 --> 00:41:03.119
Oh, yeah, for sure. And honestly that those like writing
790
00:41:03.159 --> 00:41:05.440
the test is a good way to keep AI on
791
00:41:05.639 --> 00:41:10.519
track because I've had lots of times where uh, you know,
792
00:41:10.639 --> 00:41:13.800
it makes a change and it unintentionally broke something, but
793
00:41:13.880 --> 00:41:15.559
like it just auto fixes it and I don't have
794
00:41:15.559 --> 00:41:17.480
to tell it to fix it. It just detected. Hey, reran
795
00:41:17.559 --> 00:41:21.039
the test and this is broken. So yeah, we'll get
796
00:41:21.119 --> 00:41:22.719
into tests on a little bit where I'll talk about
797
00:41:22.719 --> 00:41:27.280
that too. Okay, cool, So that's number seven. Let's move
798
00:41:27.280 --> 00:41:32.800
on to number eight. Modern solution files. So solution files
799
00:41:32.840 --> 00:41:35.679
and dot net. If you've ever cracked one of those suckers,
800
00:41:35.719 --> 00:41:38.960
open it looks a little I don't even know what
801
00:41:39.000 --> 00:41:41.920
the format is. It's like a tabbed format and things
802
00:41:41.960 --> 00:41:45.000
like that. So back in the dot nine time frame
803
00:41:45.079 --> 00:41:50.199
they actually released a modern solution style format. The format
804
00:41:50.519 --> 00:41:57.639
is modern, which means it's XML, right, so modern, yes,
805
00:41:58.880 --> 00:42:01.400
but I actually like it. So basically it takes your
806
00:42:01.440 --> 00:42:04.480
like twenty lines of like GUIDs and things like that
807
00:42:04.480 --> 00:42:07.639
that you didn't necessarily read, and it turns it into
808
00:42:07.679 --> 00:42:10.920
like three lines just saying hey, I'm referencing this project
809
00:42:10.920 --> 00:42:13.440
in the solution, so cleans it up a little bit
810
00:42:13.639 --> 00:42:15.559
as well as it prevents some merged conflict.
811
00:42:15.679 --> 00:42:17.320
And you're talking about sl.
812
00:42:17.119 --> 00:42:20.400
N X right, yes, yep, the sl nx format, So yeah,
813
00:42:20.440 --> 00:42:24.159
it'll change your file format s l n x. And
814
00:42:24.280 --> 00:42:26.320
if you want to migrate from an sl N file
815
00:42:26.360 --> 00:42:29.239
to sl n x, it's just a dot Net SLN
816
00:42:29.519 --> 00:42:32.320
migrate at the command line and boom you're migrated over.
817
00:42:32.639 --> 00:42:35.280
Nice. Yeah, I remember that. I'll go find the old
818
00:42:35.280 --> 00:42:38.559
blog post about that. It's a good format.
819
00:42:38.760 --> 00:42:42.039
Yep. So we got modern cs prog files a few
820
00:42:42.079 --> 00:42:44.360
years back with dot dot net Core, and now we've
821
00:42:44.360 --> 00:42:45.599
got modern solution files.
822
00:42:45.599 --> 00:42:49.199
So that's cool. Yeah, nice, Yeah, do love the idea
823
00:42:49.199 --> 00:42:50.880
of associating modern and XML.
824
00:42:51.000 --> 00:42:57.800
That's all right. So ninth one is kind of an
825
00:42:57.840 --> 00:43:02.559
obscure feature called validate on build and what this means
826
00:43:02.599 --> 00:43:05.480
and it's not build as in compiling of your app.
827
00:43:05.559 --> 00:43:10.400
It's build as in building of the dependency injection container
828
00:43:10.480 --> 00:43:12.960
and asp dow it core. So basically make sure that
829
00:43:14.320 --> 00:43:19.519
the lifetime of your things that you register match what
830
00:43:19.559 --> 00:43:22.559
they should be. So what I mean by that is
831
00:43:22.599 --> 00:43:27.280
a singleton can only depend on singletons, otherwise it's not
832
00:43:27.360 --> 00:43:31.280
a singleton. So let's say you've got a singleton that
833
00:43:31.360 --> 00:43:34.599
takes in a dB context, which is a scope to dependency.
834
00:43:35.239 --> 00:43:38.159
Now you have this problem where that scope dependency is
835
00:43:38.239 --> 00:43:40.800
trapped in that singleton, and it's what's known as the
836
00:43:40.840 --> 00:43:44.880
captive dependency problem, which it might not be a huge
837
00:43:44.960 --> 00:43:48.320
deal depending on what your dependency is doing, but like
838
00:43:48.360 --> 00:43:50.519
in a dB context case, it might leave a connection
839
00:43:50.599 --> 00:43:55.079
open or leave a leak something, depending on what code
840
00:43:55.079 --> 00:43:58.880
that you're doing. So this validate on build setting basically
841
00:43:58.960 --> 00:44:02.719
forces ap on corea check to make sure that you
842
00:44:02.719 --> 00:44:08.000
don't get into that situation. And this will happen by
843
00:44:08.039 --> 00:44:11.519
default if your local environment is called development, so you
844
00:44:11.599 --> 00:44:14.360
might see this. It basically throws an error, won't even
845
00:44:14.400 --> 00:44:18.679
boot your application. But if you don't have your environment
846
00:44:18.719 --> 00:44:20.639
set to development, like let's say you change it to
847
00:44:20.719 --> 00:44:24.599
dev or local for whatever reason, this won't run. So
848
00:44:24.760 --> 00:44:28.760
there's a flag off of Vieus service provider that you
849
00:44:28.840 --> 00:44:31.880
just say validate on build true, and now it will
850
00:44:31.920 --> 00:44:32.719
always validate.
851
00:44:33.159 --> 00:44:37.079
So interesting. Yeah, that's good, and so it'll when you
852
00:44:37.280 --> 00:44:39.599
have to build, now just generate an error correct yep.
853
00:44:39.679 --> 00:44:42.639
So when you go to run your application, it will
854
00:44:42.880 --> 00:44:45.719
just basically not even boot the application because it's you're
855
00:44:45.760 --> 00:44:50.159
in an invalid state. So sometimes this can cause little
856
00:44:51.559 --> 00:44:55.039
small ears and production that you can't really explain, like
857
00:44:55.039 --> 00:44:57.000
the connection lead problem or something like that.
858
00:44:57.079 --> 00:44:59.119
So yeah, but you got to Yeah, you go from
859
00:44:59.199 --> 00:45:03.440
random random error sometimes the hard ones to hunt down
860
00:45:03.519 --> 00:45:06.119
to No, I will not build for you because you
861
00:45:06.199 --> 00:45:08.280
have done this thing, yep, and you've got to go.
862
00:45:08.360 --> 00:45:11.320
You've got to do a refactor here, architect differently. Don't
863
00:45:11.440 --> 00:45:15.400
invoke inside that singleton like you're going to create trouble. Yep.
864
00:45:15.480 --> 00:45:16.880
That's right. I appreciate that.
865
00:45:17.000 --> 00:45:17.360
All right.
866
00:45:17.960 --> 00:45:19.960
They seem like good defaults, like they should have been
867
00:45:19.960 --> 00:45:21.800
on in the first flip in place, right.
868
00:45:21.679 --> 00:45:23.599
I know, I think. I think part of the problem
869
00:45:23.679 --> 00:45:27.039
is like the validate on build setting didn't get added
870
00:45:27.159 --> 00:45:29.119
until later in a sped on it core, And I
871
00:45:29.159 --> 00:45:32.199
think they didn't want to break people even though yeah,
872
00:45:32.280 --> 00:45:33.679
they're kind of you know.
873
00:45:33.599 --> 00:45:35.000
They're running in traffic.
874
00:45:34.679 --> 00:45:38.199
Potentially broken in production. Yeah, yeah, not realize it.
875
00:45:38.360 --> 00:45:40.719
So yeah, I know, he's exactly that. Like you've been
876
00:45:40.760 --> 00:45:43.119
running a piece of software that randomly crashes and you've
877
00:45:43.119 --> 00:45:44.960
probably even covered up the crash, right, You've got to
878
00:45:44.960 --> 00:45:47.800
reboot mechanism, things like that, and just not realizing, no,
879
00:45:47.920 --> 00:45:50.480
you have an architectural problem that Valuide don't build would
880
00:45:50.480 --> 00:45:53.519
have told you. Yep, yeah, all right, good stuff. But yeah,
881
00:45:53.519 --> 00:45:55.960
I appreciate that Microsoft doesn't want to break code.
882
00:45:55.800 --> 00:45:58.119
Yeah for sure, and we've all benefited from that mindset.
883
00:45:58.159 --> 00:46:02.039
It's just sometimes the trade off happens where right now
884
00:46:02.079 --> 00:46:04.400
they don't change a default that they should have changed.
885
00:46:04.360 --> 00:46:07.519
A long time ago. Yeah, I mean it also if
886
00:46:07.519 --> 00:46:09.400
they do turn it on by default, then it creates
887
00:46:09.400 --> 00:46:11.639
a bunch of tex support costs for them they don't
888
00:46:11.679 --> 00:46:14.239
want to incur, as well as anger. It's the right choice.
889
00:46:14.280 --> 00:46:17.119
Don't move up to this version of dot net because
890
00:46:17.280 --> 00:46:19.599
my app now crashes. It's bad, right.
891
00:46:19.800 --> 00:46:23.000
I think backward compatibility is their number one, I think,
892
00:46:23.039 --> 00:46:25.159
and I think that's good. Yeah, so you have to
893
00:46:25.159 --> 00:46:27.840
do a couple of things to get you know, working
894
00:46:27.880 --> 00:46:30.280
better or you're working better. It's always a wrestling match
895
00:46:30.320 --> 00:46:32.440
on this one, right, yeah, one percent. I hope it's
896
00:46:32.440 --> 00:46:34.920
spitting all kinds of warnings out, at least that they'll
897
00:46:35.159 --> 00:46:38.320
happily ignore along with the other five hundred warnings, unless
898
00:46:38.360 --> 00:46:41.960
you have warnings as errors errors, in which case, if
899
00:46:41.960 --> 00:46:45.079
you go through the list, it all works all right.
900
00:46:45.239 --> 00:46:46.559
Sorry, Scott, let's keep going.
901
00:46:46.639 --> 00:46:49.440
You're good. So number ten, although I think I'm gonna
902
00:46:49.440 --> 00:46:54.719
sneak in eleventh here, but uh, Number ten is a
903
00:46:54.760 --> 00:46:57.920
feature called central package management. So this has been in
904
00:46:58.000 --> 00:47:01.880
dot net since dot net six. But I when I
905
00:47:01.920 --> 00:47:04.360
gave this talk at a conference, I asked how many
906
00:47:04.400 --> 00:47:06.400
people are using this? And probably ten percent of the
907
00:47:06.440 --> 00:47:08.320
room raise their hands. So even though this has been
908
00:47:08.360 --> 00:47:11.199
out for a number of years, people still aren't using it.
909
00:47:11.400 --> 00:47:15.000
It's like four years now that central packages around yep.
910
00:47:15.119 --> 00:47:17.360
So the kind of the problem it solves is you
911
00:47:17.440 --> 00:47:21.880
might have multiple projects in your solution that reference the
912
00:47:21.880 --> 00:47:24.719
same package. Like let's say you've got multiple test projects
913
00:47:24.760 --> 00:47:27.000
and you're using x unit or n unit or whatever
914
00:47:27.039 --> 00:47:30.039
the case is. Well, now when you want to upgrade that,
915
00:47:30.239 --> 00:47:34.320
you got to kind of touch multiple CS projects to
916
00:47:34.519 --> 00:47:36.599
kind of upgrade them all to the same version. Or
917
00:47:36.639 --> 00:47:39.679
maybe you have anyy framework in multiple pack projects or
918
00:47:39.719 --> 00:47:42.719
whatever the case is. So the ADA behind central package
919
00:47:42.719 --> 00:47:45.679
management is to centralize that so you have one spot
920
00:47:45.719 --> 00:47:49.679
to upgrade your package is not multiple. So you put
921
00:47:49.719 --> 00:47:53.039
a directory dot packages dot props file at the root
922
00:47:53.039 --> 00:47:54.920
of your project and you kind of define saying, hey,
923
00:47:54.920 --> 00:47:57.639
I want x unit, I want anity framework, here's the
924
00:47:57.719 --> 00:48:00.519
version I want. And then in your cs prode you
925
00:48:00.559 --> 00:48:04.119
just say, hey, the cs proge references Entity framework and
926
00:48:04.159 --> 00:48:06.960
you don't have a version in your cs proge. And
927
00:48:07.480 --> 00:48:10.760
because that's now managed centrally, right, so now you can
928
00:48:10.880 --> 00:48:14.119
keep everything in sync. You don't have to worry about like, oh,
929
00:48:14.159 --> 00:48:17.519
I'm upgrading dot net ten, I need to go upgrade
930
00:48:17.559 --> 00:48:20.480
all my packages the ten dot x in all my
931
00:48:20.840 --> 00:48:24.320
different projects. I can just do that centrally in the
932
00:48:24.440 --> 00:48:28.840
directory packages prop style. And this works in Visual Studio Writer,
933
00:48:29.079 --> 00:48:32.880
so there's integrations there too. So any ID you're using
934
00:48:32.920 --> 00:48:36.119
most likely has integrations with it at this point, so yeah,
935
00:48:36.280 --> 00:48:36.840
super easy.
936
00:48:37.000 --> 00:48:39.880
Yeah, another thing you should just be on. Hey, you
937
00:48:39.920 --> 00:48:43.119
were talking about more about testing, like, we obviously are
938
00:48:43.280 --> 00:48:45.639
keen to use tools, but what do you what's your
939
00:48:45.639 --> 00:48:46.559
approach to testing?
940
00:48:47.000 --> 00:48:48.280
That was gonna be my last thing I was going
941
00:48:48.320 --> 00:48:50.400
to talk about was of.
942
00:48:50.400 --> 00:48:53.800
Course I'm stealing your thunder brother, I, So I apologize.
943
00:48:56.519 --> 00:48:59.320
So I guess first off, I'll say, like automated tests,
944
00:48:59.360 --> 00:49:01.039
you should be doing it at this point.
945
00:49:01.159 --> 00:49:04.400
Yes, And the tooling is so good now right, Really
946
00:49:04.440 --> 00:49:06.159
we're running out of excuses yep.
947
00:49:06.400 --> 00:49:08.920
And I find most companies I work with now I
948
00:49:08.960 --> 00:49:12.000
don't have to convince them of this. But ten years
949
00:49:12.000 --> 00:49:14.639
ago that was a different story. Sure, because they've done
950
00:49:14.719 --> 00:49:19.400
like research, the Dora DevOps Research Assessment did a bunch
951
00:49:19.400 --> 00:49:21.239
of studies and basically one of the things that they
952
00:49:21.360 --> 00:49:24.639
proved was when they interviewed a bunch of software teams,
953
00:49:24.639 --> 00:49:27.679
like tens of thousands of software teams, that you move
954
00:49:27.719 --> 00:49:31.159
faster with tests, long term and with higher quality. So
955
00:49:32.480 --> 00:49:34.400
but I think it's even more important in this era
956
00:49:34.440 --> 00:49:37.119
of agentic coding. Like I mentioned, it keeps it on
957
00:49:37.159 --> 00:49:39.840
the rail, keeps a on the rails. I've been in
958
00:49:39.920 --> 00:49:43.480
projects that are have minimal tests versus ones that have
959
00:49:43.559 --> 00:49:46.039
a lot of tests, and AI does a way better
960
00:49:46.079 --> 00:49:49.559
job when they have those rails. So I personally use
961
00:49:49.679 --> 00:49:52.079
x unit for automated tests, but I don't get too
962
00:49:52.159 --> 00:49:53.840
caught up in it, Like the more important thing is
963
00:49:53.840 --> 00:49:56.000
you're writing tests, not that you're using x unit VERSU
964
00:49:56.039 --> 00:49:59.400
nd unit. Maybe not MS test. Don't do that one.
965
00:50:00.280 --> 00:50:02.679
Just kidding, Just have to take a shot at Microsoft.
966
00:50:02.719 --> 00:50:08.719
You're not kidding, come on, yeah, uh, but Microsoft themselves
967
00:50:08.760 --> 00:50:11.760
actually use x unit for dot net, the dot net
968
00:50:11.800 --> 00:50:14.079
repos and ASPN core repos. You can go see and
969
00:50:14.119 --> 00:50:17.400
they're using x unit. Little thing people don't know is
970
00:50:17.440 --> 00:50:20.159
there's x unit came out with a V three package
971
00:50:20.159 --> 00:50:23.320
about a year ago, and it's not just a version upgrade.
972
00:50:23.320 --> 00:50:25.719
It's actually called x unit dot v three. So if
973
00:50:25.760 --> 00:50:29.559
you want to get the new latest bits of x unit,
974
00:50:29.719 --> 00:50:32.159
you need to install that package. So I'm not going
975
00:50:32.159 --> 00:50:34.199
to get into the y. They didn't just bump the
976
00:50:34.280 --> 00:50:37.840
version instead create a new package. But a lot of
977
00:50:37.840 --> 00:50:41.199
people don't know that that it's a whole separate package.
978
00:50:41.199 --> 00:50:42.679
So I just want to call that out.
979
00:50:42.920 --> 00:50:45.760
Well, it was breaking changes, wasn't it. Fundamentally? That was
980
00:50:45.840 --> 00:50:46.400
the issue.
981
00:50:46.639 --> 00:50:49.239
Yep, it was breaking changes, and it was enough that
982
00:50:50.400 --> 00:50:53.320
the main primary maintainer thought it warranted a whole new
983
00:50:53.360 --> 00:50:57.400
package name, not just a higher version. So yeah, some
984
00:50:57.440 --> 00:51:00.119
people disagree, but right or wrong, that's what That's what
985
00:51:00.159 --> 00:51:00.800
the reality is.
986
00:51:01.039 --> 00:51:02.800
So yeah, but.
987
00:51:02.800 --> 00:51:07.480
As I'm creating tests, I start to sometimes what people
988
00:51:07.480 --> 00:51:08.880
do when they create tests is they have a lot
989
00:51:08.880 --> 00:51:12.400
of setup code, so like the arrange step step in
990
00:51:13.280 --> 00:51:15.639
arrange act assert And so I want to kind of
991
00:51:15.679 --> 00:51:21.840
call call back to this idea of Chekhov's gun, which is, uh,
992
00:51:22.199 --> 00:51:23.079
Chekhov was a.
993
00:51:23.079 --> 00:51:27.199
Russian playwright, sick, yeah, metamorphosis.
994
00:51:28.840 --> 00:51:31.920
He's a Russian playwright who basically said, if a gun
995
00:51:31.960 --> 00:51:34.039
is hanging on the wall in the first act, it
996
00:51:34.119 --> 00:51:37.440
should fire in a later act of the play. Otherwise
997
00:51:38.039 --> 00:51:42.440
it shouldn't be hanging there. So basically, removed should be mentioned. Yes,
998
00:51:42.840 --> 00:51:47.159
remove what's not relevant to the story. And now everybody's
999
00:51:47.159 --> 00:51:49.840
brains are racking all the shows that they've seen, where
1000
00:51:50.719 --> 00:51:52.679
like Game of Thrones that didn't actually have a lot
1001
00:51:52.719 --> 00:51:55.360
of relevance to the story later on, So yes they did.
1002
00:51:55.440 --> 00:51:59.400
Speaking of irrelevant, Metamorphosis was written by Kafka and not Chekhov. Sorry,
1003
00:51:59.440 --> 00:52:04.199
about that. You're good, I got my Russian authors mixed up.
1004
00:52:07.119 --> 00:52:09.840
And so we can actually apply that same logic of
1005
00:52:09.880 --> 00:52:13.320
remove what's not relevant to the story to our tests,
1006
00:52:13.360 --> 00:52:16.000
because lots of times I come into tests and there's
1007
00:52:16.039 --> 00:52:18.639
like five ten twenty fifty lines of code for the
1008
00:52:18.760 --> 00:52:21.920
range step, and then I go to the next next
1009
00:52:21.960 --> 00:52:24.639
test and there's five ten twenty fifty lines of the
1010
00:52:24.760 --> 00:52:27.280
range step, but there's like one slight difference and at
1011
00:52:27.320 --> 00:52:28.960
a glance I can't tell what the difference is.
1012
00:52:29.199 --> 00:52:32.800
Yeah, So instead covering so much code.
1013
00:52:32.599 --> 00:52:35.480
Yeah, and instead I want to like rip that out
1014
00:52:35.679 --> 00:52:38.360
and have the setup be more centralized in some way. Now,
1015
00:52:38.400 --> 00:52:40.320
there's lots of different ways to do this. You might
1016
00:52:40.400 --> 00:52:42.960
have a method do this, or an end unit you
1017
00:52:43.000 --> 00:52:45.679
can put it in a setup method, or an ex
1018
00:52:45.840 --> 00:52:48.760
unit you can put in constructor. But a lot of
1019
00:52:48.760 --> 00:52:51.920
times if I set up the happy path in whatever
1020
00:52:51.960 --> 00:52:56.320
setup construct that I have, then I'm just tweaking sad
1021
00:52:56.360 --> 00:52:58.960
paths in my test. And it's super obvious that, like, oh,
1022
00:52:59.000 --> 00:53:02.239
I'm setting first name to NOL and then I'm asserting that, hey,
1023
00:53:02.280 --> 00:53:04.639
I get an error message when first name is NOL,
1024
00:53:04.840 --> 00:53:07.679
And it's super easy to see versus you know, five
1025
00:53:07.760 --> 00:53:10.320
to twenty lines of setup that it's hard to pick out. Oh,
1026
00:53:10.400 --> 00:53:13.840
it's the null that's different. Right, So something to think
1027
00:53:13.840 --> 00:53:16.760
about when you're writing tests is, hey, what's actually relevant
1028
00:53:16.760 --> 00:53:19.320
to the story and what can I rip out and
1029
00:53:19.360 --> 00:53:21.239
make it a little bit easier at a glance? What's
1030
00:53:21.280 --> 00:53:24.840
different about this test versus a different test in this file.
1031
00:53:25.079 --> 00:53:30.360
So so that's just kind of a concept you can apply.
1032
00:53:30.840 --> 00:53:33.639
Is that Chekhov's gun concept of remove what's not relevant
1033
00:53:33.679 --> 00:53:35.559
to the story when it applies comes to your test.
1034
00:53:35.639 --> 00:53:38.519
Good stuff, And if you're using AI to write your tests,
1035
00:53:38.559 --> 00:53:40.800
then make sure you put that in the system prompt yep,
1036
00:53:40.920 --> 00:53:41.280
for sure.
1037
00:53:41.679 --> 00:53:45.239
Yeah, AI's applied Chekhov's gun. Yeah.
1038
00:53:45.599 --> 00:53:48.000
AI is really good at following pattern So if you
1039
00:53:48.079 --> 00:53:51.079
don't do that from the get go, it will start
1040
00:53:51.079 --> 00:53:53.280
to just proliferate that through your code base.
1041
00:53:53.440 --> 00:53:54.840
Yeah, it's fair enough.
1042
00:53:55.119 --> 00:53:59.119
This is such good advice, Scott, And it reminds me
1043
00:53:59.239 --> 00:54:03.039
of the pattern and practices blocks that we used to use.
1044
00:54:02.960 --> 00:54:03.760
Back in the day.
1045
00:54:04.079 --> 00:54:07.639
Back in the day. Yeah, just the right way to
1046
00:54:07.719 --> 00:54:11.440
do logging and the right way to do database access
1047
00:54:11.480 --> 00:54:13.840
and all that stuff. And of course those things change
1048
00:54:13.880 --> 00:54:16.559
and things get irrelevant, but it's really great to hear
1049
00:54:16.599 --> 00:54:20.880
your your thoughts and they're they're wonderful, So thank you.
1050
00:54:20.960 --> 00:54:24.440
Yeahoris, it's from a lot of pain I've experienced over
1051
00:54:24.480 --> 00:54:27.400
the years, so trying to distill that pain into sure
1052
00:54:27.880 --> 00:54:31.440
tips for people to go back and apply immediately back
1053
00:54:31.440 --> 00:54:31.840
at work.
1054
00:54:32.000 --> 00:54:33.840
Great. Well, thanks again, Scott.
1055
00:54:33.840 --> 00:54:35.480
It's been great talking to you and we'll talk to
1056
00:54:35.559 --> 00:54:59.360
you next time on dot net rocks. Dot net Rocks
1057
00:54:59.440 --> 00:55:02.159
is brought to you by Franklin's Net and produced by
1058
00:55:02.239 --> 00:55:06.239
Pop Studios, a full service audio, video and post production
1059
00:55:06.360 --> 00:55:10.360
facility located physically in New London, Connecticut, and of course
1060
00:55:10.360 --> 00:55:14.519
in the cloud online at pwop dot com.
1061
00:55:14.719 --> 00:55:16.880
Visit our website at d O T N E T
1062
00:55:17.079 --> 00:55:21.119
R O c k S dot com for RSS feeds, downloads,
1063
00:55:21.280 --> 00:55:24.960
mobile apps, comments, and access to the full archives going
1064
00:55:25.000 --> 00:55:28.239
back to show number one, recorded in September two.
1065
00:55:28.039 --> 00:55:31.079
Thousand and two. And make sure you check out our sponsors.
1066
00:55:31.199 --> 00:55:32.480
They keep us in business.
1067
00:55:32.880 --> 00:55:36.280
Now go write some code, see you next time. You
1068
00:55:36.400 --> 00:55:38.039
got a Javans
1069
00:55:40.119 --> 00:55:44.840
And
1
00:00:01.080 --> 00:00:03.799
How'd you like to listen to dot NetRocks with no ads?
2
00:00:04.440 --> 00:00:04.799
Easy?
3
00:00:05.320 --> 00:00:08.560
Become a patron for just five dollars a month you
4
00:00:08.599 --> 00:00:11.320
get access to a private RSS feed where all the
5
00:00:11.359 --> 00:00:14.560
shows have no ads. Twenty dollars a month will get
6
00:00:14.599 --> 00:00:17.679
you that and a special dot net Rocks patron mug.
7
00:00:18.160 --> 00:00:34.960
Sign up now at Patreon dot dot NetRocks dot com. Hey,
8
00:00:35.079 --> 00:00:38.960
welcome back to dot net Rocks episode two thousand and four.
9
00:00:39.119 --> 00:00:43.640
I'm Carl Franklin at Averagre Camra and Scott Sobers here.
10
00:00:43.640 --> 00:00:45.039
We're going to be talking to him in a minute,
11
00:00:45.039 --> 00:00:47.479
but you might hear him jump in on the intro here,
12
00:00:47.560 --> 00:00:49.640
because that's what we do now, right.
13
00:00:49.719 --> 00:00:52.920
Yeah, go to be at least for the next twenty
14
00:00:53.000 --> 00:00:56.479
or so episode, right, yeah, right, twenty two. I'm a
15
00:00:56.479 --> 00:00:59.560
little stressed about actually getting to the current history.
16
00:00:59.799 --> 00:01:02.200
Well well you know the shows won't have that wonderful
17
00:01:02.280 --> 00:01:06.040
intro again. Well we'll do something, but all right, something.
18
00:01:06.159 --> 00:01:09.799
I regret to inform everybody that I've got another cold
19
00:01:10.439 --> 00:01:13.959
luck at you and the gig tomorrow. Nice, just like
20
00:01:14.239 --> 00:01:17.560
last time. Save your voice, brother, Yeah, I'm gonna save
21
00:01:17.599 --> 00:01:18.159
it all.
22
00:01:18.159 --> 00:01:19.599
Right, A I fixed up?
23
00:01:19.840 --> 00:01:25.359
Or no, you know the best line when I get
24
00:01:25.439 --> 00:01:28.640
up on the microphone with the band is thank you
25
00:01:28.680 --> 00:01:32.840
for coming tonight. And tonight's show has absolutely no AI
26
00:01:33.079 --> 00:01:37.040
and people lose their minds, they roar, I'm sure, all right.
27
00:01:37.079 --> 00:01:40.159
So being two thousand and four, let's talk about the
28
00:01:40.200 --> 00:01:43.719
top events or the news events, the major news events
29
00:01:43.719 --> 00:01:47.359
so that year, unfortunately, we'll start with the Indian Ocean
30
00:01:47.359 --> 00:01:50.640
earthquake and tsunami. And we remember that, Yeah, I did.
31
00:01:50.680 --> 00:01:52.599
We did a bunch of fundraising for that, that's right.
32
00:01:52.680 --> 00:01:56.400
I remember Julie Lherman kind of spearheaded that she.
33
00:01:56.400 --> 00:02:01.359
Had friends in Bandahar right and needed help. Yeah, so
34
00:02:01.519 --> 00:02:03.680
they happened to be there. We're just wrapping up a
35
00:02:03.719 --> 00:02:06.959
charitable project when the tsunami and everyone needs a lot
36
00:02:06.959 --> 00:02:09.479
of help, and so we all dove in. We did
37
00:02:09.840 --> 00:02:13.199
a bunch of eBay auctions for time and resources and
38
00:02:13.240 --> 00:02:14.680
things like that and raised a lot of money.
39
00:02:14.759 --> 00:02:16.639
I think this might was am I wrong? Or is
40
00:02:16.680 --> 00:02:19.960
this one of the events that got you to consider
41
00:02:20.080 --> 00:02:21.919
doing the your charity?
42
00:02:22.120 --> 00:02:25.280
Yep, it's one of the catalysts of H two Box
43
00:02:25.439 --> 00:02:28.479
was watching what Julie was able to do, like she's
44
00:02:28.520 --> 00:02:29.840
such an inspiration mm hm.
45
00:02:30.400 --> 00:02:34.919
And we're talking about the humanitarian toolbox that Richard spearheaded. Okay,
46
00:02:35.000 --> 00:02:39.800
the Iraq war an insurgency escalation, So it didn't go
47
00:02:39.840 --> 00:02:40.479
well at first.
48
00:02:40.919 --> 00:02:44.879
No, Sadam is now gone right at that point, and
49
00:02:44.919 --> 00:02:48.199
now that comes the whole you broke it, you bought
50
00:02:48.240 --> 00:02:49.240
it phase.
51
00:02:49.159 --> 00:02:52.840
M Yeah, the Abu Grab prisoner abuse scandal. That was
52
00:02:52.879 --> 00:02:53.400
pretty bad.
53
00:02:53.719 --> 00:02:53.800
Ye.
54
00:02:54.240 --> 00:02:57.639
Madrid train bombings I remember this, Yeah, killed one hundred
55
00:02:57.639 --> 00:03:00.479
and ninety three people. I don't remember it having that
56
00:03:00.599 --> 00:03:03.840
big of a casualty number, but I guess it did.
57
00:03:04.439 --> 00:03:08.479
Trains are packed. Yeah, it was a right. Some more
58
00:03:08.520 --> 00:03:15.080
bad news. Darfur conflict escalated, big humanitarian crisis in Sudan.
59
00:03:16.280 --> 00:03:19.639
In the US, the presidential election of two thousand and four,
60
00:03:19.840 --> 00:03:22.919
George W. Bush defeated John Carry to win a second term.
61
00:03:23.280 --> 00:03:27.520
This September Eleventh Commission Report, which was a detailed report
62
00:03:27.560 --> 00:03:31.159
on the nine to eleven tax, the US Patriot Act
63
00:03:31.360 --> 00:03:36.400
reauthorization debates, so people were debating over civil liberties versus
64
00:03:36.560 --> 00:03:41.479
national security. NSA was big. And I remember interviewing Christian
65
00:03:41.520 --> 00:03:46.840
Bayer and he said NSA stands for no security anymore.
66
00:03:50.319 --> 00:03:54.120
Same sex marriage got legal in Massachusetts. Yeah, Mars. The
67
00:03:54.199 --> 00:03:58.240
Stewart went to jail. Yeah, and it wasn't even that much.
68
00:03:58.280 --> 00:04:00.919
It was like thirty grand or something something like that. Yeah,
69
00:04:00.960 --> 00:04:05.199
but insider trading is insider trading. The controversy over Mel
70
00:04:05.240 --> 00:04:09.039
Gibson's The Passion of the Christ boy, Oh Boy. And
71
00:04:09.280 --> 00:04:11.599
speaking of other movies, let's go through the top ten.
72
00:04:13.000 --> 00:04:17.360
National Treasure, which was a great fun movie. Nicholas Cage,
73
00:04:17.639 --> 00:04:21.120
Nicholas Cage. Yeah, Ocean's twelve, a bad Colooney, which was
74
00:04:21.160 --> 00:04:23.680
great at all. Think it was still pretty good. Shark Tale,
75
00:04:23.720 --> 00:04:25.399
which I never saw.
76
00:04:25.560 --> 00:04:27.000
But well you're not you don't have the little kids
77
00:04:27.000 --> 00:04:27.439
at that point.
78
00:04:27.519 --> 00:04:29.720
Well that's true, but I kind of still watched these
79
00:04:29.839 --> 00:04:34.279
big ones. Troy epic retelling of the Trojan War starring
80
00:04:34.279 --> 00:04:37.959
Brad Pitt. Brad Pitt is a gladiator. All the women's
81
00:04:38.000 --> 00:04:45.000
loved it. Day The Day after Tomorrow. I don't remember
82
00:04:45.040 --> 00:04:48.240
that one, but it was like a change global disaster film.
83
00:04:49.000 --> 00:04:51.199
And of course The Passion of the Christ to number five,
84
00:04:51.279 --> 00:04:53.759
The Incredibles number four. I did watch that and it
85
00:04:53.879 --> 00:04:58.600
was fun, fantastic, It was fun. And you know, my
86
00:04:58.680 --> 00:05:00.720
youngest daughter was only two years old, so I was
87
00:05:00.759 --> 00:05:05.920
watching these kind of things. Spider Man two. Okay, how
88
00:05:06.040 --> 00:05:08.680
much to say about that? Harry Potter and The Prisoner
89
00:05:08.759 --> 00:05:14.759
of Azba Khan Azkaban oz Kban. This is number two,
90
00:05:14.759 --> 00:05:17.240
and the number one grossing movie of two thousand and
91
00:05:17.279 --> 00:05:21.839
four is Shrek two. Yay, Shrek It again, Shrek and
92
00:05:21.920 --> 00:05:25.639
again and wow, I think Shrek and.
93
00:05:27.439 --> 00:05:28.959
Is it? Yeah?
94
00:05:29.199 --> 00:05:32.000
Shark Tail and Shrek were both from DreamWorks. Yeah, and
95
00:05:32.040 --> 00:05:34.399
they're both the number one, well in the top ten
96
00:05:34.560 --> 00:05:35.079
of that year.
97
00:05:35.480 --> 00:05:42.240
Awesome. Interesting forget what about Action's Janet Jackson's wardrobe malfunction.
98
00:05:42.439 --> 00:05:48.639
Wardrobe malfunction, Yes, at the at the power at Super Bowl. Yeah,
99
00:05:48.639 --> 00:05:50.240
we don't even remember the year, but that's what happened.
100
00:05:50.360 --> 00:05:53.160
The funniest part about that was her interview on Letterman
101
00:05:53.920 --> 00:05:57.240
the next day or whatever, and she was like, it
102
00:05:57.480 --> 00:06:04.560
just happened. I don't know, so I don't know. You
103
00:06:04.600 --> 00:06:07.959
guys got anything. I know, Richard, you've got space and technology.
104
00:06:08.000 --> 00:06:10.199
But Scott, do you remember anything about two thousand and
105
00:06:10.240 --> 00:06:11.079
four you want to share?
106
00:06:11.319 --> 00:06:14.319
Ah, Man, I don't know anything off hand. I mean
107
00:06:14.319 --> 00:06:17.439
I would have been a junior in high school at
108
00:06:17.439 --> 00:06:22.000
the time, but yeah, well that's an event. Yeah, it's
109
00:06:22.120 --> 00:06:24.040
almost done with high school all right, tell us about
110
00:06:24.040 --> 00:06:24.680
space and tech.
111
00:06:24.720 --> 00:06:27.279
Well, we're in the midst of the Columbia accident investigation.
112
00:06:28.079 --> 00:06:30.079
Columbia was lost in two thousand and three, so there's
113
00:06:30.120 --> 00:06:33.040
no Shuttle flying that year while the investigation's ongoing, and
114
00:06:33.079 --> 00:06:36.560
that means no additional building of the International Space Station easier.
115
00:06:36.639 --> 00:06:39.079
So the Russians are supporting the space station with progress
116
00:06:39.079 --> 00:06:42.480
and so used flights to bring cruise down. But there's
117
00:06:42.480 --> 00:06:44.399
plenty of other things going on at the time. The
118
00:06:44.839 --> 00:06:48.240
Stardust mission in January actually reaches Comet eighty one p
119
00:06:48.480 --> 00:06:51.800
wild and collects dust from a comet, which was its
120
00:06:51.839 --> 00:06:54.680
mission to return to the Earth, which is cool. Also
121
00:06:54.680 --> 00:06:59.439
in January, the Spirit Rover lands at the Gustev crater.
122
00:07:00.040 --> 00:07:04.439
Month later, the Opportunity Rover at Murdi and planum So
123
00:07:04.600 --> 00:07:09.600
and Nose rovers were designed to operate for ninety days. Yeah,
124
00:07:09.639 --> 00:07:12.560
and one lasted nine years and the other lasted fourteen.
125
00:07:13.040 --> 00:07:17.720
So for a variety of reasons, mostly to do with
126
00:07:18.120 --> 00:07:21.399
they got really good at understanding how the very thin
127
00:07:21.560 --> 00:07:25.480
atmosphere can actually kick up enough wind to blow the
128
00:07:25.600 --> 00:07:28.319
dust off the solar panels, and so they're able to
129
00:07:28.360 --> 00:07:30.959
keep clearing the solar panels off and keep the machines running.
130
00:07:31.199 --> 00:07:34.600
They loose spirit first, because it'll get stuck in sand
131
00:07:35.120 --> 00:07:38.000
at the wrong angle and ultimately we'll run out of power.
132
00:07:38.240 --> 00:07:40.160
The issue here for them primarily is to make sure
133
00:07:40.199 --> 00:07:43.240
they charged with the batteries enough to last overnight, because
134
00:07:43.279 --> 00:07:45.439
it gets very cold at night and equipment will freeze,
135
00:07:45.720 --> 00:07:47.560
and so you need to charge the batteries off solar
136
00:07:47.560 --> 00:07:50.560
panels to generate enough heat to be operational the next day,
137
00:07:50.639 --> 00:07:53.560
and so you're positioning before nightfall is super important.
138
00:07:53.560 --> 00:07:56.639
I remember doing a bit with Professor Schmackel on Mondays,
139
00:07:56.680 --> 00:07:59.240
which also started in two thousand and four. By the way,
140
00:07:59.319 --> 00:08:02.920
goodness forgot I left that one off the cultural list, Yeah,
141
00:08:03.120 --> 00:08:08.319
such as it is counter cultural, but yeah, I do
142
00:08:08.439 --> 00:08:10.040
remember that that happened.
143
00:08:10.040 --> 00:08:13.519
That was a big deal. Yeah. Also in two thousand
144
00:08:13.519 --> 00:08:16.319
and four, in June, the first flight of Spaceship one.
145
00:08:16.439 --> 00:08:20.279
This was Bert Rutan's technology trying to capture the Ansari prize.
146
00:08:20.480 --> 00:08:22.240
It's a subordable flight, but it does get above the
147
00:08:22.319 --> 00:08:25.480
Carmen line, and so Mike Melville becomes the first civilian
148
00:08:25.480 --> 00:08:29.160
astronaut ever in order to win the and sorry, prize,
149
00:08:29.279 --> 00:08:31.279
we'll have to do it again, which he will in
150
00:08:31.319 --> 00:08:37.240
September and so demonstrate that a reusable spacecraft. I mean,
151
00:08:37.240 --> 00:08:40.200
it's funny to think about, but in two thousand and
152
00:08:40.200 --> 00:08:42.240
four was an incredible breakthrough. Yeah.
153
00:08:42.399 --> 00:08:45.559
Wasn't the Shuttle supposed to be a reusable spacecraft? Is
154
00:08:45.600 --> 00:08:46.639
that what you're laughing about?
155
00:08:46.799 --> 00:08:49.720
Yes, it's also government not civilian. Yeah, And that was
156
00:08:49.759 --> 00:08:52.679
the whole point. Was privately funded, and that private funding
157
00:08:52.759 --> 00:08:56.600
was mostly Paul Allen. In July, the Cassini spacecraft, this
158
00:08:56.879 --> 00:09:01.000
bus size spacecraft flying to Saturn, reaches Saturday and gets
159
00:09:01.320 --> 00:09:03.120
into orbit round surround, the first thing to ever go
160
00:09:03.200 --> 00:09:06.080
into orbit around Saturn. And by December we'll release the
161
00:09:06.159 --> 00:09:09.159
Huygens probe onto Titan, the first time we'll ever soft
162
00:09:09.240 --> 00:09:10.919
land and the only time so far was soft landed
163
00:09:11.000 --> 00:09:11.679
anything on Titan.
164
00:09:11.759 --> 00:09:15.519
And Cassini also the name given by I think it
165
00:09:15.559 --> 00:09:17.240
was Scott gu three and team to the.
166
00:09:17.759 --> 00:09:21.759
Web server and visual studio. Okay, Cassini, there was a
167
00:09:21.759 --> 00:09:25.480
few of them. Messenger is the first spacecraft to go
168
00:09:25.480 --> 00:09:29.480
into orbit around Mercury. It launches in August of two
169
00:09:29.480 --> 00:09:31.200
thousand and four. It won't actually get into orbit around
170
00:09:31.200 --> 00:09:34.360
Mercury till twenty eleven seven years. It'll take longer than
171
00:09:34.399 --> 00:09:37.240
it takes Cassini to get to Jupiter because it needs
172
00:09:37.279 --> 00:09:40.759
to slow down so much to actually be able to
173
00:09:40.799 --> 00:09:44.519
be captured by Mercury that it'll do a flyby of Earth,
174
00:09:44.600 --> 00:09:47.879
two fly bys of Venus, and three flybys of Mercury
175
00:09:48.519 --> 00:09:50.600
to slow itself down enough to finally be captured by
176
00:09:50.639 --> 00:09:53.480
Mercury twenty eleven, and it'll do a complete map of
177
00:09:53.480 --> 00:09:55.720
Mercury and a bunch of further cool mission.
178
00:09:55.759 --> 00:09:59.840
See scientists, real folks, it's tricky laws of physics. Yeah,
179
00:10:00.120 --> 00:10:01.000
not just a good idea.
180
00:10:01.120 --> 00:10:03.759
And as you get closer to the Sun, it accelerates
181
00:10:03.759 --> 00:10:07.480
you a lot, so scrapping speed is hard. Finally, in December,
182
00:10:07.559 --> 00:10:11.000
Voyage Year one, launched in seventy seven or seventy nine,
183
00:10:11.639 --> 00:10:15.399
reaches the termination shock. That's the point at which the
184
00:10:15.440 --> 00:10:19.440
solar wind being pressed out from our star is pushed
185
00:10:19.480 --> 00:10:23.679
back by the interstellar wind, and so he crosses through
186
00:10:23.720 --> 00:10:27.279
that and we get new information from it. So that's
187
00:10:27.320 --> 00:10:29.440
all we get from space. Let's talk a little bit
188
00:10:29.440 --> 00:10:31.000
on the compute side, because I find I feel like
189
00:10:31.000 --> 00:10:33.759
two thousand and four is more important year than you realize. Okay,
190
00:10:33.840 --> 00:10:36.720
I would argue that this is the year that we
191
00:10:36.759 --> 00:10:39.799
recover from the dot com boom, Right, So, I mean
192
00:10:39.799 --> 00:10:41.360
the dot com boom it sort of ended in two
193
00:10:41.360 --> 00:10:43.360
thousand and one, and all the money it sort of disappeared.
194
00:10:43.360 --> 00:10:45.440
It's not like the web or anything went away. But
195
00:10:45.720 --> 00:10:49.519
I would argue that the harbinger event was Google's IPO,
196
00:10:50.600 --> 00:10:52.720
So they you know, had been born during the dot
197
00:10:52.799 --> 00:10:54.519
com boom, but they were in one of the companies
198
00:10:54.519 --> 00:10:57.840
that did not fail became the fundamental search tool of
199
00:10:57.879 --> 00:11:01.320
all time arguably still is today, and they were essentially
200
00:11:01.360 --> 00:11:03.440
forced to IPO they had too many shareholders and the
201
00:11:03.480 --> 00:11:07.240
SEC required it, so that they went somewhat reluctantly, but
202
00:11:07.360 --> 00:11:10.039
the response by the market was very positive. It's sort
203
00:11:10.080 --> 00:11:14.840
of the first good news about the web post dot com.
204
00:11:15.279 --> 00:11:17.320
This is also the year that O'Riley starts their Web
205
00:11:17.360 --> 00:11:21.360
two point zero conference where they talk about the focus
206
00:11:21.399 --> 00:11:25.399
on user contributed content things like wikis and blogs and
207
00:11:26.039 --> 00:11:28.240
ultimately social media, so how that comes from that. And
208
00:11:28.240 --> 00:11:31.879
speaking of social media, this is the year that a
209
00:11:31.919 --> 00:11:35.320
young Harvard student named Mark Zuckerberg starts a website called
210
00:11:35.679 --> 00:11:39.360
the Facebook. The Facebook. Oh, and also speaking of Google,
211
00:11:39.440 --> 00:11:42.320
on April first, they launch Gmail and everybody thinks it's
212
00:11:42.320 --> 00:11:45.120
a joke. Yeah, yeah, why I remember you had to
213
00:11:45.480 --> 00:11:47.759
thinking you had to be invited to that program. Yeah,
214
00:11:47.759 --> 00:11:49.799
that's right. It was the longest beta ever and just
215
00:11:49.879 --> 00:11:52.759
kept going and going and going. That turned out for them.
216
00:11:53.000 --> 00:11:56.360
On the Intel side, Intel final delivers the EM sixty
217
00:11:56.399 --> 00:11:58.559
four t on a Xenon. This is based on Dave
218
00:11:58.639 --> 00:12:01.919
Cutler's Windows on Windows mindset of like can we make
219
00:12:01.960 --> 00:12:04.039
sixty four bit process? It'll run thirty two bit properly.
220
00:12:04.039 --> 00:12:06.559
It actually makes sixty four come true because it has
221
00:12:06.639 --> 00:12:10.720
become the Itanic and so the Zenon No Kona is
222
00:12:10.759 --> 00:12:14.320
sort of the first towards that Cutler had actually worked
223
00:12:14.320 --> 00:12:17.480
with AMD first. So AMD had solved this problem and
224
00:12:17.480 --> 00:12:19.519
now Intel was playing catch up. One would argue this
225
00:12:19.559 --> 00:12:22.320
is the point where Intel really fell behind. Two thousand
226
00:12:22.320 --> 00:12:25.759
and four, the year of XP s P two. Oh boy,
227
00:12:25.799 --> 00:12:28.440
what a year that was. Yeah, one would argue the
228
00:12:28.519 --> 00:12:31.720
setup for the debacle that becomes Vista. You know, The
229
00:12:31.840 --> 00:12:34.000
argument here is that it was a breaking change to
230
00:12:34.080 --> 00:12:36.840
Windows XP, so it should have been XP version two.
231
00:12:37.720 --> 00:12:40.240
But in back in those days, you charged for a
232
00:12:40.279 --> 00:12:42.960
new version of an operating system, and Microsoft rannted everybody
233
00:12:42.960 --> 00:12:45.080
to install SP two, So making it a service pack
234
00:12:45.360 --> 00:12:47.080
was the right thing to do from a let's get
235
00:12:47.080 --> 00:12:50.600
this security out into the world perspective, but with lots
236
00:12:50.600 --> 00:12:54.039
of long term consequences from that yep. Two thou four
237
00:12:54.200 --> 00:12:57.240
is the year of the final version of fox Pro
238
00:12:57.399 --> 00:13:00.159
visual fox Pro nine, which had been booted out a
239
00:13:00.279 --> 00:13:03.679
visual studio as a visual Studio dot net in two
240
00:13:03.720 --> 00:13:05.600
thousand and two. It's now living on its own, and
241
00:13:05.639 --> 00:13:07.519
this is the final version of they will Ship. Beth
242
00:13:07.600 --> 00:13:10.600
Massy wasn't happy, No, none of the They can't really
243
00:13:10.600 --> 00:13:12.960
blame him, it's fair now. Two thousand and four is
244
00:13:13.000 --> 00:13:16.720
the year that Miguel diac has a Ship's the first
245
00:13:16.799 --> 00:13:20.039
version of Mono. He'd announced it in two thousand and
246
00:13:20.080 --> 00:13:22.960
one at another O'Reilly conference that he thought it was
247
00:13:23.000 --> 00:13:25.879
a good idea and effectively destroyed his career because all
248
00:13:25.919 --> 00:13:27.799
the Microsoft people are like, are you that Linux guy?
249
00:13:27.879 --> 00:13:29.799
And all thewis people are like, don't you work with
250
00:13:29.879 --> 00:13:35.120
Microsoft technology? So he couldn't win. It's hard to be Miguel,
251
00:13:35.279 --> 00:13:37.799
But yeah, that's the first time Mona comes out. Another
252
00:13:38.159 --> 00:13:44.159
important open source product Ruby on rails. In July, David
253
00:13:44.559 --> 00:13:48.840
Heinemeier Hansen DHH, who is a very controversial figure today,
254
00:13:49.000 --> 00:13:53.840
certainly guy behind base Camp. Takes an old language from
255
00:13:53.840 --> 00:13:55.919
the nineties Ruby that nobody cared all that much about,
256
00:13:56.000 --> 00:13:58.879
combines it with a scaffolding he calls rails and makes
257
00:13:58.919 --> 00:14:01.960
a phenomenal an old web tool, and again we talk
258
00:14:02.000 --> 00:14:05.279
about the rebirth of the web, reinterest in the web.
259
00:14:05.720 --> 00:14:09.679
Ruby all rails became this incredible prototyping tool for building
260
00:14:09.720 --> 00:14:13.200
websites fast. Yeah. People thought of it as like visual
261
00:14:13.200 --> 00:14:15.679
basic for the web. Yeah really, and you know, build
262
00:14:15.679 --> 00:14:17.360
it up, tear it down, just give data off you go.
263
00:14:17.440 --> 00:14:19.960
It was amazing. And I'm gonna mention two games only
264
00:14:19.960 --> 00:14:22.960
because I think they're profoundly important in gaming even today.
265
00:14:23.399 --> 00:14:26.279
This is the year that World of Warcraft launches under Blizzard,
266
00:14:26.600 --> 00:14:30.159
so that massive multiplayer game. It's still ongoing today. Wow
267
00:14:30.200 --> 00:14:35.000
and Wow from Valve Half Life two, and that's all
268
00:14:35.000 --> 00:14:35.320
I got.
269
00:14:35.360 --> 00:14:37.679
All right, I got I got one from two thousand
270
00:14:37.679 --> 00:14:41.240
and four tech related me. Firefox got released.
271
00:14:41.720 --> 00:14:45.159
So yeah, they they came out. It was no longer Phoenix,
272
00:14:45.679 --> 00:14:47.519
right as the first version was called Phoenix. Then they
273
00:14:47.519 --> 00:14:49.879
found oh you can't call it Phoenix, so they rebranded
274
00:14:49.919 --> 00:14:51.240
as Firefox. In two thousand and four.
275
00:14:51.480 --> 00:14:54.360
Yeah, and I don't think Firebug wasn't out at the time,
276
00:14:54.440 --> 00:14:57.480
but I did credit Firefox for like the developer tools
277
00:14:57.519 --> 00:15:00.000
that we have today in inspiring that with fire firebugg.
278
00:15:00.519 --> 00:15:03.519
So what about Firebase. Was that part of that whole
279
00:15:03.639 --> 00:15:05.600
thing or is that a separate thing part of the
280
00:15:05.600 --> 00:15:06.279
suite as well?
281
00:15:06.559 --> 00:15:08.759
All right, you're right. It does tie you into my
282
00:15:08.840 --> 00:15:12.559
larger message of this is the webabilitating because what the
283
00:15:12.720 --> 00:15:15.759
Mozilla Foundation was doing was building real dev tools for
284
00:15:15.799 --> 00:15:18.679
web devs. You weren't just hacking away like your ability
285
00:15:18.720 --> 00:15:21.279
to work in fire I was not necessarily a Firewok
286
00:15:21.399 --> 00:15:24.639
Fox fan, but if you had to build a web
287
00:15:24.679 --> 00:15:26.519
page and you weren't using Firefox, you were just torturing
288
00:15:26.559 --> 00:15:30.720
yourself like they figured out all F twelve before everybody else. Yep, yeah,
289
00:15:30.919 --> 00:15:33.559
like that's where that came from. Good enough that everybody
290
00:15:33.559 --> 00:15:36.000
copied it. All right, are we ready for better? No framework,
291
00:15:36.240 --> 00:15:38.679
Let's do the thing with the stuff, roll the music?
292
00:15:46.240 --> 00:15:46.639
All right, man?
293
00:15:46.639 --> 00:15:47.519
What do you got? All right?
294
00:15:47.559 --> 00:15:50.919
Well, although he didn't write it, our friend Simon Kropp
295
00:15:51.000 --> 00:15:52.120
brought this to my attention.
296
00:15:52.559 --> 00:15:55.919
I'm shocked Shock has done. This is cool.
297
00:15:56.000 --> 00:16:00.600
This is a Windows Defender performance tool interesting. It's a
298
00:16:00.639 --> 00:16:04.879
dot net application that monitors Windows Defender ETW events and
299
00:16:05.000 --> 00:16:09.399
visualizes scan durations in real time using a stacked bar chart.
300
00:16:09.879 --> 00:16:15.120
It can also visualize snapshots recorded offline with the PowerShell
301
00:16:15.120 --> 00:16:20.799
command lit and so listens to the Anti Malware Engine
302
00:16:21.480 --> 00:16:26.559
stream scan request tasks, stop ETW events, displays the scan
303
00:16:27.120 --> 00:16:29.759
durations per process, and a stacked bar chart. This is
304
00:16:29.799 --> 00:16:32.519
all real time. You can drag and drop files or
305
00:16:32.559 --> 00:16:34.840
folders onto the window to trigger an immediate scan of
306
00:16:34.879 --> 00:16:38.600
the dropped items and export to CSB when more than
307
00:16:38.639 --> 00:16:42.879
one snapshot is dragged to the window. It's all I know.
308
00:16:43.200 --> 00:16:47.159
It looks really cool. It's MIT licensed, and you know that.
309
00:16:47.360 --> 00:16:48.080
I think.
310
00:16:49.399 --> 00:16:56.080
There's an urgency about knowing what threats are out there
311
00:16:56.200 --> 00:16:58.879
as soon as possible, because by the time you see it,
312
00:16:58.919 --> 00:16:59.559
you're vulnerable.
313
00:17:00.000 --> 00:17:02.799
ILS argue that people blame Defender for performance problems all
314
00:17:02.799 --> 00:17:05.039
the time, and this is a tool that surfaces this
315
00:17:05.119 --> 00:17:06.799
is what Defender's actually doing. Yep.
316
00:17:06.920 --> 00:17:09.519
So it's very very cool. And Defender should always be on.
317
00:17:09.640 --> 00:17:11.720
If you ask me, that's you have to fight to
318
00:17:11.759 --> 00:17:12.240
turn it off.
319
00:17:12.279 --> 00:17:14.119
Yeah, right, And it's on by default mostly you know,
320
00:17:14.279 --> 00:17:16.200
the average mortal has it on, doesn't even know it
321
00:17:16.279 --> 00:17:19.000
doesn't even know, right, I think for us in dev,
322
00:17:19.039 --> 00:17:21.480
because we torture our machines, so you're often looking for
323
00:17:21.519 --> 00:17:23.839
like what's eating up all the resources? And let's be clear,
324
00:17:24.559 --> 00:17:28.880
you dump, especially new executables that you have generated that
325
00:17:28.960 --> 00:17:32.119
are unsigned. You trigger a defender when you do that,
326
00:17:32.480 --> 00:17:34.799
and sometimes those things can really hit a lot of cycles.
327
00:17:34.880 --> 00:17:40.240
Yeah, so hats off to Alexander Eulatin for putting this
328
00:17:40.359 --> 00:17:40.799
out there.
329
00:17:41.920 --> 00:17:45.039
Go get it. I'm gonna awesome. So who's talking to
330
00:17:45.160 --> 00:17:48.279
us today? Richard grad to comment off a show two thousand?
331
00:17:48.559 --> 00:17:48.960
Wow.
332
00:17:49.079 --> 00:17:51.200
Yeah, we published two thousand episodes. When do you know
333
00:17:51.359 --> 00:17:54.279
what a great show? And Aaron Old said, this podcast
334
00:17:54.279 --> 00:17:58.200
has been my longest continually listened to podcasts. The information
335
00:17:58.279 --> 00:17:59.960
that you have shared has been instrument to my twenty
336
00:18:00.079 --> 00:18:02.680
five plus year career in dot net. I remember the
337
00:18:02.720 --> 00:18:05.000
first time that one of my comments was read on
338
00:18:05.079 --> 00:18:07.519
the air. I was driving to work and I had
339
00:18:07.559 --> 00:18:09.359
to pull off on the road in the parking lot
340
00:18:09.400 --> 00:18:11.799
and listen to Richard read my comment. I was so excited.
341
00:18:12.160 --> 00:18:15.039
I do hope you guys continue to do the good work. Yeah, well,
342
00:18:15.039 --> 00:18:18.599
there you go eron, I read another one, so don't crash.
343
00:18:18.880 --> 00:18:21.240
Yeah right, it's gonna be fine, it's gonna be fun.
344
00:18:21.279 --> 00:18:23.920
Everything's okay. Yeah, and thanks so much for sticking with us,
345
00:18:23.960 --> 00:18:28.000
because we've been we're still doing this thing somehow Sometimes
346
00:18:28.039 --> 00:18:30.640
I wonder how all right? Yeah, two thousand shows in
347
00:18:31.039 --> 00:18:32.319
so thank you so much for your comment. And a
348
00:18:32.359 --> 00:18:33.960
copy of music co buy is on its way to you.
349
00:18:34.079 --> 00:18:35.759
And if you'd like copy of musicobe I read a
350
00:18:35.799 --> 00:18:37.720
comment on the website at dot NetRocks dot com or
351
00:18:37.759 --> 00:18:39.799
on the facebooks publish every show there. And if you
352
00:18:39.799 --> 00:18:41.319
comment there and to reading the show, well, I do
353
00:18:41.279 --> 00:18:41.880
you copy music?
354
00:18:41.960 --> 00:18:43.920
Go buy music to code by dot net if you
355
00:18:43.960 --> 00:18:46.559
want to just go get it? Okay, nice, go get it.
356
00:18:46.599 --> 00:18:47.000
Good link.
357
00:18:48.440 --> 00:18:52.240
So let's introduce Scott. You heard from him before just
358
00:18:52.359 --> 00:18:54.960
recently a couple of things. Scott Sober is the director
359
00:18:55.000 --> 00:18:59.200
of Engineering at Lean Techniques, a consultancy of about one
360
00:18:59.279 --> 00:19:02.799
hundred and seventy people based in the Midwest. Besides advising
361
00:19:02.839 --> 00:19:05.519
clients and delivering solutions for them, he enjoys helping teams
362
00:19:05.559 --> 00:19:10.759
realize their potential through technical practices and working more effectively together.
363
00:19:11.279 --> 00:19:16.000
He's a Microsoft MVP a Redgate Community Ambassador, international speaker,
364
00:19:16.200 --> 00:19:19.720
dome train author. He co organizes the Iowa dot Net
365
00:19:19.799 --> 00:19:23.119
User group and co organizes the Iowa Code Camp. You
366
00:19:23.160 --> 00:19:27.640
can find him pretty much anywhere online at Scottsaber. Welcome Scott.
367
00:19:27.680 --> 00:19:30.119
Yeah, thanks for having me, guys, first time, right it is.
368
00:19:30.279 --> 00:19:32.759
It is my first time. So excited to be here.
369
00:19:33.279 --> 00:19:36.680
Awesome. We've seen each other at the conferences for many,
370
00:19:36.720 --> 00:19:39.480
many years, so sorry about that. Shouldn't have been this lot,
371
00:19:39.599 --> 00:19:42.880
But I think his talk You've got is really cool,
372
00:19:42.960 --> 00:19:45.359
Like it's such a good idea to just sort of
373
00:19:45.480 --> 00:19:47.720
have a I gues you call it a checklist of
374
00:19:47.880 --> 00:19:49.680
things you're going to do in a dot net app.
375
00:19:49.759 --> 00:19:53.079
Yeah, totally, and uh yeah, just fair warning. This might
376
00:19:53.119 --> 00:19:54.799
be a little bit of a dense show of just
377
00:19:55.240 --> 00:19:58.519
random fire of different tips, but hopefully people will be
378
00:19:58.519 --> 00:20:00.680
able to walk away with something that they and literally
379
00:20:00.880 --> 00:20:03.200
take and apply immediately after the show.
380
00:20:03.440 --> 00:20:04.960
So it's called nutritional value.
381
00:20:05.200 --> 00:20:11.720
Unlike what we just did for the last twenty minutes.
382
00:20:10.200 --> 00:20:16.240
Dark here comes to Broccoli, right, Yeah, well where do
383
00:20:16.319 --> 00:20:16.640
we start?
384
00:20:16.680 --> 00:20:17.680
All right? All right?
385
00:20:17.759 --> 00:20:21.440
You go, Yeah, so probably one of the first things
386
00:20:21.480 --> 00:20:23.319
I talked about, and I know you guys have had
387
00:20:23.359 --> 00:20:26.160
people on the show talking about this topic is around
388
00:20:26.200 --> 00:20:30.559
feature folders. So I'm a big fan of organizing my
389
00:20:30.680 --> 00:20:34.480
code around feature folders as opposed to the traditional kind
390
00:20:34.519 --> 00:20:37.839
of way. So to kind of talk through that, a
391
00:20:37.880 --> 00:20:39.680
lot of people are familiar with, like you know, you
392
00:20:39.759 --> 00:20:42.119
might have like a data project or like you know,
393
00:20:42.240 --> 00:20:46.400
repository services, and like those all kind of live in
394
00:20:46.480 --> 00:20:50.799
different folders. You know, if you're doing NBC and rendering
395
00:20:50.839 --> 00:20:53.039
that on the server, you got like your views folder,
396
00:20:53.039 --> 00:20:55.279
your controllers folder, models folder.
397
00:20:55.640 --> 00:20:59.359
And just the way you don't look for anything exactly right.
398
00:20:59.480 --> 00:21:01.680
Yeah, So anytime you need to add a feature, you
399
00:21:01.720 --> 00:21:04.880
got to go touch upwards of you know, five ten
400
00:21:04.960 --> 00:21:07.240
folders just to add a feature. And if you want
401
00:21:07.240 --> 00:21:09.319
to delete a feature, now you got to go find
402
00:21:09.359 --> 00:21:12.200
it everywhere too, and it's just kind of scattered. So
403
00:21:12.880 --> 00:21:14.799
future folders kind of flips that on its head, and
404
00:21:14.880 --> 00:21:17.559
rather than organizing by like type of things, rather than
405
00:21:17.599 --> 00:21:21.279
having like a model's folder, controllers folder, you organized by feature.
406
00:21:21.440 --> 00:21:25.079
So let's say you've got my profile feature for instance,
407
00:21:25.839 --> 00:21:28.720
anything to do with that feature goes in a folder
408
00:21:28.759 --> 00:21:31.680
called my profile, so it's all kind of co located together.
409
00:21:32.160 --> 00:21:34.240
It's very easy to see at a glance what your
410
00:21:34.279 --> 00:21:39.000
features are, and so we want that code by future.
411
00:21:39.160 --> 00:21:41.079
Yep, it makes sense really. I mean it's kind of
412
00:21:41.160 --> 00:21:44.640
like we do that with projects, right. We have projects
413
00:21:44.799 --> 00:21:48.119
that are based you know, components or DLLs or whatever,
414
00:21:48.160 --> 00:21:50.400
they are based on what they do, and just take
415
00:21:50.400 --> 00:21:54.160
it another step inside those projects organizing feature folders.
416
00:21:54.240 --> 00:21:54.400
Yeah.
417
00:21:54.400 --> 00:21:56.279
Great, So I kind of use the analogy if in
418
00:21:56.319 --> 00:21:58.799
case somebody still thinks that this is like heresy, I
419
00:21:59.359 --> 00:22:00.960
challenge people think about, Oh.
420
00:22:00.880 --> 00:22:03.200
It's it's heresy, but it's good heresy.
421
00:22:03.480 --> 00:22:08.079
Yeah, exactly. If you think about like your house or
422
00:22:08.119 --> 00:22:11.160
your apartment or wherever you live, think about where you
423
00:22:11.279 --> 00:22:13.920
keep the soap in your house, Like do you have
424
00:22:13.960 --> 00:22:17.799
a closet full of all the different soap like hand soap, shampoo,
425
00:22:18.880 --> 00:22:24.440
body soap, dishwasher soap. Yeah, probably not. You probably keep
426
00:22:24.519 --> 00:22:27.079
that soap close to where it's used, Like you keep
427
00:22:27.119 --> 00:22:31.119
the hand soap by the sink, the shampoo in the shower,
428
00:22:31.519 --> 00:22:34.920
and so you use it where it's most used. You
429
00:22:34.960 --> 00:22:37.319
don't just have a soap closet you go reach into
430
00:22:37.440 --> 00:22:38.480
to go grab the soap.
431
00:22:38.720 --> 00:22:41.559
So God, I love the idea of a soap closet, the.
432
00:22:41.559 --> 00:22:44.839
First time I heard about feature folders, I was just like, duh,
433
00:22:45.400 --> 00:22:48.119
why didn't I do that? You know, it's it's just
434
00:22:48.720 --> 00:22:49.720
makes your life easier.
435
00:22:49.920 --> 00:22:52.240
Any any gotcha's what do you have to do to
436
00:22:52.240 --> 00:22:53.359
make feature folders work?
437
00:22:53.359 --> 00:22:56.079
Well, honestly, not a whole lot. I mean, if you're
438
00:22:56.079 --> 00:23:01.279
doing like server rendered NBC or raise the pages, is
439
00:23:01.319 --> 00:23:05.720
just a slight change you need to do to have
440
00:23:05.759 --> 00:23:08.119
a go look in that folder. But it's usually one
441
00:23:08.119 --> 00:23:10.880
liner to add that. I've got a blog post on
442
00:23:10.880 --> 00:23:12.279
how to do that, so we could drop that in
443
00:23:12.319 --> 00:23:14.400
the show notes in case people are interested. But otherwise,
444
00:23:14.400 --> 00:23:17.359
if you're just building an API, it should just work.
445
00:23:17.640 --> 00:23:17.839
Yep.
446
00:23:18.440 --> 00:23:20.960
So there's nothing magic about a controller's folder, for instance,
447
00:23:21.680 --> 00:23:25.839
as long as you are you know, there's a few
448
00:23:25.839 --> 00:23:29.240
different ways that can discover it. Whether you know it
449
00:23:29.279 --> 00:23:33.279
has the API controller attribute or the suffix of the
450
00:23:33.440 --> 00:23:38.599
classes controller, it'll find it that way. So there's really
451
00:23:38.640 --> 00:23:41.359
nothing magical about these folders for the most part, other
452
00:23:41.400 --> 00:23:43.240
than in like server rendered NBC.
453
00:23:43.799 --> 00:23:45.960
So how many folders deep like you do you have
454
00:23:46.079 --> 00:23:49.000
like my profile and under that controllers or do you
455
00:23:49.079 --> 00:23:52.720
just have the if you have one or two controller files,
456
00:23:52.720 --> 00:23:53.799
you just put them right there.
457
00:23:53.880 --> 00:23:57.000
Yeah, that's that's a good question. Usually I'll I won't
458
00:23:57.480 --> 00:24:03.440
start with nesting more folders underneath that until I find i,
459
00:24:03.480 --> 00:24:05.519
you know, starting to get tons of files in there
460
00:24:05.519 --> 00:24:08.400
and things like that. Yeah, it just kind of depends.
461
00:24:08.480 --> 00:24:11.240
But a lot of times I'll just kind of put
462
00:24:11.400 --> 00:24:13.680
things in there, and usually it's not more than you know,
463
00:24:13.799 --> 00:24:16.480
four to six files or so. So I find that
464
00:24:16.559 --> 00:24:17.799
usually pretty easy to manage.
465
00:24:18.160 --> 00:24:19.839
Very good, cool, good stuff.
466
00:24:20.640 --> 00:24:23.279
That's number two, all right, moving on to number two.
467
00:24:24.759 --> 00:24:28.200
So this is treat warnings as errors.
468
00:24:28.559 --> 00:24:29.759
Look at your believer.
469
00:24:29.960 --> 00:24:36.039
You being consultant, you get dropped into different projects all
470
00:24:36.039 --> 00:24:38.680
the time, and it's always not the best experience when
471
00:24:38.680 --> 00:24:40.200
you pull down a project for the first time you
472
00:24:40.240 --> 00:24:43.160
build it and there's like hundreds or even thousands of
473
00:24:43.359 --> 00:24:47.599
warnings of compiler warnings that you know, you're like, okay,
474
00:24:47.640 --> 00:24:49.559
which ones of these are valid? Which ones are not?
475
00:24:50.279 --> 00:24:53.920
I don't know what to do, And so I like
476
00:24:54.480 --> 00:24:57.960
treating warnings as errors. And so basically warnings don't exist
477
00:24:58.000 --> 00:25:00.279
in my world. It should either be something that I
478
00:25:00.400 --> 00:25:03.799
fix or something like I explicitly ignore because for whatever
479
00:25:03.839 --> 00:25:05.480
reason that warning is invalid.
480
00:25:05.559 --> 00:25:08.720
It's not necessary. Yeah, I mean and to your point there,
481
00:25:08.759 --> 00:25:11.759
it's more about don't be blind to the warnings that
482
00:25:11.759 --> 00:25:14.240
are actually important. So when you leave all those warnings on,
483
00:25:14.839 --> 00:25:17.319
you ignore them all correct, Yeah, because.
484
00:25:17.079 --> 00:25:20.279
A lot of times you're getting those warnings and there's
485
00:25:20.400 --> 00:25:22.960
something that's going to happen, might not be right away.
486
00:25:23.279 --> 00:25:25.079
Yeah, like there deprecation warning.
487
00:25:25.000 --> 00:25:30.519
Yeah, that you should be making the change to actually,
488
00:25:30.960 --> 00:25:33.279
you know, go go fix whatever the thing is.
489
00:25:33.680 --> 00:25:37.119
So yeah, often those warnings suddenly become real errors when
490
00:25:37.119 --> 00:25:39.200
you move up a version of the framework because there
491
00:25:39.200 --> 00:25:41.000
were a deprecation warning has been going on for like
492
00:25:41.119 --> 00:25:43.519
three versions that you've been ignoring you and would have
493
00:25:43.519 --> 00:25:45.400
been easy to fix yep at some point.
494
00:25:45.480 --> 00:25:47.559
And that's as simple in case people are wondering, that's
495
00:25:47.559 --> 00:25:49.680
a simple as going in your csprog and there's a
496
00:25:49.759 --> 00:25:52.799
treat warnings as errors flag and you just split that
497
00:25:52.839 --> 00:25:53.960
to true in the XML.
498
00:25:54.119 --> 00:25:55.160
So that's very good.
499
00:25:55.200 --> 00:25:55.920
As simple as that.
500
00:25:55.960 --> 00:25:56.640
Awesome cool.
501
00:25:57.160 --> 00:26:03.039
So the third one is authorization using something called fallback
502
00:26:03.119 --> 00:26:07.000
policy in asp DO core. So let's talk about why
503
00:26:07.119 --> 00:26:10.640
the why first before we get into the what it is.
504
00:26:10.920 --> 00:26:15.119
So the problem is, by default, ASPI core security is
505
00:26:15.240 --> 00:26:18.000
opt in, meaning if you're doing controller, you got to
506
00:26:18.000 --> 00:26:21.119
add an authorized attribute and have to remember to do that,
507
00:26:21.559 --> 00:26:25.599
or in minimal APIs you have to remember to say
508
00:26:25.640 --> 00:26:30.160
like require authorization on a minimal API, and if you forget,
509
00:26:31.000 --> 00:26:34.240
now that API is exposed to the whole world, which
510
00:26:34.279 --> 00:26:38.640
is obviously not great. And so instead what I want
511
00:26:38.799 --> 00:26:43.240
is secure by default. So with something called the fallback
512
00:26:43.279 --> 00:26:47.200
policy and ASP do core. The idea there is, if
513
00:26:47.200 --> 00:26:52.160
you haven't specified anything else, you apply this fallback policy.
514
00:26:52.200 --> 00:26:54.240
So you can set the fallback policy to say, hey,
515
00:26:54.279 --> 00:26:57.440
require an authenticated user, and so at least you have
516
00:26:57.480 --> 00:27:00.240
to be logged in to hit that API or or
517
00:27:00.559 --> 00:27:04.000
whatever the case is. Or you know, if you are
518
00:27:04.000 --> 00:27:06.680
building like Razor pages or Blazer app, you have to
519
00:27:06.680 --> 00:27:09.680
be logged in to hit that page. Now, you can
520
00:27:09.720 --> 00:27:11.880
still opt out, so you can add like an allow
521
00:27:11.920 --> 00:27:15.839
anonymous attribute on a controller, endpoint, or whatever the case is,
522
00:27:16.640 --> 00:27:20.720
and that will take precedence over the fallback policy. The
523
00:27:20.720 --> 00:27:22.960
fallback policy is basically like, hey, if you didn't add
524
00:27:22.960 --> 00:27:26.720
anything else, this is what security policy is going to run.
525
00:27:26.799 --> 00:27:29.240
So by default you're secure and you can always add
526
00:27:29.279 --> 00:27:31.279
more security saying hey, you have to be an admin
527
00:27:31.359 --> 00:27:33.440
to hit this endpoint or whatever the case.
528
00:27:33.240 --> 00:27:36.039
Is if you have no fallback policy, is it fallback
529
00:27:36.119 --> 00:27:37.759
then no security?
530
00:27:38.079 --> 00:27:38.480
Correct?
531
00:27:38.799 --> 00:27:39.960
Yes? Yi?
532
00:27:41.079 --> 00:27:45.319
So that's that's the default in ASPI core because it
533
00:27:45.319 --> 00:27:47.079
doesn't know what you want to do, and so this
534
00:27:47.160 --> 00:27:49.000
kind of flips that on its head. And it's really
535
00:27:49.039 --> 00:27:53.200
just like a one liner. When you're setting up authorization,
536
00:27:53.400 --> 00:27:55.880
you can just say, hey, set the fallback policy to
537
00:27:56.200 --> 00:27:57.839
require authenty kid, you use her right?
538
00:27:58.000 --> 00:28:00.400
Good? Yeah, that's a good fault.
539
00:28:00.559 --> 00:28:07.440
Yep, all right. Next one logging best practices. So, uh,
540
00:28:07.799 --> 00:28:12.119
just see a lot of people who uh spray logs
541
00:28:12.119 --> 00:28:15.000
and don't really know what what it is that they're doing,
542
00:28:15.079 --> 00:28:17.920
or you know, they go to the hitting exception and
543
00:28:18.000 --> 00:28:20.920
suddenly they don't have all the information that they need.
544
00:28:21.599 --> 00:28:23.720
And I'm not going to get into like open telemetry
545
00:28:23.759 --> 00:28:25.680
and things like that because it's like its own show
546
00:28:25.920 --> 00:28:31.000
and whatnot. More so, just I use a package called saraalog.
547
00:28:31.319 --> 00:28:32.240
It's really popular.
548
00:28:32.400 --> 00:28:33.880
Great the donet I.
549
00:28:33.920 --> 00:28:37.880
Use it too, ye, And you'll serialize your objects and
550
00:28:37.880 --> 00:28:40.400
put them in the log messages.
551
00:28:40.079 --> 00:28:43.119
Yep, yep for sure. And yeah, so I'll do like
552
00:28:43.119 --> 00:28:46.559
the structured logging you're talking about, and so you can
553
00:28:46.599 --> 00:28:49.440
like query off those things. So like basically you can
554
00:28:49.480 --> 00:28:52.680
write essentially SQL like queries saying like, hey, grab me
555
00:28:52.720 --> 00:28:54.799
all the logs from this user, and you don't have
556
00:28:54.880 --> 00:28:56.759
to like search through strings and things like that.
557
00:28:56.960 --> 00:28:58.960
Yeah. Right, it's really good game changer.
558
00:28:59.119 --> 00:29:01.119
Yep, and sarah loogs got a good feature in pretty
559
00:29:01.160 --> 00:29:03.680
much every logging framework out there has this feature too,
560
00:29:04.119 --> 00:29:08.680
of you can add certain properties to every single log.
561
00:29:08.880 --> 00:29:11.960
So for instance, you might want the user.
562
00:29:11.720 --> 00:29:15.440
ID yep, yeah, you want the user yes.
563
00:29:15.559 --> 00:29:18.000
Or like whatever point are they trying to hit? Or
564
00:29:18.359 --> 00:29:20.880
you know what version of the app is deployed. Is
565
00:29:20.920 --> 00:29:23.200
also another thing that's useful because let's say you fix
566
00:29:23.240 --> 00:29:25.640
something and ship it out. You can say like, okay,
567
00:29:25.720 --> 00:29:29.319
do I have any exceptions from this latest version I
568
00:29:29.400 --> 00:29:30.079
just deployed out?
569
00:29:30.319 --> 00:29:34.680
And so I typically use a class that I write
570
00:29:34.720 --> 00:29:38.680
around zero log that had that takes a dictionary of
571
00:29:38.720 --> 00:29:42.759
strings as parameters, so a string string dictionary.
572
00:29:42.880 --> 00:29:45.119
Right. So right there in.
573
00:29:45.119 --> 00:29:49.200
The you know, in the catch, you add the parameters
574
00:29:49.240 --> 00:29:52.200
that you want to put in there, which might include
575
00:29:52.400 --> 00:29:54.000
the objects or you know.
576
00:29:53.960 --> 00:29:56.039
The things that you were for. First of all, the
577
00:29:56.079 --> 00:29:56.759
thing that you were.
578
00:29:56.599 --> 00:30:00.160
Calling is in there, but you know, all the detai
579
00:30:00.359 --> 00:30:06.799
that one would need to make intent intentional queries yep, yeah.
580
00:30:06.519 --> 00:30:09.519
And Sarah loog so yeah, Sarah logs, yeah, log context
581
00:30:09.559 --> 00:30:12.720
you can slap uh slap those things together too, so
582
00:30:13.440 --> 00:30:16.440
on every log statement you don't. You kind of just
583
00:30:16.440 --> 00:30:21.559
get those things for free, which is pretty nice. So
584
00:30:21.559 --> 00:30:23.920
so yeah, that's some logging best practices. But I kind
585
00:30:23.920 --> 00:30:27.799
of want to transition into like this concept of logs.
586
00:30:28.440 --> 00:30:32.720
Sometimes I hear like, let's say we're doing some refinement
587
00:30:32.880 --> 00:30:35.079
or something and talking like, oh, yeah, we should log
588
00:30:35.400 --> 00:30:39.960
that piece of information, And I think there's a subtle
589
00:30:39.960 --> 00:30:44.319
difference between like logging versus metrics versus audits. And again
590
00:30:44.359 --> 00:30:46.319
I'm not going to get into open telemetry stuff, but
591
00:30:47.480 --> 00:30:53.000
technically sarah log does not guarantee delivery, meaning a lot
592
00:30:53.000 --> 00:30:55.359
of that a lot of times depending on what they
593
00:30:55.359 --> 00:30:58.839
call sinks, which is kind of like your end destination,
594
00:30:58.960 --> 00:31:01.680
like are you sending this to measure or where wherever
595
00:31:01.720 --> 00:31:05.960
you're sending it to. They don't guarantee delivery, so like
596
00:31:06.039 --> 00:31:08.960
they might depending on your settings, they might buffer those
597
00:31:09.000 --> 00:31:11.359
messages and memory. So what happens if the app suddenly
598
00:31:11.400 --> 00:31:14.079
crashes when all that stuff was in memory? Now all
599
00:31:14.119 --> 00:31:16.559
of those logs are gone. Yeah, and did not actually
600
00:31:16.599 --> 00:31:19.799
get flushed out, and so there's no guarantee of delivery,
601
00:31:19.839 --> 00:31:23.039
which is fine if you're using logs as they're meant
602
00:31:23.039 --> 00:31:25.480
to be used, which is like more of a developer tool,
603
00:31:25.640 --> 00:31:28.319
But if you're using it for like a replacement for
604
00:31:28.400 --> 00:31:31.880
like an audit tracking or audit logs, that's the problem.
605
00:31:32.200 --> 00:31:35.480
And right, so it's almost it a log everything except
606
00:31:35.559 --> 00:31:38.240
you accept the stuff you needed to understand what happened. Yeah.
607
00:31:38.319 --> 00:31:40.559
So with the logging system, though, can't you set up
608
00:31:40.640 --> 00:31:43.200
multiple sinks? Like you could have it right locally to
609
00:31:43.279 --> 00:31:47.680
a file so so it's there, and then on top
610
00:31:47.720 --> 00:31:50.200
of that you would have you know, some process to
611
00:31:50.200 --> 00:31:52.839
get it to another place that might you know, need
612
00:31:52.880 --> 00:31:55.240
to use poly or something. Yep, make sure it goes.
613
00:31:55.440 --> 00:31:58.039
Yeah, I just see some people like let's say you
614
00:31:58.039 --> 00:32:00.640
have a user management system and you want to log hey,
615
00:32:00.680 --> 00:32:04.559
who added who adds a user, changed the role or
616
00:32:04.599 --> 00:32:07.599
whatever the case is. Technically Sarah Loog's not going to
617
00:32:07.680 --> 00:32:10.039
guarantee that you get it to the place you set
618
00:32:10.079 --> 00:32:11.799
it too, so like instead you should just use it
619
00:32:11.839 --> 00:32:14.000
a good old fashioned audit table or something like that
620
00:32:14.000 --> 00:32:20.279
that has more guarantees around those things. And I've been
621
00:32:20.319 --> 00:32:23.680
in the healthcare industry at various points, and like they
622
00:32:23.680 --> 00:32:25.599
have some laws around like HIPPA that you have to
623
00:32:25.680 --> 00:32:29.599
keep data around for sure seven years, and so it's
624
00:32:29.920 --> 00:32:32.960
really not good if you don't keep that data around
625
00:32:33.000 --> 00:32:36.720
for seven years. And that's another problem with logging if
626
00:32:36.759 --> 00:32:41.559
you use audits as logs is your logging system might
627
00:32:41.599 --> 00:32:43.680
only keep things around for like thirty days or a
628
00:32:43.759 --> 00:32:46.079
year or something like that. So that's like another thing.
629
00:32:46.119 --> 00:32:48.759
You got to kind of consider the data store that
630
00:32:48.839 --> 00:32:49.599
you're using there.
631
00:32:49.680 --> 00:32:52.240
Yeah, it's usually a circular store and it has it's
632
00:32:52.240 --> 00:32:55.240
limited by space or time whatever that may be. Is
633
00:32:55.279 --> 00:32:57.359
also where you should call your friendly system men, who
634
00:32:57.400 --> 00:33:00.000
is also responsible for how long that stuff should be stored.
635
00:33:00.119 --> 00:33:01.720
So even if you are in a thirty day rotation,
636
00:33:02.519 --> 00:33:04.759
we take a snap of it periodically so that we
637
00:33:04.839 --> 00:33:08.559
have another copy somewhere. Like, yep, they have conversations. You're
638
00:33:08.559 --> 00:33:10.359
not the only one of this problem. Yep.
639
00:33:10.519 --> 00:33:12.480
This seems like a good place to take a break
640
00:33:12.799 --> 00:33:15.599
and we'll be right back after these very important messages
641
00:33:15.599 --> 00:33:20.920
don't go away. Hey Carl here, you probably know text
642
00:33:20.920 --> 00:33:25.160
control is a powerful library for document editing and PDF generation,
643
00:33:25.880 --> 00:33:28.240
But did you know they're also a strong supporter of
644
00:33:28.279 --> 00:33:31.559
the developer community. It's part of their mission to build
645
00:33:31.599 --> 00:33:35.680
and support a strong developer community by being present, listening
646
00:33:35.720 --> 00:33:39.519
to users, and sharing knowledge at conferences across Europe and
647
00:33:39.559 --> 00:33:43.079
the United States. So if you're heading to a conference soon,
648
00:33:43.680 --> 00:33:46.440
check if text Control will be there and stop buy
649
00:33:46.519 --> 00:33:49.799
to say hi. You can find their full conference calendar
650
00:33:50.200 --> 00:33:54.279
at dubdubdub dot textcontrol dot com and make sure you
651
00:33:54.319 --> 00:33:57.160
thank them for supporting dot NetRocks.
652
00:34:00.200 --> 00:34:01.799
And we're back. It's dot net Rocks.
653
00:34:02.039 --> 00:34:05.119
I'm Carl Franklin, that's Richard Campbell eight and we're talking
654
00:34:05.119 --> 00:34:07.920
to Scott Sober with his ten things that he does
655
00:34:07.960 --> 00:34:09.679
in every dot net project.
656
00:34:10.119 --> 00:34:12.360
Yeah, stealing something from David Letterman.
657
00:34:12.400 --> 00:34:14.679
I guess, and I think we're on four or five?
658
00:34:14.719 --> 00:34:15.920
Are we on five?
659
00:34:16.000 --> 00:34:17.440
Or six? Where are we?
660
00:34:17.440 --> 00:34:20.440
We've gone through five? Now we are non number six?
661
00:34:20.960 --> 00:34:25.039
So how about that six to one? Is we? I
662
00:34:25.159 --> 00:34:28.400
like to do validation with a library called Fluent Validation,
663
00:34:28.920 --> 00:34:33.119
so out of the box, uh you it's kind of
664
00:34:33.679 --> 00:34:37.159
I don't know, encouraged to use something called data annotations,
665
00:34:37.159 --> 00:34:40.880
which are just like little attributes saying hey, this field's required,
666
00:34:40.920 --> 00:34:44.320
and things like that when you're let's say you're taking
667
00:34:44.360 --> 00:34:46.519
in a form and you're someone signing up and you
668
00:34:46.519 --> 00:34:49.039
know their first name, last name, email, all that kind
669
00:34:49.039 --> 00:34:52.440
of stuff is required. Like data notations work well for
670
00:34:52.519 --> 00:34:56.119
those scenarios, but I find making custom ones when you
671
00:34:56.159 --> 00:35:00.280
have more advanced scenarios is a little awkward to make.
672
00:35:00.760 --> 00:35:04.079
Like let's say you're taking their birth date and you
673
00:35:04.119 --> 00:35:06.760
know they have to be above a certain age to
674
00:35:06.960 --> 00:35:10.639
sign up for the website. That's not out of the
675
00:35:10.639 --> 00:35:12.559
box and something customer you'd have to make, and that
676
00:35:12.559 --> 00:35:16.039
gets a little awkward. With data annotations, Yes, they're also
677
00:35:16.079 --> 00:35:20.159
hard to unit test. If you want to get really particular,
678
00:35:20.480 --> 00:35:24.000
you could argue the single responsibility principles violated because like
679
00:35:24.400 --> 00:35:27.599
you're kind of mixing your model business rules that you
680
00:35:27.679 --> 00:35:31.920
have with your validation. Yep. So instead, I like using
681
00:35:31.920 --> 00:35:35.079
fluent validation, which allows you to kind of separate your
682
00:35:35.079 --> 00:35:38.079
model from your validation, and it basically gives you this
683
00:35:38.159 --> 00:35:41.039
fluent like syntax, so you can say, like, hey, first
684
00:35:41.119 --> 00:35:44.280
name should not be empty, and you can write customer
685
00:35:44.360 --> 00:35:47.480
rules super easily. They read super nice, And I've even
686
00:35:47.559 --> 00:35:51.239
given the rules like literally screenshotted the c sharp and
687
00:35:51.239 --> 00:35:53.760
send it to a business person said hey, are these
688
00:35:53.840 --> 00:35:56.000
rules right, and they're like, yep, that's good.
689
00:35:56.039 --> 00:35:58.559
It all makes sense and they can read them. Yeah, yes,
690
00:35:59.440 --> 00:36:01.480
it makes sense to them, versus that's.
691
00:36:01.280 --> 00:36:04.920
Important showing them like, you know, attributes and things like that,
692
00:36:05.000 --> 00:36:09.119
and it's like, good luck with that. And so Flume
693
00:36:09.199 --> 00:36:11.880
validation also has a test helper built in too, so
694
00:36:11.920 --> 00:36:14.519
you can write automated tests around it super easily. So
695
00:36:15.360 --> 00:36:17.679
I really like Fluent validation for this.
696
00:36:17.719 --> 00:36:19.840
Was a better no framework a couple of years ago,
697
00:36:20.119 --> 00:36:21.880
and yeah I love it.
698
00:36:22.039 --> 00:36:25.719
Yep, yeah, cool, just a better way think about the problem. Yeah, sure, awesome.
699
00:36:25.800 --> 00:36:29.840
All right, Numero seven, we're going to talk about just
700
00:36:29.920 --> 00:36:33.679
generic coding guidelines. So you can probably make the argument
701
00:36:33.719 --> 00:36:36.960
there's like twenty five plus tips in here, but total,
702
00:36:37.159 --> 00:36:39.440
but I'm going to kind of bucket all these into
703
00:36:39.519 --> 00:36:43.880
generic coding guidelines. So, okay, I try and structure my
704
00:36:44.039 --> 00:36:47.800
methods where I put the happy path at the bottom
705
00:36:47.920 --> 00:36:50.719
of a method. And part of the reason for that
706
00:36:51.000 --> 00:36:54.000
is I don't like having to scan like a new
707
00:36:54.039 --> 00:36:56.360
code base, like what what does this method even do?
708
00:36:56.960 --> 00:36:57.079
Right?
709
00:36:57.280 --> 00:36:59.320
And let's say it's one hundred lines long and somewhere
710
00:36:59.320 --> 00:37:02.480
at lines sixty to seventy is the happy path of
711
00:37:02.480 --> 00:37:05.480
what went well? Like everything went right right? This is
712
00:37:05.719 --> 00:37:06.880
this is what this method does.
713
00:37:07.039 --> 00:37:10.840
Don't nest your success states, yes, and then get into
714
00:37:11.000 --> 00:37:15.159
something that's tabbed in you know, eight tabs or something exactly.
715
00:37:15.199 --> 00:37:18.679
You do your centuries, you return if you need to return,
716
00:37:18.719 --> 00:37:20.800
and at the bottom happy path yep.
717
00:37:20.880 --> 00:37:23.679
Yeah, don't test if it have nested if ELS's do
718
00:37:23.840 --> 00:37:27.280
early returns like you said, so you know, if let's
719
00:37:27.280 --> 00:37:29.480
say I've got an endpoint. If I'm if the request
720
00:37:29.519 --> 00:37:31.320
isn't valid, I'm going to bomb out and return a
721
00:37:31.360 --> 00:37:33.679
four hundred. If I'm not authorized, I'm a bomb out,
722
00:37:33.679 --> 00:37:36.960
returning forbidden, whatever the case is, and then kind of
723
00:37:37.000 --> 00:37:37.960
get to my happy path.
724
00:37:38.199 --> 00:37:41.920
It's just just a legibility thing that it's easier to
725
00:37:42.000 --> 00:37:44.280
see the correct path out if you put it at
726
00:37:44.320 --> 00:37:44.639
the end.
727
00:37:44.920 --> 00:37:48.719
Yes, and it forces you into that early return pattern
728
00:37:48.760 --> 00:37:51.519
that Carl was talking about, where you kind of bomb
729
00:37:51.519 --> 00:37:54.920
out if things aren't aren't good, versus that nested success
730
00:37:54.960 --> 00:37:57.800
case like oh I am valid, oh I am authorized? Okay,
731
00:37:57.840 --> 00:37:58.679
now let's do the thing.
732
00:37:58.760 --> 00:38:01.360
Well what about this? What about that? Yeah, fail early
733
00:38:01.400 --> 00:38:03.280
and often and only succeed at the.
734
00:38:03.280 --> 00:38:06.679
End and the kind of way I think about this
735
00:38:06.960 --> 00:38:12.239
too is a principle called the indentation proclamation. Now, if
736
00:38:12.239 --> 00:38:14.239
you google that, that doesn't exist. I made it up
737
00:38:14.960 --> 00:38:17.159
just to honest indentation proclamation.
738
00:38:17.679 --> 00:38:18.000
Nice.
739
00:38:18.119 --> 00:38:20.920
But the idea is the more indented your code is
740
00:38:21.159 --> 00:38:23.239
usually the harder it is to read. If you have
741
00:38:23.360 --> 00:38:27.719
nested if statements, if you have nested loops, all those
742
00:38:27.800 --> 00:38:29.920
kinds of things. So I try and avoid.
743
00:38:29.800 --> 00:38:33.079
Psychlomatic complexity yep. Not good, yep.
744
00:38:33.119 --> 00:38:35.880
And then I just have some like generic warning lights
745
00:38:36.039 --> 00:38:37.920
and not hard and fast rules. Now I'm about to
746
00:38:37.960 --> 00:38:42.039
offend somebody if I haven't already is and these are
747
00:38:42.519 --> 00:38:45.280
not like hard stops. Just like when I get over
748
00:38:45.360 --> 00:38:47.360
this number, I start to think, hmm, is there a
749
00:38:47.360 --> 00:38:49.639
better way to do this? Should I break this out?
750
00:38:50.880 --> 00:38:54.320
So classes that get, you know, a few hundred lines long,
751
00:38:54.480 --> 00:38:56.719
I start to think, like, hm, could I start breaking
752
00:38:56.719 --> 00:38:59.599
this out methods? Over twenty lines? I start thinking, hey,
753
00:38:59.599 --> 00:39:02.880
can I break this out? If people are using regions?
754
00:39:03.039 --> 00:39:05.559
I am not a regions fan, and I feel like
755
00:39:05.719 --> 00:39:09.679
when somebody uses a region, I feel like Clippy should
756
00:39:09.679 --> 00:39:12.760
pop up in their ID and say, hey, you're trying
757
00:39:12.800 --> 00:39:14.400
to use a region? Did you mean to add a
758
00:39:14.440 --> 00:39:17.800
new class or method instead, because we already have these
759
00:39:17.840 --> 00:39:22.800
code organization tools called classes and methods, and a lot
760
00:39:22.840 --> 00:39:25.480
of times I see people use regions when they really
761
00:39:25.519 --> 00:39:27.320
should have reached for a new class or method.
762
00:39:27.079 --> 00:39:29.760
And covering up code. Yeah, so fair.
763
00:39:29.800 --> 00:39:31.320
I know there's some region fans out there, so I
764
00:39:31.320 --> 00:39:34.280
know I offended somebody out there with with that. So
765
00:39:34.280 --> 00:39:40.880
sorry in advance opinions defense, yep. And it's also getting
766
00:39:40.880 --> 00:39:43.639
into the point. I mean we're kind of talking AI.
767
00:39:43.920 --> 00:39:48.679
We briefly talked about AI earlier, but I mean, some
768
00:39:48.719 --> 00:39:52.920
of these things are kind of interesting as we started
769
00:39:52.960 --> 00:39:57.400
to get into a world of how much does code
770
00:39:57.519 --> 00:40:00.639
quality matter? And I'm still in only in the camp
771
00:40:00.679 --> 00:40:04.199
of it does, but as agents are writing more and
772
00:40:04.280 --> 00:40:06.960
more of our code, I think it's.
773
00:40:06.880 --> 00:40:09.360
An interesting including more and more of our test Yes.
774
00:40:09.599 --> 00:40:13.440
I think it's a kind of an interesting question. I
775
00:40:13.480 --> 00:40:16.519
know Uncle Bob who wrote the Clean Code Book, who
776
00:40:18.079 --> 00:40:21.480
he tweeted out saying that he's actually not looking at
777
00:40:21.519 --> 00:40:24.719
the code that he's generating anymore, which I thought was interesting.
778
00:40:24.760 --> 00:40:28.599
But he is writing like he has code coverage enforcement
779
00:40:28.639 --> 00:40:33.599
he enforces like cyclomatic complexity constraints and those kinds of things,
780
00:40:33.599 --> 00:40:36.320
so he has a lot of automation around those things
781
00:40:37.199 --> 00:40:40.000
to enforce code quality. So he says, if passes all
782
00:40:40.039 --> 00:40:41.960
those things, then I'm not actually looking at what the
783
00:40:42.000 --> 00:40:46.440
agent generates. I'm not quite there yet, but I understand
784
00:40:46.480 --> 00:40:48.519
how some people are starting to get there.
785
00:40:48.920 --> 00:40:50.679
I've had a few folks say I never got to
786
00:40:50.679 --> 00:40:52.840
one hundred percent code coverage until I had automation to
787
00:40:52.880 --> 00:40:56.760
generate tests. Yep, humans won't create one hundred percent code coverage,
788
00:40:56.760 --> 00:40:58.400
but you can torment in the LLM to do it.
789
00:40:58.840 --> 00:41:03.119
Oh, yeah, for sure. And honestly that those like writing
790
00:41:03.159 --> 00:41:05.440
the test is a good way to keep AI on
791
00:41:05.639 --> 00:41:10.519
track because I've had lots of times where uh, you know,
792
00:41:10.639 --> 00:41:13.800
it makes a change and it unintentionally broke something, but
793
00:41:13.880 --> 00:41:15.559
like it just auto fixes it and I don't have
794
00:41:15.559 --> 00:41:17.480
to tell it to fix it. It just detected. Hey, reran
795
00:41:17.559 --> 00:41:21.039
the test and this is broken. So yeah, we'll get
796
00:41:21.119 --> 00:41:22.719
into tests on a little bit where I'll talk about
797
00:41:22.719 --> 00:41:27.280
that too. Okay, cool, So that's number seven. Let's move
798
00:41:27.280 --> 00:41:32.800
on to number eight. Modern solution files. So solution files
799
00:41:32.840 --> 00:41:35.679
and dot net. If you've ever cracked one of those suckers,
800
00:41:35.719 --> 00:41:38.960
open it looks a little I don't even know what
801
00:41:39.000 --> 00:41:41.920
the format is. It's like a tabbed format and things
802
00:41:41.960 --> 00:41:45.000
like that. So back in the dot nine time frame
803
00:41:45.079 --> 00:41:50.199
they actually released a modern solution style format. The format
804
00:41:50.519 --> 00:41:57.639
is modern, which means it's XML, right, so modern, yes,
805
00:41:58.880 --> 00:42:01.400
but I actually like it. So basically it takes your
806
00:42:01.440 --> 00:42:04.480
like twenty lines of like GUIDs and things like that
807
00:42:04.480 --> 00:42:07.639
that you didn't necessarily read, and it turns it into
808
00:42:07.679 --> 00:42:10.920
like three lines just saying hey, I'm referencing this project
809
00:42:10.920 --> 00:42:13.440
in the solution, so cleans it up a little bit
810
00:42:13.639 --> 00:42:15.559
as well as it prevents some merged conflict.
811
00:42:15.679 --> 00:42:17.320
And you're talking about sl.
812
00:42:17.119 --> 00:42:20.400
N X right, yes, yep, the sl nx format, So yeah,
813
00:42:20.440 --> 00:42:24.159
it'll change your file format s l n x. And
814
00:42:24.280 --> 00:42:26.320
if you want to migrate from an sl N file
815
00:42:26.360 --> 00:42:29.239
to sl n x, it's just a dot Net SLN
816
00:42:29.519 --> 00:42:32.320
migrate at the command line and boom you're migrated over.
817
00:42:32.639 --> 00:42:35.280
Nice. Yeah, I remember that. I'll go find the old
818
00:42:35.280 --> 00:42:38.559
blog post about that. It's a good format.
819
00:42:38.760 --> 00:42:42.039
Yep. So we got modern cs prog files a few
820
00:42:42.079 --> 00:42:44.360
years back with dot dot net Core, and now we've
821
00:42:44.360 --> 00:42:45.599
got modern solution files.
822
00:42:45.599 --> 00:42:49.199
So that's cool. Yeah, nice, Yeah, do love the idea
823
00:42:49.199 --> 00:42:50.880
of associating modern and XML.
824
00:42:51.000 --> 00:42:57.800
That's all right. So ninth one is kind of an
825
00:42:57.840 --> 00:43:02.559
obscure feature called validate on build and what this means
826
00:43:02.599 --> 00:43:05.480
and it's not build as in compiling of your app.
827
00:43:05.559 --> 00:43:10.400
It's build as in building of the dependency injection container
828
00:43:10.480 --> 00:43:12.960
and asp dow it core. So basically make sure that
829
00:43:14.320 --> 00:43:19.519
the lifetime of your things that you register match what
830
00:43:19.559 --> 00:43:22.559
they should be. So what I mean by that is
831
00:43:22.599 --> 00:43:27.280
a singleton can only depend on singletons, otherwise it's not
832
00:43:27.360 --> 00:43:31.280
a singleton. So let's say you've got a singleton that
833
00:43:31.360 --> 00:43:34.599
takes in a dB context, which is a scope to dependency.
834
00:43:35.239 --> 00:43:38.159
Now you have this problem where that scope dependency is
835
00:43:38.239 --> 00:43:40.800
trapped in that singleton, and it's what's known as the
836
00:43:40.840 --> 00:43:44.880
captive dependency problem, which it might not be a huge
837
00:43:44.960 --> 00:43:48.320
deal depending on what your dependency is doing, but like
838
00:43:48.360 --> 00:43:50.519
in a dB context case, it might leave a connection
839
00:43:50.599 --> 00:43:55.079
open or leave a leak something, depending on what code
840
00:43:55.079 --> 00:43:58.880
that you're doing. So this validate on build setting basically
841
00:43:58.960 --> 00:44:02.719
forces ap on corea check to make sure that you
842
00:44:02.719 --> 00:44:08.000
don't get into that situation. And this will happen by
843
00:44:08.039 --> 00:44:11.519
default if your local environment is called development, so you
844
00:44:11.599 --> 00:44:14.360
might see this. It basically throws an error, won't even
845
00:44:14.400 --> 00:44:18.679
boot your application. But if you don't have your environment
846
00:44:18.719 --> 00:44:20.639
set to development, like let's say you change it to
847
00:44:20.719 --> 00:44:24.599
dev or local for whatever reason, this won't run. So
848
00:44:24.760 --> 00:44:28.760
there's a flag off of Vieus service provider that you
849
00:44:28.840 --> 00:44:31.880
just say validate on build true, and now it will
850
00:44:31.920 --> 00:44:32.719
always validate.
851
00:44:33.159 --> 00:44:37.079
So interesting. Yeah, that's good, and so it'll when you
852
00:44:37.280 --> 00:44:39.599
have to build, now just generate an error correct yep.
853
00:44:39.679 --> 00:44:42.639
So when you go to run your application, it will
854
00:44:42.880 --> 00:44:45.719
just basically not even boot the application because it's you're
855
00:44:45.760 --> 00:44:50.159
in an invalid state. So sometimes this can cause little
856
00:44:51.559 --> 00:44:55.039
small ears and production that you can't really explain, like
857
00:44:55.039 --> 00:44:57.000
the connection lead problem or something like that.
858
00:44:57.079 --> 00:44:59.119
So yeah, but you got to Yeah, you go from
859
00:44:59.199 --> 00:45:03.440
random random error sometimes the hard ones to hunt down
860
00:45:03.519 --> 00:45:06.119
to No, I will not build for you because you
861
00:45:06.199 --> 00:45:08.280
have done this thing, yep, and you've got to go.
862
00:45:08.360 --> 00:45:11.320
You've got to do a refactor here, architect differently. Don't
863
00:45:11.440 --> 00:45:15.400
invoke inside that singleton like you're going to create trouble. Yep.
864
00:45:15.480 --> 00:45:16.880
That's right. I appreciate that.
865
00:45:17.000 --> 00:45:17.360
All right.
866
00:45:17.960 --> 00:45:19.960
They seem like good defaults, like they should have been
867
00:45:19.960 --> 00:45:21.800
on in the first flip in place, right.
868
00:45:21.679 --> 00:45:23.599
I know, I think. I think part of the problem
869
00:45:23.679 --> 00:45:27.039
is like the validate on build setting didn't get added
870
00:45:27.159 --> 00:45:29.119
until later in a sped on it core, And I
871
00:45:29.159 --> 00:45:32.199
think they didn't want to break people even though yeah,
872
00:45:32.280 --> 00:45:33.679
they're kind of you know.
873
00:45:33.599 --> 00:45:35.000
They're running in traffic.
874
00:45:34.679 --> 00:45:38.199
Potentially broken in production. Yeah, yeah, not realize it.
875
00:45:38.360 --> 00:45:40.719
So yeah, I know, he's exactly that. Like you've been
876
00:45:40.760 --> 00:45:43.119
running a piece of software that randomly crashes and you've
877
00:45:43.119 --> 00:45:44.960
probably even covered up the crash, right, You've got to
878
00:45:44.960 --> 00:45:47.800
reboot mechanism, things like that, and just not realizing, no,
879
00:45:47.920 --> 00:45:50.480
you have an architectural problem that Valuide don't build would
880
00:45:50.480 --> 00:45:53.519
have told you. Yep, yeah, all right, good stuff. But yeah,
881
00:45:53.519 --> 00:45:55.960
I appreciate that Microsoft doesn't want to break code.
882
00:45:55.800 --> 00:45:58.119
Yeah for sure, and we've all benefited from that mindset.
883
00:45:58.159 --> 00:46:02.039
It's just sometimes the trade off happens where right now
884
00:46:02.079 --> 00:46:04.400
they don't change a default that they should have changed.
885
00:46:04.360 --> 00:46:07.519
A long time ago. Yeah, I mean it also if
886
00:46:07.519 --> 00:46:09.400
they do turn it on by default, then it creates
887
00:46:09.400 --> 00:46:11.639
a bunch of tex support costs for them they don't
888
00:46:11.679 --> 00:46:14.239
want to incur, as well as anger. It's the right choice.
889
00:46:14.280 --> 00:46:17.119
Don't move up to this version of dot net because
890
00:46:17.280 --> 00:46:19.599
my app now crashes. It's bad, right.
891
00:46:19.800 --> 00:46:23.000
I think backward compatibility is their number one, I think,
892
00:46:23.039 --> 00:46:25.159
and I think that's good. Yeah, so you have to
893
00:46:25.159 --> 00:46:27.840
do a couple of things to get you know, working
894
00:46:27.880 --> 00:46:30.280
better or you're working better. It's always a wrestling match
895
00:46:30.320 --> 00:46:32.440
on this one, right, yeah, one percent. I hope it's
896
00:46:32.440 --> 00:46:34.920
spitting all kinds of warnings out, at least that they'll
897
00:46:35.159 --> 00:46:38.320
happily ignore along with the other five hundred warnings, unless
898
00:46:38.360 --> 00:46:41.960
you have warnings as errors errors, in which case, if
899
00:46:41.960 --> 00:46:45.079
you go through the list, it all works all right.
900
00:46:45.239 --> 00:46:46.559
Sorry, Scott, let's keep going.
901
00:46:46.639 --> 00:46:49.440
You're good. So number ten, although I think I'm gonna
902
00:46:49.440 --> 00:46:54.719
sneak in eleventh here, but uh, Number ten is a
903
00:46:54.760 --> 00:46:57.920
feature called central package management. So this has been in
904
00:46:58.000 --> 00:47:01.880
dot net since dot net six. But I when I
905
00:47:01.920 --> 00:47:04.360
gave this talk at a conference, I asked how many
906
00:47:04.400 --> 00:47:06.400
people are using this? And probably ten percent of the
907
00:47:06.440 --> 00:47:08.320
room raise their hands. So even though this has been
908
00:47:08.360 --> 00:47:11.199
out for a number of years, people still aren't using it.
909
00:47:11.400 --> 00:47:15.000
It's like four years now that central packages around yep.
910
00:47:15.119 --> 00:47:17.360
So the kind of the problem it solves is you
911
00:47:17.440 --> 00:47:21.880
might have multiple projects in your solution that reference the
912
00:47:21.880 --> 00:47:24.719
same package. Like let's say you've got multiple test projects
913
00:47:24.760 --> 00:47:27.000
and you're using x unit or n unit or whatever
914
00:47:27.039 --> 00:47:30.039
the case is. Well, now when you want to upgrade that,
915
00:47:30.239 --> 00:47:34.320
you got to kind of touch multiple CS projects to
916
00:47:34.519 --> 00:47:36.599
kind of upgrade them all to the same version. Or
917
00:47:36.639 --> 00:47:39.679
maybe you have anyy framework in multiple pack projects or
918
00:47:39.719 --> 00:47:42.719
whatever the case is. So the ADA behind central package
919
00:47:42.719 --> 00:47:45.679
management is to centralize that so you have one spot
920
00:47:45.719 --> 00:47:49.679
to upgrade your package is not multiple. So you put
921
00:47:49.719 --> 00:47:53.039
a directory dot packages dot props file at the root
922
00:47:53.039 --> 00:47:54.920
of your project and you kind of define saying, hey,
923
00:47:54.920 --> 00:47:57.639
I want x unit, I want anity framework, here's the
924
00:47:57.719 --> 00:48:00.519
version I want. And then in your cs prode you
925
00:48:00.559 --> 00:48:04.119
just say, hey, the cs proge references Entity framework and
926
00:48:04.159 --> 00:48:06.960
you don't have a version in your cs proge. And
927
00:48:07.480 --> 00:48:10.760
because that's now managed centrally, right, so now you can
928
00:48:10.880 --> 00:48:14.119
keep everything in sync. You don't have to worry about like, oh,
929
00:48:14.159 --> 00:48:17.519
I'm upgrading dot net ten, I need to go upgrade
930
00:48:17.559 --> 00:48:20.480
all my packages the ten dot x in all my
931
00:48:20.840 --> 00:48:24.320
different projects. I can just do that centrally in the
932
00:48:24.440 --> 00:48:28.840
directory packages prop style. And this works in Visual Studio Writer,
933
00:48:29.079 --> 00:48:32.880
so there's integrations there too. So any ID you're using
934
00:48:32.920 --> 00:48:36.119
most likely has integrations with it at this point, so yeah,
935
00:48:36.280 --> 00:48:36.840
super easy.
936
00:48:37.000 --> 00:48:39.880
Yeah, another thing you should just be on. Hey, you
937
00:48:39.920 --> 00:48:43.119
were talking about more about testing, like, we obviously are
938
00:48:43.280 --> 00:48:45.639
keen to use tools, but what do you what's your
939
00:48:45.639 --> 00:48:46.559
approach to testing?
940
00:48:47.000 --> 00:48:48.280
That was gonna be my last thing I was going
941
00:48:48.320 --> 00:48:50.400
to talk about was of.
942
00:48:50.400 --> 00:48:53.800
Course I'm stealing your thunder brother, I, So I apologize.
943
00:48:56.519 --> 00:48:59.320
So I guess first off, I'll say, like automated tests,
944
00:48:59.360 --> 00:49:01.039
you should be doing it at this point.
945
00:49:01.159 --> 00:49:04.400
Yes, And the tooling is so good now right, Really
946
00:49:04.440 --> 00:49:06.159
we're running out of excuses yep.
947
00:49:06.400 --> 00:49:08.920
And I find most companies I work with now I
948
00:49:08.960 --> 00:49:12.000
don't have to convince them of this. But ten years
949
00:49:12.000 --> 00:49:14.639
ago that was a different story. Sure, because they've done
950
00:49:14.719 --> 00:49:19.400
like research, the Dora DevOps Research Assessment did a bunch
951
00:49:19.400 --> 00:49:21.239
of studies and basically one of the things that they
952
00:49:21.360 --> 00:49:24.639
proved was when they interviewed a bunch of software teams,
953
00:49:24.639 --> 00:49:27.679
like tens of thousands of software teams, that you move
954
00:49:27.719 --> 00:49:31.159
faster with tests, long term and with higher quality. So
955
00:49:32.480 --> 00:49:34.400
but I think it's even more important in this era
956
00:49:34.440 --> 00:49:37.119
of agentic coding. Like I mentioned, it keeps it on
957
00:49:37.159 --> 00:49:39.840
the rail, keeps a on the rails. I've been in
958
00:49:39.920 --> 00:49:43.480
projects that are have minimal tests versus ones that have
959
00:49:43.559 --> 00:49:46.039
a lot of tests, and AI does a way better
960
00:49:46.079 --> 00:49:49.559
job when they have those rails. So I personally use
961
00:49:49.679 --> 00:49:52.079
x unit for automated tests, but I don't get too
962
00:49:52.159 --> 00:49:53.840
caught up in it, Like the more important thing is
963
00:49:53.840 --> 00:49:56.000
you're writing tests, not that you're using x unit VERSU
964
00:49:56.039 --> 00:49:59.400
nd unit. Maybe not MS test. Don't do that one.
965
00:50:00.280 --> 00:50:02.679
Just kidding, Just have to take a shot at Microsoft.
966
00:50:02.719 --> 00:50:08.719
You're not kidding, come on, yeah, uh, but Microsoft themselves
967
00:50:08.760 --> 00:50:11.760
actually use x unit for dot net, the dot net
968
00:50:11.800 --> 00:50:14.079
repos and ASPN core repos. You can go see and
969
00:50:14.119 --> 00:50:17.400
they're using x unit. Little thing people don't know is
970
00:50:17.440 --> 00:50:20.159
there's x unit came out with a V three package
971
00:50:20.159 --> 00:50:23.320
about a year ago, and it's not just a version upgrade.
972
00:50:23.320 --> 00:50:25.719
It's actually called x unit dot v three. So if
973
00:50:25.760 --> 00:50:29.559
you want to get the new latest bits of x unit,
974
00:50:29.719 --> 00:50:32.159
you need to install that package. So I'm not going
975
00:50:32.159 --> 00:50:34.199
to get into the y. They didn't just bump the
976
00:50:34.280 --> 00:50:37.840
version instead create a new package. But a lot of
977
00:50:37.840 --> 00:50:41.199
people don't know that that it's a whole separate package.
978
00:50:41.199 --> 00:50:42.679
So I just want to call that out.
979
00:50:42.920 --> 00:50:45.760
Well, it was breaking changes, wasn't it. Fundamentally? That was
980
00:50:45.840 --> 00:50:46.400
the issue.
981
00:50:46.639 --> 00:50:49.239
Yep, it was breaking changes, and it was enough that
982
00:50:50.400 --> 00:50:53.320
the main primary maintainer thought it warranted a whole new
983
00:50:53.360 --> 00:50:57.400
package name, not just a higher version. So yeah, some
984
00:50:57.440 --> 00:51:00.119
people disagree, but right or wrong, that's what That's what
985
00:51:00.159 --> 00:51:00.800
the reality is.
986
00:51:01.039 --> 00:51:02.800
So yeah, but.
987
00:51:02.800 --> 00:51:07.480
As I'm creating tests, I start to sometimes what people
988
00:51:07.480 --> 00:51:08.880
do when they create tests is they have a lot
989
00:51:08.880 --> 00:51:12.400
of setup code, so like the arrange step step in
990
00:51:13.280 --> 00:51:15.639
arrange act assert And so I want to kind of
991
00:51:15.679 --> 00:51:21.840
call call back to this idea of Chekhov's gun, which is, uh,
992
00:51:22.199 --> 00:51:23.079
Chekhov was a.
993
00:51:23.079 --> 00:51:27.199
Russian playwright, sick, yeah, metamorphosis.
994
00:51:28.840 --> 00:51:31.920
He's a Russian playwright who basically said, if a gun
995
00:51:31.960 --> 00:51:34.039
is hanging on the wall in the first act, it
996
00:51:34.119 --> 00:51:37.440
should fire in a later act of the play. Otherwise
997
00:51:38.039 --> 00:51:42.440
it shouldn't be hanging there. So basically, removed should be mentioned. Yes,
998
00:51:42.840 --> 00:51:47.159
remove what's not relevant to the story. And now everybody's
999
00:51:47.159 --> 00:51:49.840
brains are racking all the shows that they've seen, where
1000
00:51:50.719 --> 00:51:52.679
like Game of Thrones that didn't actually have a lot
1001
00:51:52.719 --> 00:51:55.360
of relevance to the story later on, So yes they did.
1002
00:51:55.440 --> 00:51:59.400
Speaking of irrelevant, Metamorphosis was written by Kafka and not Chekhov. Sorry,
1003
00:51:59.440 --> 00:52:04.199
about that. You're good, I got my Russian authors mixed up.
1004
00:52:07.119 --> 00:52:09.840
And so we can actually apply that same logic of
1005
00:52:09.880 --> 00:52:13.320
remove what's not relevant to the story to our tests,
1006
00:52:13.360 --> 00:52:16.000
because lots of times I come into tests and there's
1007
00:52:16.039 --> 00:52:18.639
like five ten twenty fifty lines of code for the
1008
00:52:18.760 --> 00:52:21.920
range step, and then I go to the next next
1009
00:52:21.960 --> 00:52:24.639
test and there's five ten twenty fifty lines of the
1010
00:52:24.760 --> 00:52:27.280
range step, but there's like one slight difference and at
1011
00:52:27.320 --> 00:52:28.960
a glance I can't tell what the difference is.
1012
00:52:29.199 --> 00:52:32.800
Yeah, So instead covering so much code.
1013
00:52:32.599 --> 00:52:35.480
Yeah, and instead I want to like rip that out
1014
00:52:35.679 --> 00:52:38.360
and have the setup be more centralized in some way. Now,
1015
00:52:38.400 --> 00:52:40.320
there's lots of different ways to do this. You might
1016
00:52:40.400 --> 00:52:42.960
have a method do this, or an end unit you
1017
00:52:43.000 --> 00:52:45.679
can put it in a setup method, or an ex
1018
00:52:45.840 --> 00:52:48.760
unit you can put in constructor. But a lot of
1019
00:52:48.760 --> 00:52:51.920
times if I set up the happy path in whatever
1020
00:52:51.960 --> 00:52:56.320
setup construct that I have, then I'm just tweaking sad
1021
00:52:56.360 --> 00:52:58.960
paths in my test. And it's super obvious that, like, oh,
1022
00:52:59.000 --> 00:53:02.239
I'm setting first name to NOL and then I'm asserting that, hey,
1023
00:53:02.280 --> 00:53:04.639
I get an error message when first name is NOL,
1024
00:53:04.840 --> 00:53:07.679
And it's super easy to see versus you know, five
1025
00:53:07.760 --> 00:53:10.320
to twenty lines of setup that it's hard to pick out. Oh,
1026
00:53:10.400 --> 00:53:13.840
it's the null that's different. Right, So something to think
1027
00:53:13.840 --> 00:53:16.760
about when you're writing tests is, hey, what's actually relevant
1028
00:53:16.760 --> 00:53:19.320
to the story and what can I rip out and
1029
00:53:19.360 --> 00:53:21.239
make it a little bit easier at a glance? What's
1030
00:53:21.280 --> 00:53:24.840
different about this test versus a different test in this file.
1031
00:53:25.079 --> 00:53:30.360
So so that's just kind of a concept you can apply.
1032
00:53:30.840 --> 00:53:33.639
Is that Chekhov's gun concept of remove what's not relevant
1033
00:53:33.679 --> 00:53:35.559
to the story when it applies comes to your test.
1034
00:53:35.639 --> 00:53:38.519
Good stuff, And if you're using AI to write your tests,
1035
00:53:38.559 --> 00:53:40.800
then make sure you put that in the system prompt yep,
1036
00:53:40.920 --> 00:53:41.280
for sure.
1037
00:53:41.679 --> 00:53:45.239
Yeah, AI's applied Chekhov's gun. Yeah.
1038
00:53:45.599 --> 00:53:48.000
AI is really good at following pattern So if you
1039
00:53:48.079 --> 00:53:51.079
don't do that from the get go, it will start
1040
00:53:51.079 --> 00:53:53.280
to just proliferate that through your code base.
1041
00:53:53.440 --> 00:53:54.840
Yeah, it's fair enough.
1042
00:53:55.119 --> 00:53:59.119
This is such good advice, Scott, And it reminds me
1043
00:53:59.239 --> 00:54:03.039
of the pattern and practices blocks that we used to use.
1044
00:54:02.960 --> 00:54:03.760
Back in the day.
1045
00:54:04.079 --> 00:54:07.639
Back in the day. Yeah, just the right way to
1046
00:54:07.719 --> 00:54:11.440
do logging and the right way to do database access
1047
00:54:11.480 --> 00:54:13.840
and all that stuff. And of course those things change
1048
00:54:13.880 --> 00:54:16.559
and things get irrelevant, but it's really great to hear
1049
00:54:16.599 --> 00:54:20.880
your your thoughts and they're they're wonderful, So thank you.
1050
00:54:20.960 --> 00:54:24.440
Yeahoris, it's from a lot of pain I've experienced over
1051
00:54:24.480 --> 00:54:27.400
the years, so trying to distill that pain into sure
1052
00:54:27.880 --> 00:54:31.440
tips for people to go back and apply immediately back
1053
00:54:31.440 --> 00:54:31.840
at work.
1054
00:54:32.000 --> 00:54:33.840
Great. Well, thanks again, Scott.
1055
00:54:33.840 --> 00:54:35.480
It's been great talking to you and we'll talk to
1056
00:54:35.559 --> 00:54:59.360
you next time on dot net rocks. Dot net Rocks
1057
00:54:59.440 --> 00:55:02.159
is brought to you by Franklin's Net and produced by
1058
00:55:02.239 --> 00:55:06.239
Pop Studios, a full service audio, video and post production
1059
00:55:06.360 --> 00:55:10.360
facility located physically in New London, Connecticut, and of course
1060
00:55:10.360 --> 00:55:14.519
in the cloud online at pwop dot com.
1061
00:55:14.719 --> 00:55:16.880
Visit our website at d O T N E T
1062
00:55:17.079 --> 00:55:21.119
R O c k S dot com for RSS feeds, downloads,
1063
00:55:21.280 --> 00:55:24.960
mobile apps, comments, and access to the full archives going
1064
00:55:25.000 --> 00:55:28.239
back to show number one, recorded in September two.
1065
00:55:28.039 --> 00:55:31.079
Thousand and two. And make sure you check out our sponsors.
1066
00:55:31.199 --> 00:55:32.480
They keep us in business.
1067
00:55:32.880 --> 00:55:36.280
Now go write some code, see you next time. You
1068
00:55:36.400 --> 00:55:38.039
got a Javans
1069
00:55:40.119 --> 00:55:44.840
And