Actually the guy who created GIF says it's pronounced "JIF" and the sound comes from GEE the letter, not what it stands for, Graphics. This will be a never-ending argument... to-may-to, to-mah-to.. :)
This mostly depends on what you are doing right now. OOP is better for making closed complex systems and FP is better for universal multipurpose code. From my experience It's best to mix them, I believe it works very nice combined.
@@prajjwalsharma. OOP for wrappers, FP for everything else. If your functions have the same prefix, it might be a good idea to make them methods on object instead
There is always going to be a bunch of ways to solve a problem, but CERTAIN programming paradigms are better for CERTAIN problems. It's not really a gif jif thing, its more of a use the best case solution for your problem.
I agree 100% - the bigger point was that this stuff is not religious dogma. Basically every js project I've been involved in uses some combination of these paradigms.
It took me almost a hour and a half to get through this while rubber ducking the ideas and taking notes to make sure I take everything in, but it made everything super understandable. Thank you!
Thank you so friggin much. I just wanted to pick up typescript and i found your channel. Now i have a broad idea on how typescript works and i finally understood how the idea of Interfaces actually work out. Kudos! :)
1) i believe this was answered in a different video, but you can make functions private and protected in a class, correct? i don’t recall seeing that in this one. 2) how are you making it auto fill your return statement? that would be such a time saver! 3) nested classes get tricky in any language. The deepest i’ve gone and think i’d ever go is a sub class of a sub class of a class.
WallabyJS, from the same guys, also blew my mind: wallabyjs.com, it "runs your JavaScript and TypeScript tests immediately as you type, highlighting results in your IDE right next to your code."
I've only ever used OOP with languages like C++ and Python so the functional programming way of doing things was quite interesting to see. I'll have to try some F# code and make some simple stuff to try it out.
"... and if there is one thing that companies hate, is that they hate creative programming solving solutions by their programmers... " and then I read your comment below. Thank goodness.
Nice but you've got Composition vs Inheritance convoluted yourself. You're right that, they are not a choice for example a Tshirt vs Trouser where in upper body scenario you'd apply T-shirt and for lower body a trousers. But then when you go on to say that composition is another way for reusability, one could get an idea that it might be used interchangeably with inheritance which is not right. On the contrary, there might be scenarios where you'd need both. Here's an example for inheritance; Shark and Dolphin can be inherited from a base class of Fish. For composition, we can make a Fish class by composing it from a Fin and a Gill class in addition to it being inherited from Animal class.
functional programming in js is hard because map (for example) is often not enough to actually create a new object if each element is array or object as well, it simply references the old objects instead of creating new ones - works well with strings/bool/numbers that link by value. the deep copy via json.parse(json.stringify adds a lot of overhead computation that I've had to mutate state and just be careful not to reference old state
@@Limpuls What are you referring to is "imperitive" programming. OOP and procedural programming are not the same. They both are imperitive (mostly), but no, they're not the same. Just because you're writing functions doesn't mean it's a procedural or functional programming. There are certain traits specific to functional (like pure functions only, very declarative approach etc) and to the procedural (modules, procedures/functions, side-effects allowed, structure is purely imperitive). Each of us in our day to day work uses some parts of imperitive and functional programming to some degree and very few of us actually doing pure functional (Haskell etc) or pure procedural (well, pure procedural is nearly non-existent nowadays... like COBOL for example). The most commonly used nowadays is OOP imperitive programming with some functional programming on top of it to make life easier. Pure functional is VERY hard to do properly, believe me...
Ideally you use both functional and object oriented programming. Over the years, I have found function closures to work better for me than classes, as the 'this' keyword is just complete garbage in javascript. Of course this may be different for typescript but as of right now I do not have the time to refactor my thousands of lines of code to typescript, maybe something for in the future, but not for now.
1:40, I know it's meant for didactic purposes, but it was a pointless f(). 6:55, it encapsulated the logic of how it works, but it should also encapsulate the variable changing itself! If everybody can change the var, it's prone to bugs, if the project gets complex or large. 'change' should not be public too. C++ has the 'friend' keyword, which says what f()s can change everything in the class. Whenever a bug occurs, you have the list of all suspects. This is key for code safety.
You can compare procedural and functional programming, but OOP is a higher abstraction level. If you compare functional with OOP is like you'd compare a leather seat with a car. Like inside the car the seat can be leather or other type, you can write procedural or functional code inside a class.
First of all I want to thank you for your awesome work! Do you plan to release any Machine learning content any time soon? You are a great teacher and Machine learning lacks good tutorials and resources.
wow wow wow wow, this 12 minute video helped me (coming from python) understand the core ideas of javascript better than the last 2 weeks of studying did, what the hell?!
I like that you communicate the content in a language based communication, but for beginners they won’t be able to follow so easily... other than that great work and thanks for the content
This confuses me... There are design patterns and principles in OOP that try to achieve the same that functional programming achieves. # No mutations - avoid mutating objects, clone them if necessary. # Dependency Inversion - Do not resolve dependency manually and let it be injected/provided - meaning that function/method becomes pure in a sense that it only operates with what you are providing. I get more confused when in video functional programming is presented as completely different thing but it still uses objects and from quick glance it's completely indistinguishable from OOP.... So where's the difference in OOP and functional programming when in some scenarios both are the same? What are the distinguishable traits that will let me tell them apart?
It's more about the complexity to build something that is more functional in OO way of doing. The reason you need some extra steps to achieve the same goal, and it's not enforced by the language. But functional programming has the same problems, it's implemented at top level of imperative and state management, but abstracts that into the builtin modules, to you just code as mathematical as possible. The problem occurs when you don't have a module for that.
Omg I am so addicted to your videos!! Even tho I don't understand 100% of it but you explain it so well it does not matter that I dont understand it :)
The advantage of the functional cake is that when you’ve finished making the cake, you still have all the ingredients. The advantage of the OO cake is that you can digest it.
This was a great explanation. What would be cool is if you could do an update to this but use decorators instead of the mixin function. Probably a little more advance but would be a great step into using decorators
Junhai Yang traits are just glorified copy-paste in PHP - nothing more. Composition is something different, to be honest that this video failed to explain,.
No one ever seems to talk about the one drawback to composition, in that it weakens your type system and allows the language and tooling to do a lot less work for you. When possible I prefer to use as many interfaces as possible over composition.
Pretty sure a hot dog is also a sandwich with composition, because of duck testing. It still has bread and sausage, it's still unhealthy but easy to make, and you're still hungry afterwards but will eat it again next time anyway.
Procedural: Easy to understand and do. Messy result. Functional: Harder to understand and do. Neater result. OOP: Once you internalise an enormous pile of impenetrable jargon, you can start to recast procedures and functions into bizarre forms. The result is elegant, and utterly baffling to the non-specialist.
WOW!!!! Do more videos on js like patterns and please share some link regarding this topics that you discuss, where we will get deep knowledge. Thank you so much. 😊
I'm experiencing a weird feeling as I've yet to work with JS so I understand and don't understand stuff cause a lot of it is the basics of other languages I did learn and some is completely out of left field for me sometimes
Wooooowwwww...... I loved this. Thank you so much for the great content! I'm a noob programmer so I had to pause this shit like 20 times to keep up, but I prefer that to the alternative.
It's really not that complicated: A "hot dog" isn't a sandwich, it's a type of sausage. A hot dog *on a bun* is a "hotdog sandwich." The same is true for a hamburger, technically the meat itself is the hamburger which is not a sandwich by itself, but if you put it on a bun it is. The hotdog sandwich is not a subclass of sandwich - this isn't an "is a" relationship, it's a "has a" relationship. The hotdog is the topping on the the sandwich. Sandwich.topping == hotdog.
The irony here is that some of these concepts could be a bit difficult to understand at first but the one FACT in this video that still brings people to a complete standstill is, It's GIF, not JIF.
It aint easy being one of the rare programmers who likes both object-oriented and functional programming. I'm loved and hated by everybody at the same time.
I strongly believe that programs are at their peak when you combine different programming disciplines together and use their pro's and con's to your advantage. Instead of congregating at any end of the spectrum, and choosing to see the world in black & white.
what editor/extension is used where the console.log result preview is automatically updated? or is it just video editing updating the console.log preview timestamp: 5:55 - 6:00
The Stategy Pattern is just a function. The only reason it exists is because OO languages like Java didn't have first-class functions back in the day. It's not necessary in JS.
He's just hitting ctrl+z to undelete the stuff he had previously written and deleted. The emojis are either copied output, or he didn't even bother and just wrote what it should output. Solid video presentation technique.
1:52 -functional code should produce no side effects -pure functions are easier to test, and also easier to reason about Use functional programming when you want testable code that is easy to reason about. Use OOP when you want to fit in with OOP programmers.
A way to determine if a hotdog is a sandwich is to train a neural network to identify sandwiches then give it a hotdog and see what it says. It’s the only way
That an interesting subject ... And i fully in it. I find Object oriented programming esier to "imagine" as a nooby. Oriented Object seems easier for saving or exporting in Json. When Functionnal seems you have you "basics" object and you want to be able to mutate object a create new depending on what you need.
Beware anyone watching this. If you know OOP very well, this video is interesting and you can learn stuff from it I know I did, if you're discovering OOP and want to understand it, don't listen to any of this, it's missing the point of OOP. It's not about sharing functionality or code, it's about separation of concern. In cooking terms: coding is applying recipes, developing is understanding food and making recipes... This video speaks about coding! My 2 cents...
I think a good developer should learn and at least try all of these paradigms. Learning functional programming can make you a better OO programmer. Learning OO concepts will help you know when to break functional rules. Personally, I like OOP with inheritance so I can make a standard base class that my junior devs can extend, but put some enforcements in place that you'd have to go out of your way to mess them up. I could probably use some practice with composition, I can see sprinkling some mixins on a few classes.
Why do employers hate creative problem solving skills from the employees? Unless he was not over-engineering it or the final output is not benefiting the application in anyway..
I don't know if the GIF explanation was a meme or not. Why is JPEG pronounced with a P, even if Photographic is pronounced /f/. Because that's not how acronyms work. Tom Scott has made great videos on this, I suggest you watch them.
Just saying. I have seen good OOP codebases, I have not seen good funtional codebases. I am open to examples of a big project that is functional. Also, functional easy to test? Yeah, because you are testing CODE, not businesss rules. OOP is easier to test, but I must admit, everyone is doing it wrong. We teach TDD wrong. We teach it with simple classes, which makes us think we should test on the level of functions or classes. But instead, we should test modules. That would be the right level to test at. You learn this by actually writing the test FIRST
Imperative programming is not the same as object-oriented programming. Imperative programming: state is external to the code. - the code acts upon the kitchen to bake the cake Object-oriented programming: state is inside the code. - the kitchen object, which includes a oven object inside of it, uses methods to change its own state and bake a cake Functional programming: there is no state. - a cake is described.
A hot dog is, structurally, a sandwich indeed. The thing is, no one will understand you when you tell them 'pass me the sandwich on the table' referring to a hot dog.
hey! thanks, I see your videos from time to time and they are always really good. Question: what do you do to get the results of the console.log directly inside the editor?
Ironic naming when SuperHuman is a subclass of Human and Human is its superclass lol
Save me, Superclass!
I will, though I don't have a method to handle lasers.
_Gets vaporized by a laser._
@@TheVanuPhantom 😂
Not really
A SuperHuman is basically a Human who finished his studies 🤣😂
It makes sense if you think of clasess as sets.
🚨 Warning 🚨. This video makes an attempt at sarcasm in the first 60 seconds. Watch the chat replay above for the full experience
If anyone interested i found this interesting video about Object Oriented Programming and why it's bad -> ruclips.net/video/QM1iUe6IofM/видео.html
Actually the guy who created GIF says it's pronounced "JIF" and the sound comes from GEE the letter, not what it stands for, Graphics. This will be a never-ending argument... to-may-to, to-mah-to.. :)
dude do you really have to use so many emojis ? are you gen z?
@@nikhilshankar4190 why do you have a problem? We are gen Z and we love it. If it wasn't for the emojis then I might not have subscribed.
@@TheDeathMongrel yiff
I love how you talk fast enough so that I don't have to set the speed to 1.25.
Or too fast so that you'll need to set the speed to 0.75.
It is not about 'speaking fast' it is all about 'already prepared pieces of code' which create such an effect
I still have him at 1.5x
1.25x?? 2x and waiting for RUclips to let me go faster!
Gg
This mostly depends on what you are doing right now. OOP is better for making closed complex systems and FP is better for universal multipurpose code. From my experience It's best to mix them, I believe it works very nice combined.
@@prajjwalsharma. OOP for wrappers, FP for everything else. If your functions have the same prefix, it might be a good idea to make them methods on object instead
The metaphor about the sandwich and the hotdog was brilhant! You guys are Genius, I love this channel, thanks a lot for share it!
In the compositional world, it does not matter whether a hotdog is a sandwich. You can hold it and eat it like a sandwich, and that is good enough :)
There is always going to be a bunch of ways to solve a problem, but CERTAIN programming paradigms are better for CERTAIN problems. It's not really a gif jif thing, its more of a use the best case solution for your problem.
I agree 100% - the bigger point was that this stuff is not religious dogma. Basically every js project I've been involved in uses some combination of these paradigms.
@@Fireship Exactly. As for the other questions: I use pronunciation gif, and a hotdog is a taco.
I think OO pretty much solidified the backend and functional the front
That's exactly what this video said. But thanks for the summary I guess
Holy shit. That's really well-composed episode. Congrats man and goodluck in 2019!
lul, widzialem cie tez pod romanem
Or is it a well-inherited video... hmmm?
It's quite functional too, objectively speaking.
@@misterrodger I extend your opinion
This thread is in a class of its own
I like how you took something trivial like the hotdog question and wrapped it in with the theme and made it relevant.
It took me almost a hour and a half to get through this while rubber ducking the ideas and taking notes to make sure I take everything in, but it made everything super understandable. Thank you!
Can't wait until I can actually understand most of what just happened here. A few more weeks hopefully.
Are you there??
yeah, how did it went?
Thank you so friggin much. I just wanted to pick up typescript and i found your channel. Now i have a broad idea on how typescript works and i finally understood how the idea of Interfaces actually work out. Kudos! :)
*looked video's caption*: ok
*looked video's preview*: wtf about GIFs ?
1) i believe this was answered in a different video, but you can make functions private and protected in a class, correct? i don’t recall seeing that in this one.
2) how are you making it auto fill your return statement? that would be such a time saver!
3) nested classes get tricky in any language. The deepest i’ve gone and think i’d ever go is a sub class of a sub class of a class.
1. yes.
2. its edited not auto filling
What plugin is installed on your ide that's printing the blue results
It's called Quokka.js
@@SiddiqNx Thanks so much buddy!
@@SiddiqNx Thanks!
WallabyJS, from the same guys, also blew my mind: wallabyjs.com, it "runs your JavaScript and TypeScript tests immediately as you type, highlighting results in your IDE right next to your code."
And for emoji it's plugin named Emoji, it's not useful but it's kinda fun
3 years old vid that is still spot on and very informative. Thanks! 👌
just saying, if the video is accurate on day 1 why would it be less accurate after 3 years
I've only ever used OOP with languages like C++ and Python so the functional programming way of doing things was quite interesting to see. I'll have to try some F# code and make some simple stuff to try it out.
"... and if there is one thing that companies hate, is that they hate creative programming solving solutions by their programmers... " and then I read your comment below. Thank goodness.
Nice but you've got Composition vs Inheritance convoluted yourself. You're right that, they are not a choice for example a Tshirt vs Trouser where in upper body scenario you'd apply T-shirt and for lower body a trousers. But then when you go on to say that composition is another way for reusability, one could get an idea that it might be used interchangeably with inheritance which is not right. On the contrary, there might be scenarios where you'd need both.
Here's an example for inheritance; Shark and Dolphin can be inherited from a base class of Fish.
For composition, we can make a Fish class by composing it from a Fin and a Gill class in addition to it being inherited from Animal class.
functional programming in js is hard because map (for example) is often not enough to actually create a new object if each element is array or object as well, it simply references the old objects instead of creating new ones - works well with strings/bool/numbers that link by value. the deep copy via json.parse(json.stringify adds a lot of overhead computation that I've had to mutate state and just be careful not to reference old state
does deep copy via lodash methods add less computational overhead. And does it count as antipattern or bad practice to mutate state values ?
items.map(elem => ({...elem})).
Don't know about the performance though
What’s better, oop or procedural?
Answer: yes
better : the way it gets the job done
You use both. Inside you classes you write methods that does procedural stuff.
@@Limpuls What are you referring to is "imperitive" programming. OOP and procedural programming are not the same. They both are imperitive (mostly), but no, they're not the same. Just because you're writing functions doesn't mean it's a procedural or functional programming. There are certain traits specific to functional (like pure functions only, very declarative approach etc) and to the procedural (modules, procedures/functions, side-effects allowed, structure is purely imperitive). Each of us in our day to day work uses some parts of imperitive and functional programming to some degree and very few of us actually doing pure functional (Haskell etc) or pure procedural (well, pure procedural is nearly non-existent nowadays... like COBOL for example). The most commonly used nowadays is OOP imperitive programming with some functional programming on top of it to make life easier. Pure functional is VERY hard to do properly, believe me...
Procedures have side effects functions do not
functional programming is not procedural programming
Ideally you use both functional and object oriented programming.
Over the years, I have found function closures to work better for me than classes, as the 'this' keyword is just complete garbage in javascript. Of course this may be different for typescript but as of right now I do not have the time to refactor my thousands of lines of code to typescript, maybe something for in the future, but not for now.
The sarcasm at the beginning though lol.
Thank you for being so clear and easy to understand programming it’s a great series tutorials that you have I don’t watch anyone else anymore
What vscode extension for the console.log result appear on the side of the code?
And the error too apparently
Probably quokka
1:40, I know it's meant for didactic purposes, but it was a pointless f().
6:55, it encapsulated the logic of how it works, but it should also encapsulate the variable changing itself! If everybody can change the var, it's prone to bugs, if the project gets complex or large. 'change' should not be public too.
C++ has the 'friend' keyword, which says what f()s can change everything in the class. Whenever a bug occurs, you have the list of all suspects. This is key for code safety.
You can compare procedural and functional programming, but OOP is a higher abstraction level. If you compare functional with OOP is like you'd compare a leather seat with a car. Like inside the car the seat can be leather or other type, you can write procedural or functional code inside a class.
Thank you commenter from the past, that's what I was thinking but couldn't put into words.
Nice video! What VSCode extension are you using to get the console log output in the editor?? :)
You've found it yet? thanks
People debating about OOP and Functional Programming
mean while python is oop and functional
First of all I want to thank you for your awesome work! Do you plan to release any Machine learning content any time soon? You are a great teacher and Machine learning lacks good tutorials and resources.
i concur
wow wow wow wow, this 12 minute video helped me (coming from python) understand the core ideas of javascript better than the last 2 weeks of studying did, what the hell?!
I subscribed during the intro because I found the way you introduce the ideas both brilliant and funny
Extremely clear explanation, awesome job!
I like that you communicate the content in a language based communication, but for beginners they won’t be able to follow so easily... other than that great work and thanks for the content
If you're writing code and think "a class will serve well here", you're writing code the wrong way :D
This confuses me...
There are design patterns and principles in OOP that try to achieve the same that functional programming achieves.
# No mutations - avoid mutating objects, clone them if necessary.
# Dependency Inversion - Do not resolve dependency manually and let it be injected/provided - meaning that function/method becomes pure in a sense that it only operates with what you are providing.
I get more confused when in video functional programming is presented as completely different thing but it still uses objects and from quick glance it's completely indistinguishable from OOP....
So where's the difference in OOP and functional programming when in some scenarios both are the same? What are the distinguishable traits that will let me tell them apart?
It's more about the complexity to build something that is more functional in OO way of doing. The reason you need some extra steps to achieve the same goal, and it's not enforced by the language. But functional programming has the same problems, it's implemented at top level of imperative and state management, but abstracts that into the builtin modules, to you just code as mathematical as possible. The problem occurs when you don't have a module for that.
Omg I am so addicted to your videos!! Even tho I don't understand 100% of it but you explain it so well it does not matter that I dont understand it :)
I chuckled at the intro.
That's good, I was worried people would not get my dry sense of humor
What is the plugin for vscode to run console log with result ?
quokkajs.com/docs/index.html
Theres also wallaby which is less playground (snippet) based. Same creator I think.
Oh I just thought he did type it or copy paste it manually.. 😅 Awesome plugin!
The advantage of the functional cake is that when you’ve finished making the cake, you still have all the ingredients. The advantage of the OO cake is that you can digest it.
Why is this video so good 💚 and why are the answers to all of the opening questions just "both".
man your videos like fast food.. but one additional thing they are very healthy
This was a great explanation. What would be cool is if you could do an update to this but use decorators instead of the mixin function. Probably a little more advance but would be a great step into using decorators
Great vid again, what's the intro track called?
Composition is well implemented in php using trait... It's so awesome
Junhai Yang traits are just glorified copy-paste in PHP - nothing more. Composition is something different, to be honest that this video failed to explain,.
Thank you, I wish I saw this video 5 years ago.
No one ever seems to talk about the one drawback to composition, in that it weakens your type system and allows the language and tooling to do a lot less work for you. When possible I prefer to use as many interfaces as possible over composition.
Check languages like Haskell. There is a lot of composition, and the types are brilliant. Typescript really just isn't that good of a system
Pretty sure a hot dog is also a sandwich with composition, because of duck testing. It still has bread and sausage, it's still unhealthy but easy to make, and you're still hungry afterwards but will eat it again next time anyway.
Procedural: Easy to understand and do. Messy result.
Functional: Harder to understand and do. Neater result.
OOP: Once you internalise an enormous pile of impenetrable jargon, you can start to recast procedures and functions into bizarre forms. The result is elegant, and utterly baffling to the non-specialist.
will composition like this be natively available on JS or TS without that ugly boilerplate anytime soon?
Great video :D
WOW!!!! Do more videos on js like patterns and please share some link regarding this topics that you discuss, where we will get deep knowledge. Thank you so much. 😊
Hotdog is a bun in typescript mixins class implements
I'm experiencing a weird feeling as I've yet to work with JS so I understand and don't understand stuff cause a lot of it is the basics of other languages I did learn and some is completely out of left field for me sometimes
Wooooowwwww......
I loved this. Thank you so much for the great content! I'm a noob programmer so I had to pause this shit like 20 times to keep up, but I prefer that to the alternative.
It's really not that complicated: A "hot dog" isn't a sandwich, it's a type of sausage. A hot dog *on a bun* is a "hotdog sandwich." The same is true for a hamburger, technically the meat itself is the hamburger which is not a sandwich by itself, but if you put it on a bun it is. The hotdog sandwich is not a subclass of sandwich - this isn't an "is a" relationship, it's a "has a" relationship. The hotdog is the topping on the the sandwich. Sandwich.topping == hotdog.
The irony here is that some of these concepts could be a bit difficult to understand at first but the one FACT in this video that still brings people to a complete standstill is, It's GIF, not JIF.
It aint easy being one of the rare programmers who likes both object-oriented and functional programming. I'm loved and hated by everybody at the same time.
I strongly believe that programs are at their peak when you combine different programming disciplines together and use their pro's and con's to your advantage. Instead of congregating at any end of the spectrum, and choosing to see the world in black & white.
Jeff is my favourite tech youtuber!
Cool video! An interesting angle of serving this dish to the table ❤
There is no right or wrong choice, use what gets the job done.
Typescript is just beautiful. Sick explanation btw 👍🏽👍🏽
Would've been great to see the OOP examples as FP and vice versa.
Please, a video about Oriented Aspect Programming !!!
So ima give a tip:
If your making a library for
Functions make a class and add functions to it so its like:
Urlib.function()
Semicolon vs no semicolon...
What kind of question is that seriously, is this even a debate
in case you weren't being sarcastic: github.com/twbs/bootstrap/issues/3057
@@hansmeyer2 hurts me...
No semicolon
semicolon of course
@@LeeKuanYew_ what do you need a semicolon for?
Man your vids is like svg on steroids the animation is so cool
agree
Woah nice fonts and color, what editor or theme is this?
what editor/extension is used where the console.log result preview is automatically updated?
or is it just video editing updating the console.log preview
timestamp: 5:55 - 6:00
i think its best to mix them, some situations gets really messy without inheritances or idk strategy pattern
The Stategy Pattern is just a function. The only reason it exists is because OO languages like Java didn't have first-class functions back in the day. It's not necessary in JS.
What extension did you use to show the “console.log” result on the right side?
He's just hitting ctrl+z to undelete the stuff he had previously written and deleted. The emojis are either copied output, or he didn't even bother and just wrote what it should output. Solid video presentation technique.
The name of the song in the intro, someone please?
Still not sure, in which situations functional programming is more suitable than oop.
1:52
-functional code should produce no side effects
-pure functions are easier to test, and also easier to reason about
Use functional programming when you want testable code that is easy to reason about.
Use OOP when you want to fit in with OOP programmers.
This channel has exactly the type of content that I would've wished I'd seen when I become a pro in two years time. Thank you!
A way to determine if a hotdog is a sandwich is to train a neural network to identify sandwiches then give it a hotdog and see what it says. It’s the only way
hoagies
Thank you for this explanation, it helped me allot
Great video again. Thanks!
what is the name of the plugin used in the video?
Hey! My prettier throws away semicolons. I hate that because I switch between java and javascript programming. Am I using the wrong prettier?
That an interesting subject ... And i fully in it. I find Object oriented programming esier to "imagine" as a nooby. Oriented Object seems easier for saving or exporting in Json. When Functionnal seems you have you "basics" object and you want to be able to mutate object a create new depending on what you need.
Beware anyone watching this. If you know OOP very well, this video is interesting and you can learn stuff from it I know I did, if you're discovering OOP and want to understand it, don't listen to any of this, it's missing the point of OOP. It's not about sharing functionality or code, it's about separation of concern. In cooking terms: coding is applying recipes, developing is understanding food and making recipes... This video speaks about coding! My 2 cents...
Yeah, the code within your OO program can be either imperative or functional. OO is more about separation of concern and modularity by abstraction.
I think a good developer should learn and at least try all of these paradigms. Learning functional programming can make you a better OO programmer. Learning OO concepts will help you know when to break functional rules.
Personally, I like OOP with inheritance so I can make a standard base class that my junior devs can extend, but put some enforcements in place that you'd have to go out of your way to mess them up. I could probably use some practice with composition, I can see sprinkling some mixins on a few classes.
I thought I learn about OOP and Functional, but I instead I learn that Hotdog is and is not a sandwich
Just so you know, a hotdog is a taco.
Why do employers hate creative problem solving skills from the employees? Unless he was not over-engineering it or the final output is not benefiting the application in anyway..
What are the pre-requisite for OOPs?
I don't know if the GIF explanation was a meme or not. Why is JPEG pronounced with a P, even if Photographic is pronounced /f/. Because that's not how acronyms work.
Tom Scott has made great videos on this, I suggest you watch them.
Very cool vid! May I know what font are you using in your editor? '=>' looks cool haha
fira code
Is being able to see the console.log output in the IDE window clever editing or a great plugin?
Quokka
What's the background song in the beginning called?
Just saying. I have seen good OOP codebases, I have not seen good funtional codebases. I am open to examples of a big project that is functional.
Also, functional easy to test? Yeah, because you are testing CODE, not businesss rules.
OOP is easier to test, but I must admit, everyone is doing it wrong. We teach TDD wrong. We teach it with simple classes, which makes us think we should test on the level of functions or classes. But instead, we should test modules. That would be the right level to test at. You learn this by actually writing the test FIRST
Imperative programming is not the same as object-oriented programming.
Imperative programming: state is external to the code.
- the code acts upon the kitchen to bake the cake
Object-oriented programming: state is inside the code.
- the kitchen object, which includes a oven object inside of it, uses methods to change its own state and bake a cake
Functional programming: there is no state.
- a cake is described.
I think I will functional program a hot dog today.
Hi how do you show the result of console log on the same line in your ide you use?
A hot dog is, structurally, a sandwich indeed. The thing is, no one will understand you when you tell them 'pass me the sandwich on the table' referring to a hot dog.
a hot dog is a hot dog.
hotdog === sandwich... So you can combine programming and humor at the same time
the best is everything can do everything
Thanks sir!
So the last part is basically typeclass in Haskell/ traits in Rust/ interfaces in Java?
Hey! Can anyone tell me what VSCODE extension he uses for getting the result in previews?
Not sure if you've got your answer but here it is: quokkajs.com/
hey! thanks, I see your videos from time to time and they are always really good. Question: what do you do to get the results of the console.log directly inside the editor?
Console.log ?
Looks like quokkajs.com/ to me :) I'm also using that frequently to test stuff out
@@felixrichnau Console.log ?
same question, it doesn't show in the editor like the video
goto 11:15 - it's not clear what you are trying to show because of extra graphics