Let's code with function composition - Fun Fun Function

  Рет қаралды 36,775

Fun Fun Function

Fun Fun Function

Күн бұрын

Пікірлер: 110
@MarkLitchfield
@MarkLitchfield 7 жыл бұрын
It was nice to see, in more glorious detail than usual, 1) the bad "habits", 2) more of a start to finish (concept, code, test) cycle, and 3) how you examine and think about the code from idea to efficient form.
@themaxsandelin
@themaxsandelin 7 жыл бұрын
"I was not being lazy, I was being time efficient" - Every programmer ever.
@Spacecat1000
@Spacecat1000 7 жыл бұрын
I've been saying that shit since I was a child. Makes me think I chose a good career...
@qwarlockz8017
@qwarlockz8017 7 жыл бұрын
My gosh I really have to say I love the fact that you are doing different types of videos. It is great that you have short clear videos that show a single idea clearly. But it is also great that we get the chance to see you put it all together and actually code. We get to see the test. We get to see the adjustments and refactoring and we get to see the wrong turns. I think we learn best by watching both styles of videos. Thanks for being flexible and giving us various tools to work with. Great job! Oh and I love the opening!
@martinharrisFTW
@martinharrisFTW 7 жыл бұрын
Hey MPJ, first time commenter long time stalker. Just wanted to say you have no idea how much we all look forward to your videos every monday, and seeing a 1hr47min upload put a huge grin on my face. Thank you for all your hard work and the risk you've taken in quitting your job for all of us. These videos bring back my motivation every time I have a bad coding day!
@funfunfunction
@funfunfunction 7 жыл бұрын
aw, that you!
@forgettd
@forgettd 7 жыл бұрын
Oh my! Your videos is my best way to procrastinate honestly
@JamesLelyveld
@JamesLelyveld 7 жыл бұрын
Hey MPJ - just wanted to chime in to say having this format occasionally is great. Watching a lot of the concepts being put into practice really clarifies things, I can understand why it's not for everyone but I definitely found it really useful.
@emanonmax
@emanonmax 7 жыл бұрын
What do you think about Meth Meth Method?
@Iminic1990
@Iminic1990 7 жыл бұрын
Have this upvote.
@DrossProwler
@DrossProwler 7 жыл бұрын
As funny as this comment seems, he's refering to an actual dude who has a channel called Meth Meth Method. That dude is also from Sweden and, by his own words, his channel is "an homage to Fun Fun Function". I was making lunch one day and the entire time I was thinking to myself, 'God damn, how did he think Meth Meth Method was a good name for a channel?'
@papawattu
@papawattu 7 жыл бұрын
Makes me think of dependencies of other sorts
@KennethJones0
@KennethJones0 7 жыл бұрын
All the video are at 2x speed
@insertoyouroemail
@insertoyouroemail 7 жыл бұрын
fun fun functor
@aladouagi1388
@aladouagi1388 7 жыл бұрын
well, I felt very happy to see the duration of the video! keep it up man!
@ancoopa
@ancoopa 7 жыл бұрын
Love the "Let's code" videos. Such a great way to share the experience. Thank you, MPJ. ^^
@driden1987
@driden1987 7 жыл бұрын
Despite you hacking this app everywhere, I see myself reflected in this video when trying to push out a product. Freaking loved it, thanks MPJ
@adamgm84
@adamgm84 7 жыл бұрын
I just dropped in to this comments stream to say/emit I internalized how .reduce() works this morning and I feel like I can now agree with MPJ when he said "I can use this for EVVVERYTHING". It's 100% next level. I highly recommend everyone studies reduce if you haven't yet. Here's a sampler: const animals = ['Garbage', 'Rodent', 'Cat', 'Dragon']; animals.reduce((all, item, index) => { all[item.toLowerCase()] = item.length; return all; },{}) // The secret is (all, item, index) and you just tack either 0, {}, or [] as the second parameter (I like how they all look like zeros). After you realize this, its basically array.prototype.forEach on steroids. Thanks MPJ. The best way to do it is to goto json-generator.com (no-spam) and generate a giant poop filled JSON object and use that for your practicing. It's a lot better than those contrived examples you see everywhere. Don't be fooled by all that crazy "summation" jazz. All it means in the context of (all, item, index) is that "all" is the number, object, or array you are adding to and "item" is the current row (aka item in the array you are stepping through). If item is an object, you can use dot notation and eat up whatever data you want.
@RonaldSuez
@RonaldSuez 7 жыл бұрын
100 k subscribers! congrats mpj!
@RobertBMenke
@RobertBMenke 7 жыл бұрын
So I vote for a follow-up episode that actually covers function composition. It's a really important topic that a lot of people either don't understand or don't follow.
@sylvestrealexandre3800
@sylvestrealexandre3800 6 жыл бұрын
this needs upvotes !
@SuperManitu1
@SuperManitu1 7 жыл бұрын
40:11 That's why I don't like Express. Semanticly you would return the error (keyword). This way you could simply remove all the else branches and replace it with a simple return res.status(200).send('carry on') at the end as some sort of fallthrough. But because that would return undefined that might actually work
@ProgramArtist
@ProgramArtist 7 жыл бұрын
1) You have made a Copy-Paste error on 1:33:28 you forgot to pass the 'assignBadge' to 'errorUnlessOK' factory method...I held my breath until the end of the video and you didn't notice it... I think it is because you call the factory methods by the names of the functions they create and it confused me and you a couple of times including this time. Maybe you should always add the 'make' prefix for factory methods. On the other hand it will make the code less readable when chaining like you do... 2) Another thing that might have helped you is some static type checking. I know you are usually against types but the error on 1:16:43 and on 1:20:03 could have easily be detected with some very basic type checks... 3) I think it would be a great video to show how to test express endpoints...I usually like to use 'supertest' to spin up the express in the tests and call bunch of endpoints and check the responses... 4) Maybe you should use express pipes when handling different request types instead of if/else or switch cases? I mean create a handler for each type in redux style and if some handler handles the request it will send() the response, otherwise it will call the next() function... 5) Verryyy long video but it showed a lot of real life code things like: - "I believe it will work...NOOOOO" - "There, I fixed it, now it will...NOOOOOO" - "Maybe I should test it now? I'm too lazy...next time" 6) If you read this line you are awesome just because you didn't give up reading haha
@ChristopherOkhravi
@ChristopherOkhravi 7 жыл бұрын
100k subs! :) Grattis :D
@jasonmathew33
@jasonmathew33 7 жыл бұрын
I almost thought you weren't going to post today! Whew!
@jakubrpawlowski
@jakubrpawlowski 7 жыл бұрын
This is your best video so far. Thank you for sharing!
@jimwilde
@jimwilde 7 жыл бұрын
Granted, this vid wasn't nearly as succinct as your previous ones, but I liked getting the chance to just watch you work, see how you think as you go. I think this is quite important as it demonstrates various topics you talk about in your other videos. In a way, I find that I'm pair programming along with you as you work, and the pace isn't too quick as it isn't edited so much. This gives me the chance to try to anticipate what you're going to do in your refactors, then see if I'm right as the video goes.
@funfunfunction
@funfunfunction 7 жыл бұрын
Thanks! This is the idea with the lets code videos. I actually try not to do them because I know that there is a sizeable chunk of the audience that REALLY don't like them, but I end up doing them sometimes anyway. I might do live streams this way instead, we'll see.
@PauloLinhares93
@PauloLinhares93 7 жыл бұрын
+1 for the livestreams!
@adamgm84
@adamgm84 7 жыл бұрын
No, keep doing them in my opinion, well and livestreams too for sure, but I would rather see you just drop a disclaimer at the beginning. I find these type of videos extremely beneficial to code along with because I can pause and complete stuff ahead of you and then see if I was right, like Jim says. I would rather see you collect a repository of these type videos than not do them because some loud individuals. I imagine it's like restaurant reviews. You don't hear from the happy people usually, but its easy to hear from unhappy people.
@andresgutgon
@andresgutgon 7 жыл бұрын
It's super funny to see someone else suffering and enjoying with code. I love it!
@manuelkoch5359
@manuelkoch5359 7 жыл бұрын
This might be a silly Question: I know the import is the new ES6 Syntax, but why do you use require sometimes and another time the import?
@emretekince
@emretekince 7 жыл бұрын
I'm using async functions without any "wrap" function. Like: router.post('/validatePurchase', async(req, res) => {})
@MrMisterkrazy
@MrMisterkrazy 7 жыл бұрын
Make sure exceptions and errors are handled the way you expect! I don't think Express will handle promise rejections as errors (or even notice that they happened) by default.
@dealloc
@dealloc 7 жыл бұрын
Discourse seems to use a similar approach to documentation as Stripe by asynchronously loading the individual articles.
@clarejang9088
@clarejang9088 7 жыл бұрын
1:33:27 Hey, MPJ, you should pass a operationName to errorUnlessOk, since errorUnlessOk is a function that returns a function, shouldn't you? 1:33:06 codes show the codes related with.
@CrapE_DM
@CrapE_DM 7 жыл бұрын
Your PostAsJSON... and errorUnlessOK functions return Promises, right? Then shouldn't you use apply() instead of then()?
@funfunfunction
@funfunfunction 7 жыл бұрын
+Jacob Zimmerman to my knowledge, the JavaScript promise does not have an .apply method.
@CrapE_DM
@CrapE_DM 7 жыл бұрын
Fun Fun Function it looked like that was what your library was using...
@robertgioeli3211
@robertgioeli3211 2 жыл бұрын
So very sad that I missed out on these wonderful video's when MPJ was still operating his channel.
@CodyLandry
@CodyLandry 7 жыл бұрын
Is there a reason you didnt' use async/await? Doesn't node 8+ support it?
@funfunfunction
@funfunfunction 7 жыл бұрын
+Cody Landry async/await breaks the nice function chain. I would have to assign intermediate variables to put the values in.
@CodyLandry
@CodyLandry 7 жыл бұрын
I guess that's true. Great video! I think you're about the only youtuber writing real code. I see so many making videos with examples that are so contrived, they're pretty much pointless. Also, thanks for keeping all the in production debugging and keeping it real.
@ipelix3733
@ipelix3733 7 жыл бұрын
What platform you use for this forum? I see many forums with this style base.
@himitsumonban
@himitsumonban 7 жыл бұрын
It's Discourse.
@okoiful
@okoiful 7 жыл бұрын
could you do another tut about func composition.. this one is messy and all over the place...
@randomizednamme
@randomizednamme 7 жыл бұрын
I'm sure you know it exists but I'm gonna mention it anyway, you know you can amend to the previous commit if you forgot something small right?
@mtheoryx83
@mtheoryx83 7 жыл бұрын
Should work nicely as an alias: alias whoops='git commit --amend --no-edit'
@live4love
@live4love 7 жыл бұрын
whats the source control client you use in the video?
@funfunfunction
@funfunfunction 7 жыл бұрын
+Jolie Kaufmann Git Tower!
@christianhg
@christianhg 7 жыл бұрын
At around 26:00 you forgot to link to the video about function composition using pipes. *keeps watching*
@jnfsmile
@jnfsmile 7 жыл бұрын
2:10 wait, so what was it?
@MrJerczu
@MrJerczu 7 жыл бұрын
Since you not reassigned values shouldn't you use const over let? You tend to use lots of lets in the places where const would be more appropriate
@funfunfunction
@funfunfunction 7 жыл бұрын
Yeah. I usually do, but I have this phase now where I use let everywhere in order to use less language constructs. I've not found the const to prevent much errors - what I would really like is proper immutability, that would probably make a significant difference.
@MrJerczu
@MrJerczu 7 жыл бұрын
Fun Fun Function fair enough... really enjoying your videos
@UocLv
@UocLv 7 жыл бұрын
You should always use const, where it makes sense. It not for bugs, it's is for code readability. Array and objects const's still can be mutated. But you can' t reassign them. I never use let in code, only in testing. You should not mutate your objects. It' s makes the code more readable and objects state predictable.
@MrJerczu
@MrJerczu 7 жыл бұрын
WuuEvil that was kinda my thought where var is not reassigned use const any reassignment constitutes let
@MarlyssonSilva
@MarlyssonSilva 7 жыл бұрын
Do you created whole fun fun forum's platform?
@PaulKamma
@PaulKamma 7 жыл бұрын
Hmm. Why don't you use the topic_id for identification instead of the topic_slug? .. I think it would be safer because now I could create also a topic called "introduce yourself" which would have the same slug..
@KenrickBeckett
@KenrickBeckett 7 жыл бұрын
I love this channel!
@ahsath
@ahsath 7 жыл бұрын
This guy is just like general Hans Landa so cool!
@adamcollier1907
@adamcollier1907 7 жыл бұрын
Good Monday evening! I was just wondering if you could shed some light on the recording equipment you used for video, considering it is much longer than usual, thanks in advance!! ʕ•ᴥ•ʔ
@funfunfunction
@funfunfunction 7 жыл бұрын
+Adam Collier See the behind the scenes video
@adamcollier1907
@adamcollier1907 7 жыл бұрын
ahh okay so you are using magic lantern to auto start recording after the time limit?
@papawattu
@papawattu 7 жыл бұрын
Good to know you also make the same mistakes I do... great video man
@SimpleKaban
@SimpleKaban 7 жыл бұрын
You can also use *npx* github.com/zkat/npx to run local npm binaries. Like _npx mocha *.test.js_ . It goes out of the box with npm v5
@matthewbarbara2916
@matthewbarbara2916 7 жыл бұрын
Good Monday very late afternoon! =)
@ericbergh
@ericbergh 7 жыл бұрын
Good monday, ehrm, morning!
@rndmreg4684
@rndmreg4684 7 жыл бұрын
That was great, thanks for sharing
@serafim2867
@serafim2867 7 жыл бұрын
Will you make some series about React || Redux ? Thanks : Ok
@KrisGesling
@KrisGesling 7 жыл бұрын
I need some new tooling to manage the video dependency injection ;)
@mrsecify
@mrsecify 7 жыл бұрын
Oh my lord, that's a gorgeous looking color scheme! Care to tell me what's it called? (:
@0xkvn
@0xkvn 7 жыл бұрын
The IP address of Zhang is visible. Not very cool that you didn't edited it :/
@funfunfunction
@funfunfunction 7 жыл бұрын
+Pet_Chop sorry I missed that. These long form videos don't allow for much scrutiny. Luckily, there is not much that can be done with an IP in isolation.
@Timooooooooooooooo
@Timooooooooooooooo 7 жыл бұрын
Fun Fun Function For future reference, you can use the KZbin video editor to blur stuff without reuploading
@TheShneek
@TheShneek 7 жыл бұрын
I liked this one.
@YoannCiabaud
@YoannCiabaud 7 жыл бұрын
The discourse API documentation uses ReDoc: github.com/Rebilly/ReDoc
@brianhogg358
@brianhogg358 7 жыл бұрын
I'm surprised you use a GIT app, rather than just the CLI. (Not a criticism, of course, just an observation)
@sheriffderek5333
@sheriffderek5333 7 жыл бұрын
Have you worked with Tower before? It's kinda hard to go back... especially when you are working on 4 projects at a time.
@funfunfunction
@funfunfunction 7 жыл бұрын
+Brian Hogg I switch between both. My main use case that doesn't show here is that I like neat commits, and staging individual lines and segments is something that Tower is much better at than the CLI.
@struggopuggo
@struggopuggo 7 жыл бұрын
Fun Fun Function have you tried git add -p?
@ProgramArtist
@ProgramArtist 7 жыл бұрын
It's not the same, try navigating and seeing more context, you can do that but it's way way way slower
@theophile_
@theophile_ 7 жыл бұрын
1:46:58 ... it's gonna be a long long coffee break today ;)
@fusedtoast5367
@fusedtoast5367 7 жыл бұрын
Badass man.
@AlphaEtOmega43
@AlphaEtOmega43 7 жыл бұрын
You should take a look at koajs web framework instead of express !
@funfunfunction
@funfunfunction 7 жыл бұрын
I've tried it but I went back to express. Partially because the ecosystem is so weak compared to express, and partially because I'm not a fan of using generators for things that aren't actual generation of values. It's cool, but in practice I find it rather convoluted.
@dertieran5738
@dertieran5738 7 жыл бұрын
Fun Fun Function As of koa v2 is based on promises, instead of generators. So somewhat like your express-wrap function. But yes express still has the bigger ecosystem.
@PeterNaydenov
@PeterNaydenov 7 жыл бұрын
KOA 2 doesn't use generators any more. Take a look.
@swarajgiri
@swarajgiri 7 жыл бұрын
Do you really need "wrap"? Try taking it out ;)
@ehza
@ehza 7 жыл бұрын
keep it up
@TheGryphon14
@TheGryphon14 7 жыл бұрын
Like first, watch later
@vpetevotov
@vpetevotov 7 жыл бұрын
Wow))
@konstantinnesterov6165
@konstantinnesterov6165 7 жыл бұрын
This may be so much better if you record a second round with the same material, have a complete solution and stick to agenda
@RineezAhmed
@RineezAhmed 7 жыл бұрын
I guess you forgot to edit the video before publishing it. You could save a lot of time for your audience if you did. I think this video could be at least 40%. shorter.
@funfunfunction
@funfunfunction 7 жыл бұрын
The lets code videos are intentionally minimally edited. It's not for everyone, and this one is on the extreme.
@adamgm84
@adamgm84 7 жыл бұрын
The extra time spent adjusting continuously is what makes videos like this great. In my experience, as long as the final product comes out functional, then everything in between is what happens to 90% of coders. If you don't like it, watch it on 2x speed. I usually watch any and every section between 1x and 2x speed. You can control your own efficiency. Traversy Media is really good at leaving his idiot errors and fixing them as he goes. It's very important to make stupid errors and reason about them. (not saying you did--but, the philosophy of it)
@adamgm84
@adamgm84 7 жыл бұрын
To clarify, leaving small anomalies and fixing them provides opportunities for people to be like "oh yea i remember when he did that". It's an extra surface port for memory formation with respect to time.
@RineezAhmed
@RineezAhmed 7 жыл бұрын
adamgm84 There are many videos from fun fun functions, that I like and have liked, but here it was just not expected quality. For example a lot of the time was spent just searching for some specific admin UIs. Finally when he found the UI there was no pause to help the "memory formation". I had to pause video go back a few times to understand where he found it actually. If he found it first attempt itself, I could still form my memory by pausing or slowing down video and at same time would save a lot of valuable data download for audience. Putting video at 1.5x or 2x would still be same amount of data download as 0.5x to load the video, correct? He can take this as a useful feedback or discard it as useless blah blah. It's entirely up to him.
@adamgm84
@adamgm84 7 жыл бұрын
Thanks for your reply Rineez. I acknowledge your argument and agree for the most part. I also appreciate smooth flowing pair programming during which I can absorb how MPJ reasons about everything from how he selects logic to how he blasts out Google searches and makes funny noises (which I also do, but I probably make more explosion and poo sounds when code blows up).
@goranudosic8420
@goranudosic8420 7 жыл бұрын
I appreciate the effort but 2h video just can't fit into my work day. Most likely will chunk it through the weekend.
@Miciozzo
@Miciozzo 7 жыл бұрын
MPJ.. honestly? most of the previous video were more effective then this even if they were 10 min video.. please go back to the right way :)
@funfunfunction
@funfunfunction 7 жыл бұрын
yah, I know the long form lets code videos that I sometimes do are not for everyone.
@howiemann7908
@howiemann7908 7 жыл бұрын
Love the long form. It's hugely beneficial to see your thinking and debugging approach. Keep up the great work
@takaqod715
@takaqod715 7 жыл бұрын
The two formats have some interesting aspects but the short one is like discovery on steroids => we can see in 10 min our brain gain volume :p
Advanced Dependency Injection without classes - Fun Fun Function
28:39
Fun Fun Function
Рет қаралды 31 М.
The Biggest Mistake Intermediate React Developers Make
18:32
Cosden Solutions
Рет қаралды 32 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
Query Parameters in Express | Real Examples & Practical Demo
10:53
Thapa Technical
Рет қаралды 534
Let's code an editor - FunFunFunction #59
1:01:42
Fun Fun Function
Рет қаралды 61 М.
Dependency Injection without classes - Fun Fun Function
22:07
Fun Fun Function
Рет қаралды 42 М.
5 deadly Rust anti-patterns to avoid
13:25
Let's Get Rusty
Рет қаралды 37 М.
Why Your Backend Shouldn't Serve Files
19:40
Boot dev
Рет қаралды 64 М.
I made maps that show time instead of space
10:44
Václav Volhejn
Рет қаралды 921 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 780 М.
Worst 'Hello World' ever - Let's code - Fun Fun Function
37:42
Fun Fun Function
Рет қаралды 44 М.
Programming Is NOT Enough | Add these 7 skills…
13:19
Travis Media
Рет қаралды 423 М.
Dependency Injection basics- Fun Fun Function
22:26
Fun Fun Function
Рет қаралды 153 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН