Coding and Cooking - MPJ's Musings - Fun Fun Function
Вставка
- Опубліковано 11 вер 2024
- 💖 Support the show by becoming a Patreon
/ funfunfunction
I love cooking and I like programming, and I often feel that cooking teaches me to be better programmer. And one thing that I’ve learned recently is the value of knowing how to use a chefs knife.
🔗 Article about the Microsoft Excel team
blog.codinghor...
🔗 Worst 'Hello World' ever video
• Worst 'Hello World' ev...
🔗 Dependency injection video
• Dependency Injection b...
🔗 mpj on Twitter
/ mpjme
🔗The camera I use
amzn.to/2kwlpAD
🔗 The microphone and sound recorder I use
amzn.to/2kwli8e
amzn.to/2lcVSfd
🔗 The lights I use
amzn.to/2ld8jrX
Thanks for this episode. According to what you've said, there IS a limited space like in the kitchen, it's not the hardware though - it's our mental capacity, where we have to control and memorise an exponentially growing amount of elements when we introduce new tools/frameworks etc. to our project?
Great point that the upper limit is mental capacity!
Thanks for this show, this is my favourite programming channel.
What makes it great is your insights on programming, some are personal, which make them more convincing and more interesting.
You often show a different perspective on some problems by using "real life" analogies, which makes the topic you're talking about easier to understand.
I also really like the balance of the Musings/typical programming tutorials.
And on top of that, perfect amount of humour, which I also really appreciate, because - let's admit - typical programming tutorials can be a bit "dry", full of technical info, thus sometimes harder to follow without yawning :)
Thanks again!
Great topic! Nowadays a lot of team's/individuals forget about this problem, introducing new DIs, the increase of the cost is the price for the software maintenance, e.g. if a new member comes to the project and he meets unorthodox programming/testing approach, which is good is just in the scope of the current team and the time frame but differ from the standards and not really valuable eventually. Selecting and discussing new dependencies should be like an interview for a new employee - totally transparent and considering pros and cons.
Your knife analogy has something in common with the economics of your paper signs. Being a simple tool it can be applied to a myriad of uses, not just chopping onions. This makes it a very cost effective tool, just like your signs go to inform many many viewers (pennies per viewer.) Learning the basic skills well is never wasted time.
Also, another downside to the indiscriminate pulling in of dependencies is the multi-dependency issue. Pull in one and it pulls in a few more and before too long your banana has pulled in the gorilla and the rest of the jungle (to mix my metaphors.) The number of times I thought I was using a simple self-contained library only to find out it had pulled in yet another copy of jQuery I did not want.
"Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function." John Carmack
"the right function at the right place can make all the difference in the world" - not G-man
One of the most important costs for me is that sometimes those DIs need to be downloaded by our users. And that translates directly to money/time have to spend loading our app/site. In a lot of countries, each dependency is a huge investment for some.
Great video MPJ! Loved the analogy. Thanks a lot.
To say that this channel has changed the way I programme is an understatement. love your work ! keep up with the great work. cheers from Sri Lanka.
I feel like this is a lesson more programmers need to know! Been on plenty of projects where any third party library that did the job even a small job was accepted instantly. It's foolish to say that a project should be devoid of dependencies, but (for example) bringing one in to make a 5 line function 2 lines is over kill.
Hi MPJ, thanks for this video, very valuable for me. It makes me think about libraries and dependencies i am using in my modules. For example, i have Magento 2 module where i have dependency ob Magento\Framework (this is must have dependency for all modules) and additionally i also have dependency on Psr\Logger library where in 3 or 4 places I use 1 line of code, most important it is also same line like logger->critical() to write exception trace into a file. Most interesting part here is Magento\Framework also depends and implements interface from Psr\Logger library. Time for me to have closet look inside my dependencies. Thanks for the video.
There are a few other hidden costs
1. Performance penalty, bugs and leaks if dependency is poorly implemented.
2. Version changes compat issues
3. Inability to extend, customize and overwrite certain parts according to your need
4. Debugging is relatively hard
You're an undersubscribed genius!
As a chef changing careers into OpenStack engineering. I have to say there's a LOT of parallels between programming and cooking..The coolest is that with programming you almost have no limit to resources. You can create new resources and tools. With cooking you are limited by resources that are available & limited by the tools in the kitchen.
I completely agree. "being sceptical of depedencies" is to me the equivalent of the decades old concept of low coupling, which i feel is still underappreciated
I already miss the plant
Just made my first filet mignon this weekend. Good to see other programmers also like cooking!
aww, as a chef I chuckled at you buying a knife on Kickstarter. I just use my cheap kiwi knife everyday because it's easy on my hand and that's all that matters.
Other cost of dependecies : You either have to read the whole code or trust it.
When I read the code of a dependency, I often end up not using it.
Not because it's bad but because I rarely use 100% of the features of a library and since i read the code I now know how I could easly re-implement just the ones I need.
In case of javascript it also have a cost in the total weight of your application and our dead code elimination isn't that good in JS so some obscure features of a library might represent most of your total application, and you don't even use that part.
I think spending all your time learning how to use library to avoid recoding anything yourself is also one of the big reasons behind JS fatigue.
I recode most of my stuff and it's not a great solution either, but coding is always so much fun this way that I won't complain.
There's a really important lesson in this video for novice developers pertaining to learning the basics, rather than using dependencies because it's the easiest "solution" at that given moment.
The web is flooded with Libraries and Frameworks sucking beginners into their syntax and architecture without them understanding what's going on under the hood. Those who fall victim will ultimately learn vanilla JS by debugging, rather than starting from the base. (which is an extremely inefficient way to learn a subject's fundamentals and slows down growth)
These last episodes have been great for me. I work with ABAP(A proprietary language used in SAP ERP) and there's a lot of struggle in our community with using OOP and even more with OOP concepts. People simply don't use it even if the syntax was introduced 16 years ago in ABAP.
We also don't install "libraries" since a lot of the code is done directly on the application server, the consequence of this is we don't have a lot of open source projects and we don't have a lot of frameworks(except those provided by SAP itself) and right now i'm trying to write an IOC Container to see if it's worth it, but i'm struggling to see some use and thinking that maybe we should stick to poor man's DI in this language
I love your "I release these every Monday morning" accent.
Ah, you're so devious! Now your "Worst Hello World" video acquired a new meaning for me. I take back what I said there then.
One of the costs I had to deal with recently by using a dependency was code size, which in end turned into performance. Basically I was using a dependency which added a lot of code to my final bundle sent to the browser and a lot of it was not needed for my specific use case. I ended up rewriting the use cases I needed from the library and reduced the code a lot (I know, sometimes that's not possible, but it was in this case).
Great episode, I just completed writing a blog post last night which I'm going to be publishing next week which raises pretty close to all the exact same points as the ones raised in this video! Right down to the examples of jQuery and DI, I couldn't believe it. I'm glad to see that my mind and the mind of the great MPJ are so closely tuned :D
The Reactionary I'll just leave this comment here to get notified when you publish your blog post (please let me know when you do).
Whilst I'm glad I've piqued your interest, Mehdi, it wasn't my intent to advertising my work on someone else's channel and I'm kind of uncomfortable using this video as an alert for when my post goes live. If you get me on Twitter @reactionaryjs I can drop you a line there ;)
To add on to your point about having to get up to speed on a tool.
What if you come into the kitchen and there are tools with overlapping functionality, which do you use? What if there are multiple people in the kitchen? Some will use one of the tools while others will use others.
In the kitchen this matters less so, but in a code base, this is very much akin to not having a consistent style. When one dev is writing vanilla JS and another is using some tool etc within the same code base. It can be confusing.
As always, great video!
Your show is really excellent. It does a thing better than making me learn something: it makes me want to learn more. Thanks for sharing. Just want to throw that out there.
Hi MPJ! I have been a chef for very long time. I love cook, I like programming and enjoy your videos tremendously. I do, as you mention, approach programming and cooking the same way. One example: in the kitchen I do not use nothing other than plain ingredients to produce everything I need to assemble my final dishes. In programming I do the same, in JS, for instance, my only tools are the language itself and a database. Im ridiculously skeptical about those culinary semi-finished products the same way I am with frameworks, libs and tools. Now... how wrong is that?
Thank you very much for your videos
Dario Copia ... Shout out to another fellow chef and programmer. 🙌
Love these meta programming videos. Reminds me of your tech debt video which was also great.
+funfunfunction You might like this French cooking term: Mise en place
It's something I think about occasionally. Here's the wikipedia article link in case you want to read about it: en.wikipedia.org/wiki/Mise_en_place
Great video, really came across well to me since I love cooking too.
Damn you are good at generalizing programming ideas into everyday stuff
Moral of the story - A chef's knife is easier to keep clean than a cupboard full of gadgets.
I get what you're saying, but what do you think about this: sometimes I use an additional library and consider its complexity beneficial because it forces me to think/approach the issue in a previously-unknown-to-me systematic way. You often use these kind of libraries with faith that the author knows better about the domain issue. I feel that when you make something simple yourself it risks snowballing into something inconsistent, or you risk not doing a very good job. I guess when you know the ins and outs of a given library, you can make a deterministic decision about when to use it, at this point though, maybe this decision becomes trivial? I'm not sure.
Great! I didn't know about onion choppers or dependency injection frameworks. I would definitely try them both. I'm getting one onion chopper for white onions and another for the other kinds. I think they even have a model that comes with a free dependency injection framework Thanks for the tips! xD
I just cooked my best brekfest ever before your wideo waiting for I.T class on college
I'd disagree on the "would you spend $1000 on it" approach. The cost of a library depends on the language you use. I have a Rust library where I depend on a byteorder library: it literally consists of ~20 methods that are 5 lines long, all of them take your numeric data and read from/write to a stream in little/big endian. If that was C, or vanilla front end JS, I'd just copy/paste a code snippet, but great package management and a language with amazing library handling gave me the luxury of not caring.
I think you need a knife rack :)
absolutely loved the way you ended this vlog .And yes thanks for the great information
I love this, and as I was thinking of my own programming practices, I feel like *lodash* (lodash.com/) is an interesting case. Sometimes I'm using a lot of performance-reliant front end (or back end w/ nodejs) code that needs to pump through arrays like a hot knife through butter.
But other times... I just *feel* like I need a fast map/foreach function, and lodash is almost like a *comfort tool* - like the onion cutter. Rather than pulling in lodash, maybe a dumb implementation in a few lines with vanilla JS would be better (or the browser's default would suffice - at work we're using JScript, which is basically ECMAScript 3, so we don't have native map/reduce).
In that JScript project at work we did just that, we just created our own ArrayExtensions file, and added what we needed instead of pulling in all of lodash.
So...
Did you throw out the onion cutter ?
It looks like google didn't choose or insert anything like it usually does.
Also why would you dye your hair? :P
There's a great video on Alton Brown hating on unitaskers like that onion chopper
Alton Brown + MPJ cooking video. That would be awesome.
Finally! A good programming analogy. Well done!
Thanks for these videos, watching from Tokyo, learning Javascript is a lot of fun with funfunfunction!! How's the new place?
New hair, new apartment. I'm having troubles coping.
Absolutely 100% agree...Thank u! I tried that onion cutter... mine did not work well ;)
Good as always! Give us a tour of the new place soon! XD
What's with the music? I feel like your suddenly going to burst out crying whilst talking about adding libraries to your project lol
+Thermo Link haha, yeah, I'm still learning about music editing, takes a lot of practice. Expect dumb crap for at least a few more months. ;)
Hey Mattias, what's your take on all those micro-packages that proliferated on npm? For example: www.npmjs.com/package/negative-zero
Does this apply to dependency we add ourselves? For example, is it bad to write a helper function if I have the same few lines of code a few times? Where do you draw the line?
Great video, as always. How would you classify lodash? A lot of what's in lodash you could write yourself with just a few lines of code.
I just realized your thumbnail for this video spells COOCKING
Hi MPJ, hope the unpacking is going well! Don't suppose you would consider losing the background sound beds? They don't add much and they really get on my wick (I like to practice my guitar while I watch coding videos!)
To clarify, I just mean the sound beds in the middle, the ones at the start and end are okay, gives me a minute to tune up!
Nice new room MPJ!
you should maintain your most starred repo :)
Thanks always! I want to know your views on web assembly:)
Definitely, on the frontend the space is limited. But on the backend it's not so limited. Still, the great idea in general.
+Иван Панкратов to clarify, in not at all referring to storage or bandwidth here - I'm referring to cognitive space. As in the wealth of things a new developer would need to learn in order to work in your project.
funfunfunction yep, that's why I ended it with "great in general". I'm probably need to wrote this in a more eloquent way. Anyway, thanks for a reply, that was totally unexpected.
Great content as always! And it could be greater if the music volume didn't distract me! Please, consider testing and reducing the background music volume to < 10. I did this in some of my recent videos (you can take a look at this one, which music starts around 0:10 ua-cam.com/video/mBXRTvw58Ho/v-deo.html) after realising that it was bothering even in the video editing (and people complained, too).
Hey, may be i missed something. In this video you where talking about "dependency injection frameworks", but on the video you rely on, you where talking only about "what is, how to use" no frameworks topic where raiced... Have i missed something or i understood it wrongly ?
+Михаил Семёнов yes, i do not use them in the dep injection video. I refer to two videos, the second one is a satire where I use it as a joke.
Thanks! I really liked this analogy :)
eu sold my onion slicer after this video.
bad metaphor... slap chop can do lots, e.g nuts
:p
otherwise, great advice as usual :D
"Cupboard" is generally pronounced with a silent p.
I am Gordon Ramsay and this is my masterclass.
What is the name of the marimba song?
Great episode cheers for making this excellent content
My key though that I'll take away: I need an onion cutter in my kitchen :D
is 'cooking' intentionally misspelled in the video thumbnail?
+Joe Messerman no I just suck
Did you get your knife from the KNASA kickstarter project?
+Huck Carignan no, it's a misen
If you could forward the link to the correct method for using a knife, this cook/developer would really appreciate it :)
hey can anybody tell me which episode mpj is talking about this dragon events with different values? he is trying to access the array wit a filter function and to add all values together.
I even took a screenshot of the code but of course I forgot the episodes title. I really hope somebody can help me out here.
Maybe the reduce episode?
During the era of plant, arrow function video.
Heh, sometimes I see, that a task requires few single file of code, but it's faster to get mico library like github.com/sindresorhus/promise-fun#packages
Cool hair style!
Best Ending.
Best video ever. Thumbs up
There is no video at the end.
thanks, fixed! I keep forgetting :(
Here is an idea. Do a video on checklists. The medical industry created a surgical check list and they borrowed it from the airline industry. It was to avoid easily avoidable things.
i don't know you, i don't know how old you are, which languages you know, which ones you like, what experience you have, etc etc etc. The fact that you think this way lets me trust your coding skills
Nice knife!
Loved the vid ;D
0:50 I disagree, it's Slap Chop. enjoy ua-cam.com/video/b86SOHZ0nIA/v-deo.html
Simplicity is hard
:D good idea
That was some pretty covert click bait mate. Cheers : P
We should exchange some food recipes =)
1 like for the knife. :D
lol.... programming teaches me how to be a good cook
Your thumbnail says "coding and coocking". I know English is not your native language.
I see you wrote it correctly in the title. I feel I need to point out that "cock" is a slang word for "penis". There is certainly potential to have your video misunderstood. Also, the facial expression you have in that thumbnail doesn't help. It might be a good idea to change the thumbnail too, just to be safe.
Otherwise I enjoy your videos. You are like my Monday morning coffee!
yust!
yust do it
awesome vid as always! and yes, ill yust do it! :D
Google machine fail again :)