
love programming and I often feel like
cooking teaches me how to be a better
programmer that is what we’re going to
explore today I am mpj and you are
watching fun fun function so here I am
in our new apartment unpacking a lot of
boxes fill everything is in chaos I
believe that the sound will be a lot of
echo because none of these soundproofing
stuff is up on the roof yet as one is
unpacking a lot of stuff you you start
thinking about what stop you have around
and I I owned a chef’s knife and I also
own this it’s a it’s an onion chopper if
you put you put onions inside here you
close it and then you get go the
audience oper can do well that it can
chop onions and only that I bought this
before I bought my my knife chef’s knife
and I bought it I guess because well I
chopped a lot of onions and I wanted to
be better and more efficient at cooking
I guess but a few months after I bought
it I bought I bought this this chef’s
knife and I I bought it on Kickstarter
and like Kickstarter thing sorry it was
delayed and they are during the delay
they posted these these links to
resources where you can could learn how
to actually use a chef’s knife properly
to be honest I had I had not learned
that I had not learned how to properly
grip them and I was not I had not really
practiced using it and I I also didn’t
know how to sharpen them so I I
constantly had dull knives and that led
to me not valuing having a sharp knife
because you know I don’t nice was all I
knew so I I waited for for this knife to
arrive I learned who how to hold
properly and I learn practice cutting
onions and cutting meat and cutting me
up cutting and I learned how to keep it
knife sharp and after a while right I
found myself using my own color less and
less because even even using my old
cheap knife I ended up being pretty good
at cutting onions without this thing
when the knife arrived I did improve
some um it’s a nice knife but the big
improvement in total pain came from me
that I had actually spent some time
learning how to use the most basic and
versatile tools at a chef’s hat deep the
chef’s not a couple of weeks back I did
a video on dependency injection if you
don’t know what dependency injection is
and it doesn’t matter for this video
what’s important is that it is something
that you can do manually but there are
also tools available that does it for
you last week I did another video where
I intentionally made the most convoluted
hello world example possible basically
was a satire on how to make things
needlessly complicated I have linked
those two videos in the episode
description by the way and one of the
things I did in that video was to pull
in a dependency injection framework
because in my mind that is the only
owner chopper of of programming because
you can do
dependency injection just fine with the
programming language that you are using
without resourcing to a specialized tool
now in the kitchen you have limited
space the more gadgets and trinkets you
drag into it the more crowded things
will become and the harder it will be to
find things and work in the kitchen in a
kitchen you will run out of space
eventually and you will be naturally
forced to to do the prioritization that
okay this thing it just has a too narrow
of a use case so I should should get rid
of it
however in software development you
don’t have that natural safeguard that
the limited space in the kitchen gives
you know in software when you when you
run out of your proverbial cupboard you
can just spawn more covers you can
simply spawn infinite amounts of
cupboards until you are stuck in a maze
of cupboards with different versions of
onion cutters in them another thing that
specialized tools in the kitchen chairs
with programming is that it makes it
harder to approach the kitchen so to
speak let’s say I have a friend over for
dinner and I and they help out with the
cooking and I asked them to chop the
onions and I hand them an onion color
then they will have to learn how to use
this thing they have to spend spend a
little time getting up to speed with it
ah on the other hand if I hand them a
chef’s knife they will know how to use
that immediately so what am I saying
here should you never use an onion
cutter should you never have one if this
useless product should you never use
library should you never appoint an e
dependencies shall we called every
single thing ourselves well some things
actually do take that approach the excel
team at Microsoft actually had had this
approach they were notorious for being
extremely skeptical about dependencies I
think they even have their own compiler
I’ve linked an article about that in the
in the episode description but I think
that that is not generally applicable
advice for for most projects that would
be just crazy and that is absolutely not
what I want to say with this video but I
think that there is something to be said
and for being skeptical about adding
dependencies I think more what I’m
saying is that whenever you find
yourself in a situation we have a
problem that you can solve by pulling in
a dependency ask yourself what I pay
$1,000 for this dependency I know
doesn’t like just some figure like
imagine that the dependency has a big
cost because it does it’s so easy to
just install a library and bam you’re
problem is solved and it feels like zero
cost however you now have a dependency
that you need to keep updated other
developers will have to spend time to
learn and if rather when really it gets
abandoned you will have to replace it
and there’s probably more than those
three costs I can’t think of any right
now the comments but the point is that
dependencies have a cost than we need to
remember that in some cases it’s obvious
that it’s worth it I mean say a database
I would gladly pay a thousand dollars
not to have to implement a database that
would in almost all cases being
incredibly dumb to write yourself jQuery
back in the days when before we had like
good standardized Dom manipulation then
jQuery was really valuable and easily
worth $1,000 and it was yes just pull
that in that was amazing but for
thinking about dependencies that I think
or more gray area
I think the react is a good example of
that for some projects the virtual Dom
dipping and the component structure it’s
really really valuable and I would
really miss it and that usefully $1,000
but in
in other projects that are smaller and
doesn’t really make use of the virtual
Dom dating or the the components then
towing and react is really a kind of
deadweight in those case is just a lot
more simple to just do the rendering
straight up with just the on the script
and if we’re talking tools that I think
are really out of thin ice on this then
dependency injection frameworks are what
I definitely think is an analogue to my
to my own in cutter in the sense that
almost every case I see them use it is
so much added weight for something that
could have been solved very easily and
also more understandably with depth
playing programming vanilla programming
language if you can do something with
just a few lines of code do not pull in
a library just to say those lines of
code because the trade-off is just not
worth it yes you’re saving yourself
those those lines of code but you are
also adding in all of the hidden costs
with a dependency and you end up with a
net negative and that’s all I have to
say today spend some time becoming good
with your basic to your programming
language your chef’s knife and imagine
that every sophisticated external tool
that you pull in has a high cost because
it does you have just watched an episode
of fun fun function I release these
every Monday morning Oh 800 GMT but you
will be distracted by some hacker news
on Monday and miss it so you can
turn on notifications by clicking the
little bell next to the subscribe button
in the YouTube app if you don’t want to
wait that long you can watch this video
that Google has selected for you using
machine learning and
years of spying on your personal habits
I and npj until next Monday morning stay tuned