To use the right tools (whether it’s a library, a language, a design pattern, a type of loop…) is something really important. If you’ve been into programming for a while, I’m not learning you anything! If you’re new to this, here is a really cool example I found in this Google video.
Golf club and bowling ball
I was watching a video on the Google Developers’ YouTube Channel, and totally loved this image. The instructor was talking about how IMAP (Internet Message Access Protocol) isn’t always used for what it was intended for. Well, it was created twenty years ago, so of course, they couldn’t predict that emails were going to be what they are right now.
Anyways, back to our topic. You can probably, with a bit of practice, hit a couple of pins by swinging your golf club and hitting the bowling ball. But between you and me, it’ll be a lot easier to simply throw/roll the ball directly on the alley. But this is not what it was intended for, hence there are a lot of reasons why it wouldn’t be the best solution. You might…
- damage the club/bowl/alley
- be disqualified from a tournament (pretty sure there’s a rule that states that you must roll the ball)
- may hurt someone standing by, as they are not expecting you to swing a golf club
As I said, it may allow you to knock the pins down. But it will require more efforts than using the “actual” way, and might cause the “side effects” listed above.
ReactJS and jQuery: use the right tools for your poject
I’m currently following the freeCodeCamp curriculum and love it. I’m also working on other projects on the side, and I often find myself realizing that for these, I’m using material covered in later certifications which is great! (It’s awesome to know that you know that you’re “ahead” 😉 Here’s what happened:
- I learned about APIs while learning about jQuery in FCC, and had to build a project using it
- At work, I wrote a script and had to deal with asynchronous functions
- Realized that I could reinvest the callback notion I learned on FCC! (Still wasn’t done with the FCC project)
- Learned ReactJS because my boss challenged me to (“What doesn’t challenge you doesn’t change you!)
- (Still haven’t finished the FCC project)
- Went back to FCC, thinking about ReactJS
I should have gone either all the way with jQuery, or all the way with ReactJS. Not both. But as this certification was about jQuery, I should have gone with it, period. I didn’t use the right tools.
Don’t try to mix the way a library works with another library that doesn’t work the same way. I’m all about “smashing” different libraries and not sticking to what everybody does. But sometimes, simplicity is the right path. Don’t try to hack it by using tools for what they were not intended to. It might not give you a good result.
Until then, looks like I have a project to finish!