Coding Blocks - Importance of Data Structures, Bad Documentation and Comments and More
Episode Date: April 1, 2024In this episode, Allen, Joe and Michael finally make it back to record together! Allen revisits the basics, Michael kicks off boomer hour nicely, and JZ let’s us know that the dream of an 8-bit look...ing keyboard is not dead. News Topics Tips
Transcript
Discussion (0)
all right how we doing this yes i heard you guys mess it up last time oh yeah like i go away we
can't we can't have nice things around here anymore was it was it messed up though i thought
that was the new normal we just get right into it we got ain't nobody got time for that so we just
you know we get right into it man whatever this is episode 231 it is this is a podcast yep and you can subscribe to it
yeah it could be worse though because like i remember uh did you guys ever used to listen
to the accidental tech podcast you remember that back yeah yeah long i haven't listened to it in a
minute but uh they would like it's it seemed like to, that they would turn their mics on like mid-conversation.
So like you just suddenly, you're like, what am I listening to?
What are they talking about?
Like, what, did I miss something?
Let me rewind.
Nope, that was the beginning.
Yep, yep.
That was the hot, like the hot opening I was used to.
The McElroys got me turned on to that.
Oh, okay.
McElroy Brothers.
Yeah, so I mean, it could be worse, I think I think maybe I don't know I'm not sure well you're not twitching so I think
you took your meds so I think we're okay yeah I listened to that last one I think I was twitching
when I was like really guys really anyways dying laughing after we hit stop on the record.
I'm like, oh, my God.
When he hears this, it's going to be hilarious.
I can't wait for it.
I think I got hot.
I wanted to see the reaction so bad.
I wanted to be in the room when you heard it for the first time.
So ridiculous.
Was it amazing? Yeah know it was ridiculous so
yeah i'm alan underwood the guy who likes the the intros we used to have and i'm the guy reading
the reviews oh wait no we didn't have any reviews this time that was a mistake on my part uh we
didn't have it so yeah but thank you anyways for those that did leave a past review. Wait, you're not going to tell who you are and who he is?
No, because anonymity.
Like, I want to...
Come on, man.
Hey, the guy on top up there on my screen is Joe Zach.
You want to say hi, Joe?
Hi, how's it going?
You know, everyone mixes this up anyway.
Yeah, they do.
But it doesn't matter.
It's fine.
It's fine.
The funny part is, I'm Joe Zach.
You're just messing with everybody.
Yeah.
That's,
that's outlaw right there.
I'm just kidding.
You can't believe him.
I'm Michael outlaw.
So yeah.
Yeah.
All right.
So yes,
we didn't have any reviews,
which made me sad because apparently we didn't on the previous episode
either.
So that's two in a row.
Like we're following.
We did on the,
we did on the previous.
Did we?
Yeah.
Yeah.
Yeah.
We did that.
That's where I messed up. Cause I because I left that name in there from the –
Susie Mon from the previous one by accident.
I was going to say, is there anybody out there anymore?
Anybody here?
I don't know.
I don't like the new open.
That's what it is.
Is that what it is?
Nobody likes the new open.
We're about to put boomer out i i think i think the
problem has been that the three of us haven't been able to like get together you know for a while
like it's it this year is off to one heck of a start and so like the three of us have had
difficulty like getting together and i think it's the lack of mental blocks that that's been the problem
it might be it's back tonight though so we'll see if that puts us back on track but boomer hour has
been popular so i mean you know if you wanted to move that up to the front you know there might
be some people okay with that i got complaints oh no you have complaints for boomer hour okay
i thought you meant you had complaints about Boomer Hour.
No, I appreciate Boomer Hour.
It's my therapy every other week, I think.
I don't even know why I didn't notice this, but did you see all the chat about the aux conversation?
No.
I didn't understand the aux, by the way.
I didn't get it.
Were we talking about auxiliary auxiliary or so so at the time of
the recording when jay-z said it i happened to be looking at my mixer and so auxiliary was like
what came to mind so i'm thinking like aux but the way he wrote it when he did up the show notes
like it was ock and like as I was editing the audio,
I was like,
Oh,
wait a minute.
I bet he means like part of blocks,
like part of the word blocks.
And so like it dawned on me,
I'm like,
Oh,
that's what he meant.
And then someone else in the Slack channel said,
Oh,
I thought he meant O X ox.
Yeah.
And like,
he was referring to you as the ox.
I was wondering the same thing if i like
the big bull guy like i'm not maybe i don't know i was confused when you spout a lot of bs no just
kidding i don't think about what i say don't don't read too deep yeah i just i literally just
meant like that's just happened to be where it was and i thought it was kind of funny that was
an animal so it just kind of worked yeah i don't know if you saw the uh the image art i used i did generate it but it was uh we had
talked a little bit about organ trail there so i found uh or i made it i asked dolly to make an
image of a person on a computer chair being dragged by an ox that's beautiful man along
the organ trail although that would have confused me further is what that lived yeah yeah but that's where he spelled out the ok
s but but it doesn't from the picture it's it's not apparent that the person is being pulled by
so it just looks like he's sitting in a chair it's almost like he's like a proctologist or
something for an ox and he's just like yeah all right what we got here or maybe it was a look
maybe it was a cow that he was about to milk and you got to be in a chair
to do that because i don't know yeah you can't really tell it's an ox either i thought bull
when i first saw it but you know yeah i mean if you remember the original oregon trail you didn't
really know what any of that stuff was yeah the good old 8-bit days yeah i'd be like your ox broke
an ankle 40 the river and you're oh, that was an ox. Okay.
So speaking of random Slack conversations, though, I'm hoping this becomes a trend because I don't know if you saw in general, but my new hero, Jim Hummelslein, he put a picture
of him donating blood in there.
And I saw that and I'm like, you know what?
I hope that this becomes like a trend.
Like how awesome would that be if people regularly give blood and like share their pictures of like, hey, you know, to like encourage other people.
So I thought that was pretty awesome when I saw that picture.
Don't play games.
I'll find out where you went and I'm going to go.
I'm going to get me a picture. I was very proud when you said that, that you had given blood that day and that you
were in a sort of a moron and decided to go out and do some mountain biking later that
day because you know, they, they just kidding about, you know, Hey, take it easy to say,
no, I got this.
I never, I, I, I'm sure that they've told me things like that before in the past.
And I just didn't really think about it or it never like clicked.
That is maybe the closest I,
you know,
like one of the,
one of those times in my life where I'm like,
this is probably the closest to death I'm going to like,
like I'm probably thought this guy's 21.
He knows that he shouldn't go do this.
Yeah.
Right.
Thank you.
Right.
Yeah.
You're welcome.
Yeah.
All right.
So a real quick update.
So I think Gregory had asked about an update on the networking stuff.
So the short of it is I haven't actually done anything with it yet, except mapped out a
bunch of routes through my ceilings in my house.
So a couple of things I'd actually said on Slack in case anybody else even cares
or is somewhat interested. So I did buy some of the, um, Omada's the TP link Omada,
like, you know, more commercially type things, which surprisingly aren't any more expensive.
And in many cases are cheaper than what you can get for the out of the box kits, like our Asus
ones that outlaw and I've talked about before. So I bought a couple of those and I bought the long range. I think they were the
6,600 or something like that. And then I did get a, a switch with POE on it and all that.
So I have all the stuff set up, but now I've actually got, I've cut a few holes in walls,
which by the way, like I mentioned to him, it's not a few holes in walls, which by the way,
like I mentioned to him,
it's not scary cutting holes in sheet rock.
Like if,
if you've never done it patching,
it's really not that bad.
Right.
You can be really bad at it and try it 12 times in a row if you want.
It's not going to hurt anything.
So,
so I'm not scared of that stuff.
It's really just trying to figure out how to get it through Joyce and stuff
and all that.
Yeah.
I was going to say,
to be fair,
when you said that you're like routing cables or whatever or like uh rooms or
whatever like it almost made it sound like you're just drawing it out like okay this is we're gonna
put that but like i wanted to be fair that no no no you're actually like you've made holes in floors
and everything like you're like you mean like cable runs or happening cable runs not not not just visually like so i've gone up in
my attic and looked over the into the abyss and i found where i need wires to come from
and i've mapped that out in terms of the floor plan and what walls that comes up through and
all that kind of stuff so uh and oh man there was a tool i bought i'll have to share it i can't
think of the name of it actually probably right behind me in this mess of a room I have.
Hold on.
It's this thing.
It is called a Teslong.
Oh, for testing cable length?
No, no, no, no.
No.
It's actually a little camera that you can fish into the wall.
And it's a 15 footer.
But what's so sweet about this particular thing is it's got a screen that comes with it.
So it's not one of these ones that you hook up to your iPhone or anything, which those are really irritating, by the way.
I have one of those.
Yeah, they're really annoying.
But this one, the wire hooks into the device and stays there. Like it's not going to come out.
So if you're doing things, it's not going to pop out on you.
And on top of it, it'll record in, I think 720p on this thing.
But what's even cooler, it has a button.
It's got a sideways camera too.
So it's got a front facing camera and a side one.
So if you're in the wall, you can hit the button and see what's beside it.
So this thing has actually been extremely useful for looking at, okay,
is there duct work in this hole that I made? Is there, you know, what,
like another thing, if, if you don't know about what's inside a lot of walls,
depending on when your house is made and what floor you're on and all that
kind of stuff, the wall is probably just empty space in between studs, right?
So left and right, you have a vertical stud interior walls, exterior walls, totally different
story.
But interior walls usually is just a bunch of space in between two different or two wood
posts that are going vertical.
However, if you're on a bottom floor, a lot of times they'll put a horizontal two by four
or something in there to stop fire from going up faster, right?
So it's basically a fire retarded.
So you can pop one of these things in a wall.
Like you could even poke a little hole that you could spackle up real easy,
pop this thing into the wall,
take a look and see if there's anything in there or not.
Right.
So,
um,
this thing's been super handy.
I think it was a hundred bucks.
Like it was well worth the price.
There's a YouTube channel that I'm pretty sure that we've talked about.
I could go back and find it, uh where um because i think i talked about the the oh man what were
they called the wagyu uh connectors is that what they were called yeah yeah and it was that and it
was that guy's channel that uh there was a youtuber that like do diy that had turned me onto it, but he also turned me onto the idea of using something
like a Dremel to cut your sheet rock so that when you do want to make a hole, like you could make
these perfectly squared off holes with super clean cuts so that when it comes time to put it back
together, it's not a mess because like back in the day i would
have like a hand saw and i would try to cut it and it would never come out right or i i would also
try like to in an effort to get a cleaner cut i would try using a razor like those knives that
the knives that have a razor as the as the other type thing yeah yeah but well a little bit more
heavier duty than just a box cutter, but yes.
Um, but to, in an effort to try to get like a super clean cut, but it was just always such a
pain. And then I don't know why, I guess I was just being cheap. And then this guy, you know,
I saw his video on it and had the super clean cuts that he made. And I'm like, what, why have
I been denying myself this all my life? And so, yeah, that's how, that's how I make my
cuts now. Yeah. I mean, it's, it's actually not scary. Like if you've, if you've never done it,
it's, it's not terrible getting in your walls. I mean, yeah, sure. You may not want to just go
poking holes in your walls if you can repair them, but they're really not bad. And then the other
thing I was telling outlaw about, like one of the holes I made was in my bathroom closet, right? Like I don't, I don't even care, but the beauty is that sort of the common
wall between my bottom floor, my main floor and my upper floor. And so it was a perfect place to
cut a hole. Well, I didn't really want to have to deal with repairing sheet rock and stuff in there.
They actually make these panels that have a spring and a clip on the back of it so you can cut a hole in the wall so i cut like a pretty decent
size hole like a 12 by 12 and then i can just slide this panel into place and and if you paint
it it'll just look like part of the wall and if you ever need to get in there and do anything with
the cables ever again you just i need to see off and you're good i need to see a picture of this
thing because you've tried to describe this to me and I'm like,
not,
it's not getting through.
Yep.
I will,
I will share a link to it on home deep.
I want to say it's like 13,
$14.
Like they're cheap,
like they're super cheap and hyper useful.
So at any rate,
all that to say,
I,
I am to the stage now where I'm actually taking next week off and I'm going
to be doing all kinds of stuff around my house.
So I'll probably be cutting holes and running wires and all that another trick that
i've seen people do though too is like uh take the baseboards off and then that way like any
holes or anything that you want to put there you don't necessarily have to like redo the sheetrock
you just put the baseboard back and then yeah man that's a pain honestly i'll tell you this like i would rather cut holes in
sheetrock and pat sheetrock than cut caulking on baseboards and fix all the caulking and get
all that back because then you got to repaint like seriously the sheetrock is less time yeah in the
in the end um yeah i've used i have one of those uh little camera attachments that you were talking
about too but for that you would attach to your phone.
Yeah.
And the one I have was specifically,
I could only use on my Android phone at the time just because of the
connection type.
And,
but it was super helpful.
Like,
you know,
I did some cable runs in the house like that too.
And another thing that I did to extend mine is like,
if you ever seen,
there's like fish poles like
not fish tape but fish poles where you can like screw in another pole to like get the length so
uh i i have used those before where like i could tape the the camera to like one end and then that
way i could just use the fish tape to push it or the fish same thing but i did same thing i did and you have to do that in order to keep your camera orientation
right otherwise the thing's spinning all over the place yeah you don't know like in the movies they
just make it look like oh you can just point the camera up and then you just bend it and you're
like yeah no that's not that's not how this works like i don't have government buying yeah the people
looking at people on the other side of the door it's like no man it's actually way more of a pain like man i twisted it's wrong i can't i can't see anything
yeah so i i may i may make some videos on this like it's it's always that balance of
do i want to just get this done or do i want to have to get cameras set up and be like
hey i'm breathing in a bunch of sheet rock dust right now here's what i've done you know
yeah so i don't know i don't know what i'm going to do but at any rate yes it's going to be moving
along here pretty soon all right so yeah now now i guess on real topics yeah no not boomer hour
we're gonna save that for a minute okay i'm sure i've got things on boomer hour i'll probably i got
some boomer hour topics coming so just wait for it all right so this first one came up um because we saw something happen
so we've talked about the fact that we even want to talk about flink on some upcoming episodes
right so we've bought the books we've been reading them we've been working in flink as well and if
you have no idea what flink is we're talking talking about Apache Flink and it is a data streaming platform for
getting like real time analytics and data processing and all that kind of
stuff.
All right.
So here's the big deal.
If you're working in a streaming platform,
everything has to be fast.
Everything.
You didn't like it at the other year.
No.
Yeah. It's not worth explaining everything has to be fast right like if you have millions of events coming in in a minute let's say
anything that you're doing slightly wrong in your code is a super potential bad bottleneck. Right. And one of the reasons why
people use Flink, man, and I was actually hoping I did not get approved for the speaking in Oslo,
by the way. I really didn't. Yeah. My guess is my guess is AI is all the new rage. So I'm,
I wouldn't be surprised if that's a lot of it and they're going to be bringing a lot of people in
for that. But anyways, one of the things I wanted to talk about is why would somebody choose Apache
Flink over something like Azure functions or Google functions or any of those, right? Because
those seem like those sort of do the same type thing, right? Like you can hook them up to a pub
sub or, or some sort of event queue and have them do things. Well, where Flink is really good is you can store state
in it. Whereas like functions like cloud functions are typically stateless. That's the whole point
of them, right? Like you give it something and it can process it and then move on. Well,
the state that's important in Flink is you can kind of do whatever you want with it, right?
So let's say that you have a customer and you want to track how many customer
orders or their average order value or something, right? You can have that stored in Flink state as
it's coming through and you can constantly update that thing on the fly. So you don't even have to
push it into an analytics engine or anything like that. Well, if you do that, let's say that you
create this state and you want to be able to look up and
order information by that.
And you put this into a list that might end up being a really big problem.
If you have a customer that has a thousand orders or,
or maybe 50,000 orders,
right?
Like you,
you have one of the top purchasers on Amazon rolling through there.
And I like to brag about you outlaws, like friends with the local Amazon
delivery folks. Um, but, but the problem is every single record that comes through for that customer.
Now, if it's having to look up a particular thing, it may have to scam 50,000 records,
right. And that can take a super long time. And this is why I wanted to bring up data structures,
right? Like we haven't
talked about this in quite some time, you know, you have your regular ints and strings and all
that kind of stuff. But when you start getting into, into how you're storing data, there's a
big difference between a list and a map, right? Like it used to be back in the day with C sharp,
you'd have hash maps and things like that but they didn't
support generics and they came out with dictionaries and in java i think it's actually
just called a map right i know in kotlin it's called a map uh i can't remember what it's called
mutable maps hash map hash maps is uh i think a hash map is actually also an interface
um but mutable map is usually what i do okay So the big difference is if you're trying to get to something and there is a known key,
don't use a list.
Use, use a map of some sort because there's usually an O of one lookup to get to that
value, right?
Like it knows exactly where to go to find it.
Whereas if you have something in a list, there's not a lookup for it.
It's going to have to scan the contents of that thing until it finds it. And then hopefully you did something good enough to
just move on after you found it, right? Like you did a return or a breakout of some sort of loop
or something. But that, I mean, even, I think this is where we as developers sort of get,
we have blinders on when, when we're doing things,
as you might do something on a list because you're used to working with lists
and there's a fine function in it, right. Or there's a contains function in it.
And so you just run that thing and you're like, oh, that's good. But behind the scenes,
you don't know that it's actually doing a scan of the entire thing. And so you end up taking a bite
out of, out of whatever it is. It's a really bad bite
and it takes a long time. So for instance, in this one case, we found where, where a list was
being used, where a map should have been used and changing it out, change the throughput by 60 X.
Like that's not a small chunk, right? Like that's a, that's a really big difference in performance.
So it's easy to forget about the basic stuff as we develop.
So I just wanted to bring that up as a reminder.
Yeah.
We talked in detail about a lot of that.
Well, first, we've done a bunch of episodes just on data structures, period.
But specifically during the Designing Data Intensive Applications book series, there was a set of episodes that were just on data structures and also to like another like dusting some cobwebs off of a
off of a resource from the past the big o cheat sheet has a graph of the common
data structure operations and like which ones you know like what's what's the
um average and worst case in terms of like time complexity or space complexity
for some things like a hash table or an array or a queue or whatever so i i threw those out there
just as like you know reminders in the show notes that you know hey these were things from the past
like but still very relevant you know so yeah good stuff you know one Hey, these were things from the past, like, but still very relevant, you know?
So.
Yeah.
Good stuff.
You know,
one of my favorite things from those old ones,
I don't know if you remember,
I don't know if it was you or Jay Z that found this application on phones
that visualized all the big O things and the different sorts and,
and algorithms that were out there is super cool.
I still have it on my phone.
Yeah.
What was it?
Do you remember what it's called?
Yeah.
I'm trying to remember it too.
I remember there was a programming app that we talked about at one point and
you could see some things,
but some of the features were behind a paywall,
but I don't think that's what you're talking about.
No,
I'm going to have to find it.
Maybe it's not on my phone now.
Cause I'm on my 12th phone since that,
that episode,
you know,
eight years ago or whatever,
but,
uh,
I'll have to find it,
but it was really cool.
Well,
that was the surprising thing too.
Going back into like looking at data structure.
Some of those episodes were like double digit episodes.
And I'm like,
huh.
But also a lot of the data intensive applications like that covered a
whole swath of episode numbers it was like that was like a year of content yeah for sure and and
in real man hours it might have been more but yeah probably like yeah all right so that one that one
was interesting and again you know if if you're not even familiar with all the kinds of data structures and the sorting algorithms and all that kind of stuff, probably go listen to those episodes and get familiar with it.
All right.
So the next one that I had that I thought was kind of interesting, this was something that came up, is if you are, let's say, I mean, we've talked about the hammer and nail situation
before where people will use relational databases for that, right? Like, uh, it becomes your search
engine. It becomes your analytics engine. It becomes your, you know, web front end. It's
everything, right? Well, there are people that go the other direction and they'll use something
like a document database for all that kind of other direction and they'll use something like a document database for all that kind of stuff.
Or they'll use something like Elasticsearch or Lucene for their source of truth, right?
Well, there was an interesting thing that came up.
Microsoft is notorious for this.
You guys remember when they came out with.NET 1 because they they were gonna brand it as like
the brand new instead of dot net oh yeah it was terrible yeah so they they went from dot net core
to dot net one and then everybody hated it so they're like all right we'll just call it dot net
core four whatever i i don't even remember what the direction was but it was something whack like that. Well, when you do things like that, if you're storing your data in a place like Mongo or in a place like elastic
search, you don't have a lookup table for these things, right?
So, so if you want all your data to,
to go from.net one to now.net core what do you do do you go find every place in
Elasticsearch that had that field and try and update it do you go into every collection in
Mongo and try and find every single field that your application ever wrote to that had that
that in there or do you make an application layer type change that
will map that for you and display it differently for you on in in the ui type thing right so
so behind the scenes it's all still saved as dot net one but when you show it in the ui you're
doing some sort of mapping lookup that says dot net core. Like how would you, how would you think,
what would be you guys' approach to this type problem?
Or maybe outlaw is,
is looking kind of squinty.
Like maybe he doesn't understand what I'm saying.
I think I misunderstood something.
Cause I'm,
I'm trying.
Okay.
So,
so again,
if you have,
so.net had first named their thing dot net one
if you put that into a billion elastic search documents and multiple fields right
and it all says dot net one how are you going to display that in the ui now what are you going to
do are you going to go update your entire index with all the fields or are you going to try and
make some sort of mapping the application tier change that's where that's where i got lost i thought you were talking about like if you had these
different language frameworks and you're like hey i want to be able to write my code in one
but but behind the scenes it could compile into the other and i'm like no no no wow
like this is the name it's basically figuring out that you should have had a primary key or
you should have you have somewhere where you didn't but you should have had a primary key or you should have you
have somewhere where you didn't but you should have had a separation between like a logical
identity and like a human readable value right and that's that's really what it is but that that
also sort of i mean so so that's interesting jay-z for this reason that makes sense especially
when you think in relational thoughts, right?
Like you're going to have a lookup table that has this primary key on it. That is, you know,
Hey, dot net one is ABC one, two, three. However, when you're working in like a Mongo in a document
database or in a place like elastic search, typically you write the data straight out there. You denormalize all of it
because that's how it's more efficient, right?
Right.
So did you do anything wrong?
Probably not.
But how would you fix it?
Like, what would you do to go forward at this point?
It's so hard.
If you're in a Postgres or relational database,
like then there's like a kind of a clear path forward.
It's like, okay, well, I need to write a query
to insert a new column and, you know,
update the data with a new key
and point it to a new table and it's going to stink.
And it's probably going to take, you know,
an hour for me to like write it and test it.
But if you're dealing with like a search engines,
mongos, document storage,
like that sort of stuff where the data is embedded, then first you have to decide if you even want to introduce some sort of primary key.
Because at that point, you've got to do a join.
And those kind of things don't do well with joins if they even support them at all.
And so it's a really gross question.
And I just don't know the answer. But I mean, I do think like if you consider like localization,
like different languages at all,
then it's probably not good to store like any specific language period
in your actual database and reflect that directly on screen.
So you obviously need some sort of lookup,
but it doesn't mean that that lookup has to happen in the database.
So I don't know.
I'm kind of torn.
I kind of feel like maybe
you don't try to introduce some sort of uh a primary key if you're in that kind of no sequely
land i would i would kind of question the use case of like what the data is supposed to represent
though like if the data is supposed to represent a moment in time then you don't change the name because that's what the name
was at that moment in time you leave it be and you could in in your display like you know show
results for where the name is either right yeah you know but yeah that it's a matter of, like, well, how important is it to have the name changed in the data, right?
Jeez, yeah.
That's tough.
It depends.
I think you're totally right.
So it depends on your domain and what you're doing and what's going to be worse for your users.
There's a case to be made for keeping it separate. And then you've got this difference between historical.
If your domain involves like searches going back,
you know, years or whatever,
and older data,
it's a bad user experience to kind of have people like have to remember,
oh yeah,
this is the old name and this is the new name.
And if I want to see everything from the last year,
I've got to click both.
Yeah.
That's what I'm saying.
Like it,
it kind of depends on what the use case is but you could
even abstract some of that away from the user too that were like if they if they typed in a search
or you know selected something that you would do the search for both in the background
right not great i mean that's ugly for sure you know, it would also just matter of like, well, how long are you going to keep that data around?
Because is it eventually going to age out and then it's just going to correct itself?
So how much time and effort do you really want to spend in trying to go back and correct that old data that you know is eventually going to age out anyways?
So, you know, maybe who cares, right?
Yeah.
So, yeah. to age out anyways so you know maybe who cares right yeah so yeah but i kind of like view you
know i kind of like the idea of viewing it as a moment in time kind of snapshot because otherwise
why are you using like a document storage system for it if it's not supposed to represent a moment
in time because like we've talked about this in the past with like orderings orders for example like online orders and the beauty of it
is is like in that one document you it could contain here was the billing address that was
used at the time the order was placed here's the shipping address that for that at the time
you know the the um did i already say billing address said shipping address you know, the, the, um, I already say billing address said shipping address, you know, billing information, whatever. But like all of that is that specific moment in time being
represented. So not to say that you couldn't do these in relational too, but whatever.
But it's interesting though. Like, why would you do it in the document database? Because again,
that's what, if somebody picks Mongo, that's kind of, that's probably their central data store,
right. Or if somebody, that's, that's probably their central data store, right?
Or if somebody – that's kind of what stinks about it is it's kind of hard to say, why would you do that? Because, I mean, the inverse of it, right?
Like people do these types of things in a relational database that are more snapshot and time things that don't work well there. Well, I mean, part of the problem though, that I think that you're describing is that,
and everyone in every industry,
every technology like is probably guilty of this to some degree to where like,
if that's the,
if that's the devil,
you know,
then you're going to use it.
You're going to,
you're going to use it more often than you probably should.
Right?
Like,
it's not that you're trying to solve like that one
problem it's just like that's the thing you know you're going to use it for everything
because that's what you're comfortable with you know right so yeah just don't do it just don't
rename it right if only everything was that easy like i'll just move forward right yeah roll forward yeah so uh
what you got what's there's breaking news breaking news so yeah uh if you remember last week i was
talking about keyboards and stuff and i ended up getting one that i don't love it i didn't realize
it's 75 key uh keyboard and it doesn't have the tilde button. 75? I've never even heard of it.
75%, sorry.
Oh, 75%. I think it might be 67 keys.
Yeah.
Okay.
So 75%, and it doesn't have the function keys, which I was like, yeah, okay, that's fine.
But yeah, it doesn't have the tilde or the back tick, which I use all the time.
Depending on the language, but also I mostly just use it in Markdown for code.
So the way you have to do it is you have to hit this function key and it
escape,
which is terrible.
I keep hitting the wrong button.
Like,
so this keyboard is going back.
I tried,
but I was trying to decide what to do next.
I was looking at maybe a new fee and you PHY.
I was kind of designing out some stuff and speccing it out and just,
you know,
didn't love us thinking about maybe getting the same keyboard.
Remember I've got the nest keyboard,
the eight bit dough.
And then just tonight as we were recording micro G sent me a link. Just, you know, didn't love it. I was thinking about maybe getting the same keyboard. Remember, I've got the Nest keyboard, the 8-bit Do. Yeah.
And then just tonight, as we were recording,
Micro G sent me a link.
8-bit Do, I guess that's the name, 8-bit Do,
is putting out a new keyboard,
very similar to the one,
like almost identical to the one I have now,
but based on the Commodore 64.
Yeah.
It's got that like rainbow logo.
Yep.
Yeah, it's available for pre-order and I pre-ordered
it instantly even before I spotted back. I was like
pre-ordered. Thank you.
That's it.
It definitely
has that little bit of nostalgia
and it comes with a joystick.
Yeah, I'm never going to use that joystick.
I'll tell you right now.
I don't know. I'm waiting for your next
Git commit that you typed in
with just a joystick yeah because it comes with the ab buttons like the the nest one does from
surveys and they're just like yeah what the heck yeah i don't know i'm not using that either i still
i still like that cloud nine that that talked about last time. Wrong direction.
What?
Yeah, move the wrong direction in history.
You got to go back.
You got to go backwards in time.
I'll go back in time.
Well, that would be new for me, so it would be forward.
Like getting another Kinesis would be backwards, right?
Unless there was like something major. I don't know if they've made any new changes
to the uh gaming what's this thing the gaming freestyle rgb bunch of letters usb data port
abc 123 and it's pretty it's pretty good though yeah this keyboard has the commodore logo though
the amazing thing about this keyboard though is it has all the
letters yeah does it have a tilde it does all right it's better than the unzi i got i can't i
can't deal with it yeah well all right so uh how about if we were to say like you feel like leaving
a star like leave us a star oh i forgot about that portion of the show last time, too.
Like, seriously?
Can't leave you guys alone.
Maybe this time just leave five stars for Alan.
You know, actually, I just wrote a review today for another podcast I'll tell you about in a little bit here.
A little preview there.
And it was really easy, actually.
The iPhone, it's been a long time since I And it was really easy, actually, the iPhone.
It's been a long time since I've had an iPhone
and then also did a review.
So you actually could just do the stars there.
You don't even have to write one,
but of course you should write one.
So I did the stars and I did write a review
and it took like 30 seconds and I left it.
And it was great.
And I'll tell you about that show here in a minute,
but you could hook us up like that.
If you are on iPhone.
Android's got similar type stuff.
We've got a bunch of links on the review page, which we've got a link in the show notes.
But if you also just remember, CodingBlocks.net slash review.
What if we went viral, though, for one-star reviews?
No. No.
How about not what if?
We're not one of those shows like you know there's those those people on on various different platforms that like just rub people wrong and so they get tons of views we're not those guys like
we're not trying to be those guys okay yeah anti-heroes are Are you saying we are not controversial?
Probably not most times. Let me talk to you about sorting.
Let me talk to you about sorting.
Did you just pull a Swifty on us there, Jay-Z?
I think you did.
A Swifty?
You called us an anti-hero?
Oh, dang.
I think you did.
See, you out-paid me.
Good job.
My mind immediately went to Deadpool.
Oh, I started watching that again the other night that movie so fun can't wait part three coming out the dramatic conclusion
to the story that's um that's sad
uh okay so well hey we haven't done this in a while so how about uh it's time for mental blocks
this should be interesting yeah how do we do this again yeah all right this is uh 231 so according
to the tuckhouse trademark rules of engagement alan is first i have the advantage. Yep. Maybe, maybe the categories are as seen on shark tank and Alan,
that's a TV show.
I've seen that show.
Oh,
I've seen them all.
I'm ready.
This wonderful hashtag Barbara hashtag team,
Barbara,
the next woulda,
coulda,
shoulda man.
I don't even know how I'm supposed to pronounce this one.
This isn't even a proper noun.
Is it demon?
M's demon M's are words that refer to a native or a resident of a certain
place.
Next category.
Oh, that's rich.
Lesser known siblings.
And lastly, all you need is love, L-O-V-E.
These are words that can be made entirely from the letters in L-O-V-E.
You could use them more than once if need be.
All right.
Let's do the L-O-V-E for 500.
Wow.
We're coming out of the gate strong.
Yeah, let's do it. as Charles Darwin could tell you to do,
this is to gradually change or develop over time.
What does evolve?
That is correct.
Yeah.
Yeah.
So I'm sorry,
Joe,
he probably already lost.
Yeah,
that was good.
Why can't I get a shark tank?
All right.
So, well, I'll give you a Shark Tank one just to make you feel better before I break your spirits.
So how about a 300 one?
Sounds good.
This company with a bumblebee-inspired name has the highest lifetime sales in shark history.
That's a lot of socks.
I don't know.
And this is why I'm breaking your spirits.
Bombas is the answer.
Oh, bombas.
They actually give money for every pair you buy.
They donate a pair of socks.
Yeah.
Yeah.
All right.
Here you go, Joe. right dang it this first category is not meant
as a slight by the way feeling gassy fictional tv towns big dogs as little puppies you'll be
seeing oh this one's a visual and you'll be seeing some very large breeds when they
were very cute puppies.
We're not going to do that one.
That one.
Yeah.
Well,
I said no,
uh,
for sweater or worse.
Wine biz and Miriam Webster's words of the year.
Uh, I know.
Tonight, I got to say I'm feeling a little gassy.
I was really hoping that you'd pick the words of the year one.
All right.
What's your cat?
What level are we going?
I would have been smarter.
I don't know.
Let's go with two more than Alan got.
That's not an option.
That's a lot of gas.
It is 500, right? I forget what the
denominations are. It's one through five.
We just did the one through five.
This is mental blocks. I think you're confusing it
with another show.
You're going five.
Helium gas
gets its name from the Greek
word for this
astronomical body where it was
first detected.
Whoa.
Do I get to steal?
If he doesn't know it.
Well,
you got to wait.
Helios is sun,
right?
And this was first detected.
Yeah.
What's your answer?
We didn't first detect from the sun.
Is that your answer?
Yeah. I mean, I'm just going to say sun.
That is correct.
Okay.
We got a time game, gentlemen.
Here we go.
All right.
Alan, your categories are E Z geography.
The consecutive letters E and Z will appear in each correct response.
You're a homophone, Diane.
Hi, I'm J-Lo.
Shapes in nature.
Fashion for all.
And lastly, pew, pew, pew.
The sound will begin each correct response.
Ooh, I like that one.
Sound, sound for three.
For three.
Henry David Thoreau pondered why a bucket of water becomes this foul word,
but frozen remains sweet forever.
Say that one more time.
Henry David Thoreau pondered why a
bucket of water becomes this foul
word, but frozen remains
sweet forever.
And the but sweet forever
but frozen remains sweet forever
is in quotes.
Oh. and uh but sweet forever but frozen remains sweet forever is in quotes oh i don't know jay-z for the still
can you say it one more time it's not gonna get any easier hen Henry David Thoreau. This is Alan's fault, by the way.
Henry David Thoreau pondered why a bucket of water becomes this foul word, but frozen remains sweet forever.
I mean, it's ice, right?
What is ice?
That is wrong.
The correct answer is putrid.
Putrid.
What?
I didn't pick the category, Alan.
That was kind of...
That's why they call them mental blocks, folks.
I got nothing, man.
Yeah.
I mean, there were so many better ones like, yeah, fashion, J-Lo, geography.
Come on. You don't know geography i i don't i would
have gotten that one wrong all right here we go we're a tie game category is rallying cries
you ready each of you need to find a place to let's's see, how we want to do this. All of it.
It's fine.
Yeah, yeah, yeah.
But you got to write out what your vote is going to be and write your answer somewhere where the other person can't see it.
Right, right.
I'm going to go to sheet five.
I was going to say, why don't you privately send me a message of where your answer is.
Actually, just
privately send me the answer.
Too easy.
Yeah, that's too easy.
That's fine.
That way, in the spirit
of fairness...
Let's do it.
Here we go.
Rallying cries.
Don't mess with Texasxas sam houston's troops shouted this three-word battle cry while attacking santa anna's army at san
i'm thinking that's supposed to be juanito but it looks more like Wacito.
So I guess Juanito has to be wrong.
So I'm messing you up.
S-A-N J-A-C-I-N-T-O
I don't know.
Reword Battle Cry.
Yeah.
I mean,
that part, like who cares about
the San Wacito part? You should already know this. now that part like who cares about the the san
wasinto part like that you should already know this
if you don't know it i'm ashamed of you
well can we go over a word is that okay
um yeah if that's how you count to three whatever it takes
to get the job done. You know, three, four.
I got an answer from Joe, but I don't have the amount you're wagering.
You need to put that in there.
I mean, I thought that was obvious.
Yeah, it was all in for all of us.
I think Alan's Google searching.
No. No. Okay.
There we go.
All right.
So let's see here.
Alan wagered five.
He was all in.
And his answer is, I don't know.
So let me go ahead and enter this score in as the Texas battle cry.
I don't know.
Was that correct?
Please say yes.
And that is not correct.
So Alan has zero points on the scoreboard here.
Started off so strong.
Joe, however, I'm going to go ahead and just tell you, he got it right.
So he wins.
Remember the Alamo.
Oh, man.
You know, I kept thinking, don't forget the Alamo.
And I was like, there's got to be another word for don't forget.
Man, I haven't heard that in so long.
Don't forget.
So good.
Congratulations.
Thank you.
Yes.
You know how I know that, by the way?
The only reason I even know that is just from Pee Wee Herman.
Oh, wow.
Really?
Yeah, I've seen that movie a million times.
I guess.
Is it just me?
I remember it from history class. Isn't that? No. would you talk about that history no i don't know because it
was like part of history you know stuff that you learned we used to learn all right well
so um we're down with mental blocks joe just trounced Alan. It was brutal bloodbath.
We asked for a star.
Now, my topic for the show, for the water cooler, comments.
So, more specifically, I saw this recent picture, and I just found it so hilarious.
This was in Programmer Humor on reddit and it was called
junior devs writing comments and i'm going to throw a link out here for you guys to see it if
you haven't seen it already and it just pretty much sums up how some comments are just awful
where there's a stop sign and then below it is another sign pointing to that stop sign that says,
this is a stop sign.
And the frustration that I had,
that the reason why the timing of when I saw this,
of like when this happened,
like,
uh,
cause this is an old,
the,
um,
the thread in,
in on Reddit that I'm sending to is kind of old, but, uh, this picture was
recently floating around again and the timing of it coming up was so perfect for what I was
working on. Then I was just like, man, I think that person works at Google because I'm going to send you this, okay? So also in there, check out this as an example.
If you go look at the comments for the properties on this thing and tell me that person did not write the comment for that sign.
So I've been working lately with the Google Cloud Functions library.
And it is ridiculous.
I have grown to hate automated documentation
because if you're not going to take the time
to put the proper comments in your code
so that the automation creates good quality output,
then what's the point of it to begin with?
And the Google Cloud Function Library, the specific link that I pointed them to is for
Node.js, but this is pretty consistent with what I saw in their reference documentation
regardless of language.
So java.net, whatever, it didn't matter.
Go, Rust, it was all pretty much like this
to where it would have like a property called name and the the comment from google is this is
literally the just two words get operation request name where get operation request is the name of the object right so yeah and i'm like yeah i know
that from the name of the property like that's not helped me like we there were there are better
examples where like this one is just like kind of easy to point to as like an egregious example of
where the the comments don't help but within this library and and the the functions and in the object types and everything, there's so many examples where the automated documentation just really falls flat.
Like the description of whatever the class or interface or whatever property it is or the method, like it really doesn't go much further than describing what the thing are
what it was already named to begin with and then to add on to that there are like i'll send you
another example here uh actually let me get a more better mo better um well maybe we can get
one that corresponds with that yeah here we go so go. So, so check this out. So here's the corresponding,
um, cause I gave you, yeah, get operation. Yeah. So, so here's, here's the corresponding,
that was the interface or no, that was the class that I gave you to, to construct that. Here's the,
the documentation for the actual method that would use that request. And you could tell that like there's,
there's the descriptions I think are also like generated too,
because the description of the method is describing the return value.
And it says promise the promise,
which resolves to an array.
The first element of the array is an object representing space period.
You're like representing what was? What is it representing?
I want to know!
But also, too, the most frustrating thing about this documentation was that, like, there was automatically, at least they warn you that this snippet has been automatically generated.
So there's, like, automatically generated code examples of, like, hey, here's how you would call this thing.
But it really is just like class dot method name with like a request put in the, in, as the parameter. But so you're like, okay, well, what does the request object need to look like? And
every time it's just like request equals object, you know, like in, in JavaScript, you know,
like just curly braces and you're like, yeah,
but what are the problems? So you have to go digging through it.
So it took the frustrating part was I eventually got to the point where I
could, you know, navigate my way through, through and figure out like, okay,
I know what, I know what they're trying to say here and,
and could figure out what the request was supposed to look like.
Hence,
I sent you an example of that,
but it was just so frustrating getting started with this documentation and
these poor,
poorly automatically generated examples that were like kind of worthless.
Like it didn't really help.
Yeah. So, kind of worthless like it didn't really help yeah so so this is actually the intro to boomer hour because i can actually piggyback on this because honestly like we've talked about how incredibly good microsoft's documentation is
yeah like industry leading bar none it is the best hands down. They have examples on the page, like real legit examples.
I ran into something very similar to this recently outlaw where I was having to update something on
a, on some GCP thing. I don't remember if it was a pub sub queue or something. I don't even remember,
but it was a similar type thing where the
documentation was just abysmal. And when I, even with the sample code they had there,
I kind of took it up there and modified it and went to run it and it'd fail and be like, Oh,
you didn't pass a, a, a mask. And I'm like a field mask. What are you talking about? Like,
I don't even know what you're talking about. So I go look and I'm like, oh, okay. So I need to tell it what field I want to update in this thing.
Okay. Well, where's, where's the lookup values for what these fields actually are?
Nowhere. Couldn't find them anywhere. I searched all over the place, man. Like everywhere. I looked
through the Python docs, the Java docs. I looked through everything, couldn't find it and i got really irritated because my code
was done in 20 minutes but i couldn't get it to work for hours because i couldn't find the
information so what i ended up doing was debugging sending a request debugging all the way into their
um grpc call so i could see what kind of masks it was passing
so that I could rip those values out and borrow them for my update method. And I got it to work.
I shouldn't have to do that. I should not have to debug down into their low level code, their client
to be able to find that dude. I was so mad. And the thing is like,
part of me wants to be a good Samaritan and go, you know, to the page where it's like, Hey,
can we improve this? And I'll be like, yes. But, but then I'm like, man, I don't have the energy
to write up this five paragraphs of what I just went through to tell them that this is inadequate because they
should have known it was inadequate.
Right.
Yeah.
All right.
Done.
Yeah.
Another one of the frustrating things though,
about this,
this,
this kind of like caught my eye and I was like,
Oh sweet.
They did this.
And then I was like really burnt when I saw how it was implemented.
So like,
if you're ever poking around within like
the Google cloud, uh, you know, tooling, right. Like the different pages for it.
I haven't noticed a dark mode for it, but like some websites like GitHub, for example,
you know, you can, you can go into your profile, say like, i want the dark mode well so i was poking around
you know going through this documentation and i saw a little uh vertical ellipse and i'm like oh
dark mode yeah i want that but it was only for the code yes example it was not the page yeah
i'm like yeah that's terrible Somebody wasted developer time implementing this feature just for that one little bit of thing?
Like, really?
So now your eyes are bleeding all around the edges.
Yes.
Like, where are you looking?
I was so disappointed.
And by the way, so that's not to say that there isn't, like, because, like, at the language level, there are some other examples of good documentation out there.
We've talked about the Kotlin resources before.
Amazing, yeah.
As being really good.
So I guess I'm thinking more of like skip the language level and let's talk about libraries.
And that's where Microsoft just seems to kill it
in that regard yeah that's by far yeah java docs absolutely make me want to burn the world down
like i can't i can't deal with them yeah worst idea ever like
it's just it's not this idea. It's just poorly implemented. So often is the case where the documentation is never the focus. It's never the – nobody cares. It's always the last thing that's thought of. Like, I guess, you know, going back into the 80s, you know, like you watch documentaries and whatnot.
And like catering to the developer was something that, at least from things that I've read and seen, that seemed to be like where Microsoft put their emphasis, right?
And, you know, it shows in things like that.
So polished. Yeah, this kind of stuff really does irk me like it it makes me mad like physically angry sometimes all right so yeah all right well
that one that was my short little uh boomer uh boomer minute hey wait. Jay-Z looked like he was going to chip in. I just had a Boomer
confession, actually.
Unfortunately, I went to
share the keyboard that I just mentioned,
the Commodore 64
remake, whatever,
and I shared the thank you page from my
pre-order rather than the actual
item. I just clicked the link,
y'all. I see it when I click.
Well, I mean, when I click. Well,
I mean,
for what it's worth,
like when you put that link out there and I,
I clicked it,
I didn't see anything about your order.
I saw the,
the product page.
Yeah.
I sent a different link.
I just,
yeah,
that's what you get for ordering stuff instead of paying attention to a
recording or ordering.
I messed up everything.
Ah,
yeah. So what's this this this dev hints that somebody
put out there yeah so this was something that micro g sent and i don't think we talked about
last time um and uh what i like about it is it's uh i probably should use this as a tip of the week
but whatever it's going here because uh not only is it just a cool thing to have so like example
you go to this website you can search for uh i don't know uh i just would click on that bash i
don't really use the search but you can click on like a bash or i don't know enzymes react
uh them they've got um things for git docker is in there docker compose it's basically like uh
just a huge collection emacs is in there a collection of
cheat sheets for various tools so there's been times when you're giving tips for like you know
docker cheat sheet or or something uh and this is actually just a collection of a bunch so you can
bookmark this one thing and go in here and you can see there's a ton of them i guess that's why
they have the search and so i'm just going to go into uh docker and what i thought was really cool about this and was you know it sounds kind of kind of dumb or uh docker docker file will do each cheat
sheet isn't really forced into a common interface in the way that a lot of tools like this will do
like we talked about like man pages before and like you look at the main page it's got a very
similar structure between different tools.
But a lot of times these tools just do things in a different way.
And it doesn't always make sense to try and kind of force them into the same kind of format.
If you think like about a git, for example, git has a bunch of like sub programs.
So you can do git add or git remove or git commit.
And, you know, kubectl is the same way.
But something like curl is a bunch of flags.
So, you know, dash L, same way but something like curl is a bunch of flags so you know dash l dash ash follow whatever and so uh i like that each of these cheat sheets
is really uh catered to how it's used and so like you can look at a cheat sheet for bash and one
forget and it's going to look totally different i don't know if that was a good example hopefully
it was but uh like i'm looking for ansible and
it's got little you know tabs and you can kind of break it down and it's just really well thought
out it's got nice links and so it's kind of like a nice one-stop shop to have um have all your
two sheets and i just thought it was kind of a nice user interface for something that's complicated
you want to know a secret though yeah it's a good thing you didn't use this as your tip of the week.
Oh, yeah?
Is it your tip of the week?
Well, no.
Did you already do it?
But back in episode 86?
No.
Wow.
It was our tip of the week.
One of our tips of the week.
This one was?
Rico's Cheat Sheets, devhints.io.
Oh, my.
It's my cheat sheet.
Failed me.
Failed me.
Wow. Okay. Well, I don't know that it's a fail as much as
it's just like well we're consistent
yeah still a legit tool
alright you're good
well dang
well there's my good thing it wasn't a tip
yeah there you go
I have one more for you also not a tip
so I saw an article come up on
like Reddit programming and it was on Hacker News briefly today, about data scientist salaries.
And there's nothing really super crazy, interesting in here, other than I like the way that they kind of broke down the analysis for salary.
And what it is, it's a data scientist who put this together.
So they took some data from a Kaggle survey.
So already surveyed data, put a star on it.
But they sliced it up in a couple different ways.
And they looked at what they figured out to be the six most important indicators of your salary for a data scientist.
And then they ranked them.
And they talked about how those kind of ranks interplay and everything. And i just thought it was a kind of cool way of looking at the problem
and like the data first approach i thought it'd be cool to kind of talk about what those um
i thought it was six factors broke uh well we also know how you count the three so
yeah it's true so there's five. I was wrong about the five factors.
And there's nothing groundbreaking here. There's no like, you know, crazy, what you would call it.
You know, there's no like catch here. It's just kind of cool to see that, you know, country was number one.
So obviously, there's people in a high cost of living country and people in a lower cost of living country. There's a big difference in salary. And that is going to account for more than like the second part, which is your industry.
I didn't think it was interesting that that industry was in there. Um, so high, I would
have guessed that years of seniority or experience or something like that would have been like the
second most influential factor on your, uh, your salary, but actually they said industry. So if
you like work in the healthcare or oil industry or agriculture, whatever, that makes a bigger impact, apparently, on your salary than your number of years working as a data scientist anyway.
That's something to think about.
Like if you are sometimes wondering like, hey, that's weird.
It seems like other people with the same title as me are making more money.
Then it might be worth looking at Air Industry and considering
a change or a pivot there.
Third one is job title.
So that kind of maps up with experience, but not quite.
Some of the senior titles are going to get paid more than a junior, but still less influential
than industry.
And the article, by the way, goes into talking about just how much difference there is and
just some other kind of important tidbits
that are worth reading if you're interested.
Years of coding experience was next.
And then years specifically
about machine learning experience was under.
And it was interesting to see
that your years coding experience
was more of a factor
than your machine learning specific experience.
The whole thing I just thought was interesting.
It's cool analysis.
I recommend reading an article level link to it.
It's really good.
I mean,
it is broken down super like a data scientist would do it.
Like it's,
it's done super well.
If you look at country,
I mean,
it's like so far above,
it's like,
if you want to raise,
like look at moving.
Well,
what's crazy is they even break it down
further than that so they they took the country and the country was a big one right but then
they break it down by like the top yeah hundreds 123 cities yep and it's significant even from
number one to number 10 right so i mean the city that you live in could be the difference in almost
a hundred thousand dollars. So, but you also have to keep in mind, right? Like I think, uh, they
have, what was it? Santa Clara is number one. San Francisco is number two, Palo Alto, number three,
the cost of living in all those places is sky high. So if you were to go to you know a milwaukee which is number 15 on the list your your quality
of life there all things being considered if you're not talking about amazing weather and all
that kind of stuff but just how far your dollar goes at number 15 is going to be way more than
what you are at number one so you know that's all stuff that you have to weigh into which is really
hard to make in in a single chart.
Yep.
Yeah. So good point.
Yeah.
I just,
I just thought it was cool.
Yeah.
It's very cool.
Good stuff.
And cackle band.
Jeez.
So much good data there.
All right.
Well,
I guess we'll have some links then maybe like one or 50.
Depends on who's counting. Yeah. I guess we'll have some links then maybe like one or 50, um,
depends on who's counting.
Yeah.
So with that,
Hey,
you know,
we haven't had a long time or I haven't,
maybe,
maybe it's just me that hasn't said it, or maybe I have said it.
It's the tip of the week.
Yeah.
All right.
Alan's favorite portion of the show.
Uh,
so Hey,
remember our friend Carl Schweitzer,
uh, host, one of the hosts of the MS the show. So hey, remember our friend Carl Schweitzer?
One of the hosts of the MS Dev Show?
Well, he's got a new podcast called Cloud Chat.
Just started.
Easily the best thing and the most valuable item I've ever gotten from LinkedIn.
Happened to see an update there.
I was like, yes!
I'm very excited and I've written a review already for the show.
And yeah, it's a cloud podcast talking about you know all sorts of clouding and i think it's funny is that they
have an episode zero kind of introducing they have an episode one all about i'm not going to
say out loud because i don't want to get beeped again um but uh the first episode is about the a
s's of cloud computing so like paths iAS, IAS, you know, software service
S-A-A-S.
So it's kind of funny to
lay it out like that and it reads a little
funny and you get a little chuckle
to say it out loud. So go check that show out.
I know a lot of people here were big fans
of the MS Dev Show, you know, people listening to the show
and it was a great show. So you should
go check it out because I'm sure this is also going to be amazing.
Hey, and I actually told Carl
that I was going to mention it
the next time I was on the podcast.
And unfortunately, I missed the last episode.
So I'll just pile on here with Jay-Z
and be like, again, you know, go check it out.
He's an awesome dude.
And they definitely put out a quality show before.
And I have no doubt this one will be good.
Yep.
I still have my swag.
I got a hat and a mug.
That hat is beat.
That has been to the beach like 200 times.
I don't even know how many times.
That's awesome.
I got one more for you.
So another music suggestion.
I know, I know.
But it's so good.
It's another album.
This time it's from a band or person
who goes by the name of Fortet.
Been making music under that name since I looked at 1999.
New album.
And it's, if you're not familiar, it's often described as IDM, which is a, you know, a kind of controversial term.
But basically, people often refer to it as intelligent dance music, which I think I've even mentioned this on the show.
It's just kind of an awkward title.
You know, it kind of implies that other music isn't.
Anyway, that's a whole other discussion I'm not going to get into.
But it's basically slower and kind of more experimental
than music you would see at a club or something.
But it's still kind of in that electro vein.
It's got a steady beat, kind of like a hip-hop kind of beat.
And then the melodies are interesting.
They almost kind of feel random sometimes.
There's definitely a pattern there, but
sometimes it just feels like they're almost painted on with
a Photoshop brush or something.
Anyway, I just think it's really cool and it helps me get in the zone.
So I'll have a link to that, their new album.
Again, the band's name
was Fortet. F-O-U-R
T-E-T.
Like instead of
a quartet, they're a fortet?
Yeah. Yes. Exactly all right there's only one
person
that makes it
weirder
one tit yeah idm
so
man I feel like I'm
bashing on google
here so
I apologize. Maybe. So, Hey, remember the Google reader. That's all I got to
say. Four words, but you know, so just generally, I'm going to say sometimes Google lies. And what
I mean by that is what's been super, super, super, super frustrating for me working with that Cloud Function library is that in doing things with like Kubernetes cluster management stuff, but from like, you know, using an API to do it. Right. It's, it's kind of frustrating
because you issue the request and they are like, yep. Hey, here's, you know, the promise resolved
and everything. But really that doesn't necessarily mean that the thing is done.
It just means that like your request went through. So you're like, okay, I get that.
That's fair. Cause some of these requests could be long running things. Right. But, uh, then you like can get the operation, use the operation name or ID
to like query, Hey, what's the status of this thing. Right. And, and it'll tell you like in
the case of, uh, turning off auto scaling, like, yep. it off but what i noticed in experience is that
it says it's turned off the ui says it's turned off but if the next operation is like hey scale
the cluster down to zero nodes what you see and happen is if those requests happen too quick, then even though it says the cluster
is in auto-scaling is off, it'll be like, oh, well, we're scaling them down to zero,
so I need to cordon off all of these nodes.
But oh, because I'm auto-scaling, I need to spin up this number of nodes.
So you just end up moving all your pods from one set of nodes to a new set of
nodes. And it may not even be the same number of nodes because it's almost as if it's almost as if
like you were too quick in issuing the request to resize the cluster and or the node pool rather.
And so maybe word hadn't gotten around to everything, but why tell me that it's turned off then?
Why not say the operation is still in progress?
Like if it that,
so yeah,
sometimes they lie.
Boomer hour part two.
Oh yeah.
Yeah.
I guess it really should have been.
I guess I didn't have a tip of the week.
I just had boomer hour material.
Well,
it's funny you say that about the cluster thing.
So I had similar type of experiences with Dataproc.
Not quite as bad, but like the Python libraries that they had for Dataproc,
which is a Spark-type cluster.
You type things, and you can do other things with it in GCP.
But their library was sort of a callback
thing, right? Like, so there was a promise sort of thing that would be issued. And then there was
like these callbacks. And for whatever reason, the client library would just sometimes stop
taking the callbacks and then your application would be hung. And it was like, what? Like,
wait a second. If I got to rely on this thing to get a response, like it better
be pretty reliable. And so I ended up having to go to like my own long polling type thing to it,
to be able to resolve that kind of stuff, to check on the status. Cause it's like,
I mean, I want to use the SDK. The whole reason the SDK exists is to make my life easier.
But when you make my life harder now,
I've actually got to go do things my own way,
which may or may not be good.
Right.
Like,
I don't know.
Yeah.
I mean that I'm with you.
And,
and that was part of the frustration because like in the cloud functions,
you could provide a callback.
So you could just say like,
Hey,
when this is done,
you know,
let me go.
But,
but just because it calls you back doesn't
mean that the thing was actually done right so you could still get into that trouble but also plus
the function would have google will have reported in like you can see it in the logs explorer
like it'll say hey your function completed we're done then you'll see output coming back from your from your callback but the the the scary thing is is that you're not
guaranteed to have those resources still available because as far as it's going to
de-allocate it killed it right it's done yeah so so you know i just by chance happened to be
getting some things after after in that callback so i definitely like, I just by chance happened to be getting some things after, after in that callback.
So I definitely like ended up refactoring it to not rely on the callback, but also that operation thing.
Like I ended up, you know, making my own kind of like polling operation that would do like a back off strategy.
Not exponential, but what's the retry with back there's a better isn't there a
better term for it though than back off um oh that sounds like a yosemite sam like thing you'd see
like you know on something acting wheeler would you say jizzy oh yeah i think it's a exponential
back off it's always what i heard for it okay well so so yeah so i i ended
up implementing something like that um to like query the the operation status to see and but
like i said you couldn't rely that that necessary even when it would come back you would see that i
could see in the output like it's pending it's pending it's running it's running it's done
and you're like oh and you could even take,
you could go to the command line and do like a Google, I'm sorry, a gcloud container
operation describe or something like that. I forget the exact syntax. And then you could pass
in that long operation name. And it would also report back like done. But it didn't really mean
that it was done. And so, you know, the root problem that I was
trying to solve was I was trying to turn off auto scaling programmatically. And I wanted to scale
all the nodes in that node pool, I wanted to scale the node pool down to zero nodes to, you know,
basically like in a cost saving kind of effort, but you,
you couldn't do those things too fast and you couldn't rely.
I couldn't rely on the status coming back from the cloud function to let me
know,
or even the command line to let me know that,
yep,
it's actually done.
And now it's safe to,
to scale the node pull down to zero because,
you know,
somewhere out there in the,
within the process,
it still thought like, you know, there there in the within the process it still thought
like you know there was like a scheduler somewhere that was like oh hey uh guess what we're still
doing auto scaling hey just thinking out loud though so functions cloud functions you know
whether they're in google or azure whatever i think anytime that you're dealing with callbacks, you probably want to find another
way to do that, to at least make it a blocking operation, right? Because like you said,
if you're waiting on a callback, that implies that it's an asynchronous call and that it's
going to happen sometime in the future. But once you get past that line in your function and you
return out, it's like you said, Google's going to be like, hey, we're done with the function.
So, you know, just think it for anybody that's working in anything like that.
If you're dealing with callbacks, you almost want to force a sync type and a synchronous type operation in order to get that result back.
Synchronous, not asynchronous.
Not asynchronous, yes. in order to get that that result back synchronous not synchronous not asynchronous yes to use it was
almost so it was like yeah because you're like you almost want to use a synchronous and i'm like
wait a minute wait a minute let's just be clear yeah the synchronous is just is yeah yeah it's
actually not a real easy problem but It's not from their end either.
Sorry, Joe. They definitely are solving extremely hard problems,
and I'm unfairly saying that they lie.
But they do.
Maybe.
What were you saying, Jesse?
Yeah.
I was saying the thing that I don't like about asynchronous calls
is that you always end up making them synchronous it's such a pain they're like they just infect and spread like a virus throughout
your code it's like uh now everything that touches this thing's gonna be async until you
finally end up making it asynchronous you know whatever and like i get it it's totally better
than like the callback hell but it's just every time i say uh see an async i've got to work with them like all right
here we go let's see let's see where we end up today what's beautiful on tour if you start
looking at like the javascript implementations of that stuff if you see the asyncs of the a weights
it's basically secretous yeah asynchronous calls it's it's secretously making asynchronous calls and waits and call
it's like okay all right lies all the way down yeah man and then it gets really confusing because
people who don't understand it are like wait hold up and every time i look at it i gotta go read the
documentation again well and in this case the documentation is so great right yeah of course
like it's that's the name the name property sets the name thank you
did you know that the name i did oddly this is not a credit card number this is the name
revolutionary right there yeah all right so my tips one of these i borrowed from one of our
friends ryan who we've talked about before on the show, Ryan monster, he, he was trying to figure out some helm templating things and he found this helm dash playground.com
and it's actually pretty cool. I, I don't know how far it'll get you with actually trying to
make sure that things render out properly on, on everything you're doing and like a deployment
pipeline. However, if you want to see what like home templates and functions and
all that kind of stuff can do and piping different things, you can go up here to this website and
in the left hand pane, put your information like a values dot, you know, my property or whatever,
and then do a two YAML and an indent space for whatever.
And it will actually show you over on the far right.
So the middle is your value.yaml, your values.yaml.
On the right is the output of what your first template section is.
So it's a really nice way to be able to see
if you're actually creating something that should generate the proper YAML, right?
So pretty neat um however you can also
do things like this on your local with a helm uh there's a command it's a helm template something
you remember it jay-z isn't it um the helm template render helm temple debug or something
yeah something like that so that's actually a nice way to do it if
like we've talked about scaffold and all that if you're trying to see how that's all going to be
rendered out you can actually do this on the command line on your local system but this is
a nice way to do it in a ui without having to have anything installed or anything like that so
pretty cool all right and then the next one this one's going to be a little verbose. I'm going to try and not make it so incredibly boring, but I found some Java things recently that were super key.
Java is not going to be verbose. Yeah. Right. Now you've got my attention.
Well, I tried not to make it verbose. It may be impossible. So setting the background, if you've ever written a Java
application, and you've run it on a machine, chances are, you also know that you can't just
be like, hey, Java run, and then my class, because ultimately, what's going to happen is you're going
to run into memory management issues, right? Because Java is only going to take up so much
RAM that's available on the machine and all that, Like it tries to be nice. It tries to play nice with other things on the machine.
So you kind of have to tell it, yo, I need 10 gigs of Ram and I need it to do this and that
and this and that. So a lot of times what you'll see are Java run commands that have things like
XMS and XMX for managing heap space and all that. So that's all cool. Well, when you get into the
world of running in Kubernetes and containers and that type of thing, this is sort of a different
world because when you're running in a container, usually you have one thing running in that
container, right? Like one, it's a very specific thing. So your Java application that you wrote,
like, you know, the thing that's going to make you a million dollars, your million dollar Java app, it's running in that container.
That container was sized. Like when you started that container up, you said, Hey, I want it to
have four gigs of Ram and so many CPUs in that world. You kind of want whatever applications
running to just use all the resources available because that's what it was made for, right? It's not like running on a machine.
Well, and Java is a special beast on Kubernetes because technically you could have a request
and a limit that are different. So you could say initially request four gigs of RAM,
but limit it to 12 gigs. Yes. And this is where things get especially nasty
is when you do that. What he just said,
one of the things that's really frustrating is the JVM by default, if I remember right. And,
you know, somebody might actually come back and smack me down for this, but I want to say
that it'll only take 25% of the available Ram. So if you start up and it all depends on various
thresholds, how much memory is available and all that. But if you were to start up a container that had 10 gigs of Ram associated with it, and you didn't
give it any parameters in the Java run, it's only going to take two and a half gigs of Ram and
that's it. Right? So, so the rest of it's just being wasted more or less you're paying for seven
and a half gigs of Ram. That's never going to get touched. So there is a cool little flag in Java that will
allow it to take up all the resources available. And it is called, um, plus use container support.
So, you know, like when you have a dash D XMS or whatever, this is an, uh, an XX colon, uh, plus use container support. This basically tells Java, Hey,
you're the only thing here. Use everything available. That's awesome. Right? So if you
give your container 10 gigs of Ram, Java now is going to take 10 gigs of Ram for the JVM.
It's beautiful. Now, one of the things that I mentioned is you have things like XMS, which is the minimum Java heap space that you want Java to use.
And there's XMX that is the maximum heap space that Java can use.
The problem with these are you had to actually specify the hard value of it, right?
Like, hey, I want one gig in my heap or I want it max of two gigs. Well, the problem with that is if you're
resizing your container to take more Ram or whatever, well, having that hard coded value
in there kind of stinks, especially when you have deployments and all that stuff go out.
There's a couple more, uh, parameters that you can pass to the Java, to the J the JVM.
When it runs this thing, one is called initial,
initial Ram percentage. And there's another one called max Ram percentage. And they're just what
you think they are. Right? So, so you can say, Hey, I want, and these are for the heap. These
are for JVM to size the heap for you. So you can say, Hey, I want the initial heap size to be 80%
of the overall Ram available. So that's beautiful. If you had 10 you can say, Hey, I want the initial heap size to be 80% of the overall
Ram available. So that's beautiful. If you had 10 gigs assigned to the container, eight gigs of it
are going to go to the heap. Let's be more realistic. Maybe you, maybe you wanted to say,
like, you want that initial to be 40%. Yeah. So if your limit, if your limit is the 10 gig,
you're going to get four gig. Right. Right.
Right.
And then you're saying that that max would know that like,
Hey,
at the time that container might only have like,
say five gigs of actual memory being used by the Kubernetes,
you know,
by the, by the pod.
But Java would know that like,
Hey,
I'm going to, the limit is 10. I'm going to use
four and then it will play nicely in the Kubernetes ecosystem.
No. So this is where things get even a little bit more squirrely. So in Kubernetes, when you deploy
a pod, right. Or when you you define a deployment you're going to have
requests and limits right so your request is hey i want 10 gigs of ram however if for some reason
this container goes crazy we're going to let it go up to 12 gigs of ram right java doesn't play
nice with that right so the in the java world the standard, the recommendation has just been for Java apps, make the request equal the limit because it's not going to play nicely with changing that size.
Well, in this case, if you start using these use container support and all these other things, it doesn't even care about the request.
It only uses the limit.
So whatever you set the limit to.
I see what you're
saying if you say if you set your request to 10 and your limit at 12 when this container starts
up java is going to be like i want all 12 done right and so this thing automatically grows to
12 gigs of ram being used by and then you're moving on however the the big thing here and this
is this is both good and bad so a lot of of times you'll see for apps that need large heaps
and you don't want garbage collection to constantly be resizing your heap
because it can take up a lot of processing time.
A lot of times what they'll tell you is to set your min and your max to the same, right?
Sort of like the request and limit for the container.
The problem with that and this this is
sort of frustrating is when you go that route a lot of times when you try and turn on high
availability scaling in kubernetes it's based off resource utilization right well well okay go ahead
go ahead i got something i was going to add to it, but let me finish. You finish your thought first. I'm sorry. I didn't. You're good.
So,
so if you wanted to base it off memory utilization,
kind of killed it.
If you set this max Ram percentage and men Ram percentage,
the same,
because they're never going to fluctuate,
right?
Well,
even,
even regardless of this initial and max ramp percentage,
even if you didn't do that and you did set their request in
the limit equal the same, because the Java apps, because that JVM is going to grab a set amount of
memory when it starts, and it's not going to change that, which is what I was hoping this
max ramp you were saying would do, but it sounds like you're saying it doesn't do that. It's still going to only set, it's only going to grab like a set amount. Memory is actually a bad
metric to use for horizontal pod auto-scaling in this regard, because if you had, if you have an
app, the way the horizontal pod auto-scaling is going to work is going to be based off of the
average utilization of whatever that metric is. So if you spin up, let's say it
was CPU, right? And you say, hey, anytime the CPU gets over 80%, spin up a second one. So you have,
and there's like some thresholding, you know, like it'll wait for things to stabilize. And if it
stays hot that across that metric for a period of time, then it'll, it'll spin up the second
instance. So let's say that your, your, your target was 80% and the CPU stayed at 90% long enough to where the scheduler is like, Hey,
you know what? We need to go ahead and spin up another one. So it spins up that other one.
And the other one, let's say for whatever reason, it's not getting used. Right? So, uh, what did I,
what would be a good, easy number to do here? Math. So if the second one spins up and it's only running at 30%, then as far as the horizontal pod
auto-scaling is going to be concerned at the average utilization across the two pods is 60.
Cause it's going to be the 90 plus 30 divided by two. Well, if you take that same approach to the memory and you're only ever grabbing a
consistent set amount and you say, okay, if the, if you know, I'm going to grab 500 gigs of Ram
upfront, but if it ever, if I'm ever using 90% of that, you know, spin or 80% spin up my second one,
it would never, it would never do anything. Cause it would, as soon as it would hit, like
if, if you were only grabbing the 500, it's like, well, Hey, anything. Cause it would, as soon as it would hit, like,
if you were only grabbing the 500, it's like, well, Hey, guess what? You're using all 500.
I'll spin up my second instance. Now it's gonna be 500 plus 500 divided by two. Oh, average utilization is two 50. Yeah. Right. So, so memory makes for a horrible metric in the case,
especially in the case of these Java apps where you're, where, you know,
you, where it's using a fixed amount of memory. That's why I was really hoping that you were
telling me that the max ramp percentage would like, you could set like an initial of like,
Hey, grab 80% of the limit. And, and if the, you know, going back to that example,
if the limit was 10 gig and you said, uh, grab 50%. So it grabs five gig that maybe between the five gig that the JVM
grabbed and maybe say, let's just say that your operating system is super greedy. So it needed
another gig. Right. And so like, as far as Kubernetes is concerned, that pod is only using
six gigs of Ram, right? That that's what I was hoping that you were telling me and then like if it grew to 80
it could still grow that way as far as like the node is concerned there's there's an amount
requested and an amount limited up to but there's still headroom on the node you know what i'm
saying no yeah it doesn't do that so so to be perfectly clear here too though typically you mess with
the jvm heap size when you notice performance issues in your app because of garbage garbage
collection and the heap being resized all the time right so that's when you even jack with these
things you do however sort of get the benefit of what you were saying, Outlaw,
if you just use that use container support thing,
because the JVM will take the RAM available.
Yeah, but it's still based off the limit.
It's still based off the limit.
Yeah, you're not going to get any benefit out of it.
Now, the interesting thing is,
if you look at the metrics in your pods when they're running,
it will show you no i think i think that's right i think it's always going to pull that memory yeah you're
not going to win there yeah this is why like just generally as a rule of thumb like you can
use memory and cpu as your metrics for your horizontal pod auto scaling but you probably
want to come up with a more meaningful metric that your your uh your bit of code your app is going to like spit out that the
that could be queried by the the auto scaler to determine like if it's necessary because
there might be a better for whatever your specific use case is, a better determination than just based on amount of memory.
Because, you know, you might have like an app that's not CPU bound.
So, you know, if it's not CPU bound, it could be super swamped,
but, you know, never use a lot of CPU.
Yeah.
Yeah.
I mean, it's interesting.
It's good to know about this so that Java can actually fully utilize what you're giving it, right?
Like if you didn't know that Java is only going to take 25% of the available RAM, you're wasting a lot of money on something that you think is doing something that's not, right?
So this is a great setting to have, even if you don't use the the max and initial ram percentages and then there's
one other i'm sorry what one other property i want to share real quick there is also i learned
so much as i crashed so many things um there's another property called max direct memory size
so there are buffers and whatnot in the jvm especially if you're dealing with large file sizes
that can bite you because if there's not enough memory allocated to this direct memory size
then a large file can kill it right like if you're trying to read bytes out of a stream or something
like that it'll actually blow up. Well, there is,
I forget exactly how this is set. If you set the max direct memory size, then it's limited to that.
If you don't set that and you have the heap stuff set up, like you were to say the max, um, RAM
percentages, you know, 50% or whatever whatever then that direct memory size is also that same
limit as the heap so there's there's like these hidden property type things that if you set it
this way you could potentially be shooting yourself in the foot and if you don't set it
then you have to know that it's based off this other number so just know that there's a bunch
of magic stuff that's happening in here that is especially important if you're running containers so it sounds like the real advantage though to using
the the first three at least is that you don't have to specify a specific numerical value for
the memory and instead you can just control that all through your yaml for your pod definition and you're not like having
to like enter this value in or calculate this value twice to figure out what you want instead
you're just like you know especially that use container support you're like hey you know i'm
assuming i'm hoping you're going to play nicely with the os and you know leave it some overhead
but you know if i wanted to do the max percentage thing then you know i'm definitely
allowing some overhead for the uh for the opera the base operating system within the container
yep so yeah i still wish that it could play a little bit nicer in our cloud friendly world
kubernetes friendly world, for sure.
As far as I know, there is no good workaround.
They just don't use, the general guideline is try not to use RAM for auto-scaling.
Yeah, that's it for Java apps, period.
Yeah.
I mean, I'm not going to say at all, because it definitely, your mileage will vary. For Java apps, I definitely think it would be a bad choice.
Well, like Google even just recommends,
because of all the types of things we mentioned,
like Java's not the only thing that has issues with this.
It's just that in general,
there are problems with auto-scaling and memory.
CPU is still the king, unfortunately.
But that's unreliable too, though.
So like in the case of our Java app, CPU's not going to tell you anything still the king unfortunately but that's it seems like it'd be easy but it's just not yeah yeah so
like in the case of our java app cpu is not going to tell you anything because it's never really
taxing the cpu it's more it's working on a queue and so really your indicators outside of the java
app it's hey did my queue size grow past an amount that i'm comfortable with if so then maybe i need
more of these things right Right. So it's
every single app is going to have different requirements, but yeah, in some cases,
CPU nor memory are going to get you anywhere. Yeah. I mean, like I, I think of another example
that's not even related to cloud kind of world, but like every time I edit the audio for this show,
I get so mad at my computer because i have this super beefy machine and when
i run it through some of the audio tools that we that i use to do the production of it it never
like it'll be churning away but it's never like fully taxing anything not my memory not my gpu
not my cpu and i'm like, just come on.
But all the fans will kick in high gear.
I hear it.
It thinks it's doing something, and I'm just watching it.
And I'm like, all right, well, you know.
Were you mean by Google?
Because you're also lying to me.
Nothing.
I'm going to probably get a nasty letter from Google.
Hit me up at Joe at Slack.
No, what they're going to be like is,
Hey, do you want to help us make our documentation better?
That would be amazing.
And then you'd be like,
no,
I'd rather stick a pencil in my ear.
Thanks.
Hey,
it sounds like you're passionate about documentation.
No,
I meant somebody else should be.
I'm just passionate about using good documentation.
Yeah.
All right. Well, all right well all right well
talk to y'all later man no you won't talk to me later no i won't so rude not unless you check out
our show notes at um cuttingblocks.net slash episode 231 yeah 231 yeah very good question mark
yeah question one while you're at it because then your feedback questions rants to the Episode 231. Yeah, 231. 231 question mark.
Yeah, question mark. And while you're at it,
send your feedback, questions, and rants to the Slack channel.
And make sure to follow us on XU.
Yeah.
All right, now we're good.
Now that we've posted, we just like saying it.