How To Be a Better JavaScript Developer

  Рет қаралды 20,668

Engineer Man

Engineer Man

2 жыл бұрын

There's some quick and easy ways of leveling up your JavaScript game and being a better overall JavaScript developer.
Hope you enjoyed the video!
Check out this code here:
github.com/engineer-man/youtu...
Join my Discord server and come say hi:
/ discord
Check out some code on my GitHub:
github.com/realtux
github.com/engineer-man/youtube
Send me a Gab:
gab.com/engineerman
Other Social:
/ engineerman
/ _engineerman
/ engineermanyt

Пікірлер: 61
@Dude29
@Dude29 2 жыл бұрын
I'd add a small suggestion here that I don't see mentioned very often: always use const whenever possible It's such low hanging fruit and helps to avoid mutability or name shadowing bugs. If for some reason you can't use const then, and only then, should you use let
@TomDoesTech
@TomDoesTech 2 жыл бұрын
These are some great tips! Usually these JavaScript tips videos are not that practical but I use all of these every day.
@alicefraser5799
@alicefraser5799 2 жыл бұрын
Thanks man, really useful tips even for a beginner programmer like me. Love your videos, they are a big part of my learning process. Even if sometimes your content is a little advanced for me, trying to understand what you are on about always points me in the right direction and I come out more knowledgeable every time. Keep them coming and thanks for sharing :)
@TomDoesTech
@TomDoesTech 2 жыл бұрын
As for writing modules yourself instead of using old, unmaintained libraries: you can always clone them, pubvlish them under your own namespace and maintain them yourself. I do this a fair bit. If they are single-file modules, sometimes even just copy the code and paste it straight into my project.
@dkruger9553
@dkruger9553 2 жыл бұрын
I do that too sometimes. I have a pipeline pre-built for deploying private modules so it makes it quick and easy.
@umarchy
@umarchy Жыл бұрын
Loved the video. I apply pretty much all of them at work. Thanks for sharing.
@davidmcclellan4621
@davidmcclellan4621 2 жыл бұрын
Glad to see you back making videos, man. Was wondering if something happened. Welcome back!
@EngineerMan
@EngineerMan 2 жыл бұрын
Something did happen unfortunately, check latest community post. But I'm back at it now.
@nekoill
@nekoill 2 жыл бұрын
Absolutely amazing video for a beginner JS dev, gotta recommend it to anyone who's starting out with the language
@jpaiva7934
@jpaiva7934 2 жыл бұрын
Damn, that last one is something that hits me hard, but I definitely needed to hear. Always readability > condensation. (at the end of the day for the bundler in most cases it will be the same thing)
@electronicbasics1856
@electronicbasics1856 2 жыл бұрын
That's a great video in a really long time !
@taylorallred6208
@taylorallred6208 2 жыл бұрын
All of this is good advice for any JS programmer. I would say, though, that one should never mistake code constructs they are unfamiliar with to be "clever one-liners". There are definitely one-liners that are difficult to understand, but there are also ones that are idiomatic JS and quite easy to read if you familiarize yourself with the idiom. The example here of chaining ternary operators is for-sure not idiomatic. But usage of map over for loops, for example, can be beneficial so don't discount things right away.
@invictuz4803
@invictuz4803 2 жыл бұрын
I think "clever one-liners" usually refers to using operators to reduce code, not built-in functions/APIs like map.
@noahg2
@noahg2 2 жыл бұрын
Learn how to be a better JavaScript developer with this one small trick. *Learn and use typescript*
@kankaj
@kankaj 2 жыл бұрын
I didn't know about the difference between == and === in JS. Thank you so much.
@iury0x58
@iury0x58 2 жыл бұрын
Welcome back, engineer!
@EngineerMan
@EngineerMan 2 жыл бұрын
Thank you.
@Billy-kd4jh
@Billy-kd4jh 2 жыл бұрын
I look up to u, I hope to be as knowledgeable about programming as you are one day. Thanks for the tips.
@EngineerMan
@EngineerMan 2 жыл бұрын
You will, I believe in you.
@Billy-kd4jh
@Billy-kd4jh 2 жыл бұрын
@@EngineerMan that means more than you know, thanks man!
@Ouchie
@Ouchie 2 жыл бұрын
I might be wrong here but: Isn't the one liner an If else statement while the 10 line is a switch case (which can be faster to run)?
@slimaneoulad-naoui874
@slimaneoulad-naoui874 2 жыл бұрын
Awesome! Mille thanks
@OwenGilmoreOG
@OwenGilmoreOG 2 жыл бұрын
Thanks for your great content but I miss you messing with scammers. 😆
@ZacKoch
@ZacKoch 2 жыл бұрын
Good video - some of these even apply to other langs. Thank you!
@sourandbitter3062
@sourandbitter3062 Жыл бұрын
6:03 "block" might not be the correct word. Idk it can be confusing. It releases the thread of execution until the async task is complete.
@kieudung
@kieudung 2 жыл бұрын
I really your thumbnail design
@rishabhanand4270
@rishabhanand4270 2 жыл бұрын
use eslint my dudes. it really keeps your shit in check. also write tests, which you should be doing anyway XD. I believe you can use == in one case, if (x == null), it compares x to both null or undefined. Even eslint has a special rule for it. just try and write code that won't make u vomit a week from now.
@narada6329
@narada6329 2 жыл бұрын
Epic
@abdhfhhffh
@abdhfhhffh 2 жыл бұрын
Great
@joeAnon796
@joeAnon796 2 жыл бұрын
Ugh when I see a ternary inside a ternary my head explodes. It took me a while just to understand basic ternary statements.
@danmoore3616
@danmoore3616 2 жыл бұрын
Thanks for the video
@WilliamDye-willdye
@WilliamDye-willdye 2 жыл бұрын
The one-liner form appeared often in our production code at a previous job, because it measurably improved(!) overall code readability! Reason? It left room for more context to be on the screen. Once I got used to it, the concise form didn't slow me down anymore. Decades ago we learned that code was easier to understand if it fit on a single screen (which helped justify buying larger screens). A little scrolling is OK, but comprehension speed drops rapidly whenever you have to scroll around a lot to understand a given line of code. Don't take my word for it, try it out in your shop. How much longer does it take people to find an obvious bug in code that's dense but fits on one page vs equivalent code that's spread out to multiple files and lots of lines? You'll find what we found: it's possible to write "code-golf koans" that are a pain for others to grok, but the far more common problem is code that is hard to understand because it's effectively spread out over too many pages and files.
@niallmurphy2163
@niallmurphy2163 2 жыл бұрын
There's a time and place for ternary operators. They are far more readable for assigning variables in my opinion.
@nstepsforward865
@nstepsforward865 2 жыл бұрын
great, well done!
@HadToChangeMyName_YoutubeSucks
@HadToChangeMyName_YoutubeSucks 2 жыл бұрын
I'm working with code someone wrote and instead of writing well formatted queries they've removed all hard returns, I guess to save space. Some of these queries run out 3000 characters in one line. He did this with a lot of the php and javascript too, so it was pretty undecipherable. Then to make matters worse, he put a blank line after practically every line, so you can only see half the code that you could normally see and the lines of code that are there all ran for pages lengthwise. Just making it legible took weeks.
@sourandbitter3062
@sourandbitter3062 2 жыл бұрын
Ouch. How could they even understand their own queries? They could just have used a minifier.
@HadToChangeMyName_YoutubeSucks
@HadToChangeMyName_YoutubeSucks 2 жыл бұрын
@@sourandbitter3062 -- No idea what he was thinking or how he was able to work in it. He'd been gone for years when they hired me to upgrade their servers.
@atsourno
@atsourno 2 жыл бұрын
I am the best now because of you
@ThomazMartinez
@ThomazMartinez 2 жыл бұрын
Use Prettier and ESLint
@yeahgoood
@yeahgoood 2 жыл бұрын
9:48 but if I don’t play code golf with every line how will I prove that I’m so much smarter than everyone else? Also I do not brush my teeth or hair and this is normal to me.
@thefather8362
@thefather8362 2 жыл бұрын
Nested ternaries make my skin crawl. It’s ok if code spans a few lines.
@YT-User1013
@YT-User1013 2 жыл бұрын
Careful with the using strict comparison exclusively if you are working on someone else’s app that could possibly have been written to expect a number value to be compared to a string value number like 1 == ‘1’.
@maelstrom57
@maelstrom57 2 жыл бұрын
String(a) === String(b) Just because you're following up on bad code doesn't mean you have to write bad code, too.
@YT-User1013
@YT-User1013 2 жыл бұрын
@@maelstrom57 It kind of does or it will not react as you think it would.
@m4chei
@m4chei 2 жыл бұрын
The last one is so important. Stupid future me won’t understand what smart present me is doing.
@premg062
@premg062 2 жыл бұрын
tips: - stay up-to-date on the latest version of node.js - make use of well supported npm modules (check number of downloads + last update time) - use a bundler for frontend things - use async/await, normal promises to defer - use strict equality === exclusively - don't block the event loop - avoid clever one-liners (give priority to code readability)
@theyreMineralsMarie
@theyreMineralsMarie 2 жыл бұрын
9:50 until JavaScript supports if/Else and Switch as Expressions, nested ternaries will be a necessary evil.
@AlaniNavaz
@AlaniNavaz 2 жыл бұрын
while I have my reservations about Rust, I really like this feature
@christithomas4776
@christithomas4776 2 жыл бұрын
Damn
@ZacKoch
@ZacKoch 2 жыл бұрын
Hey bro, can you help me?
@ibuprofen303
@ibuprofen303 2 жыл бұрын
Learning how to pronounce "Babel" properly also helps :D
@EngineerMan
@EngineerMan 2 жыл бұрын
Please tell me my whole life has not been a lie, is that not how it's pronounced?
@ZacKoch
@ZacKoch 2 жыл бұрын
Low quality comment @ibprofen303 - plus you're wrong. It's pronounced babble, per a Twitter thread where babel was consulted. ":D"
@ibuprofen303
@ibuprofen303 2 жыл бұрын
@@ZacKoch The difference between English pronunciation and American pronunciation, I guess.
@ZacKoch
@ZacKoch 2 жыл бұрын
@@ibuprofen303 I mean does it matter if babel themselves said how it is pronounced?
@alicefraser5799
@alicefraser5799 2 жыл бұрын
Let's call the whole thing off... kzfaq.info/get/bejne/gJifeNCBtZvIhIE.html
@MasterSergius
@MasterSergius Жыл бұрын
Please, stop, I don't want to be a JavaScript developer
@joemccay9978
@joemccay9978 2 жыл бұрын
Best way to do Javascript better is not use it.
@OnePieceWonPeace
@OnePieceWonPeace 2 жыл бұрын
Generally, good advice but he also gave some very poor advice on a few topics. (1) "I can't think of anytime you'd want to use loose equality...ALWAYS use strict". Okay, I can think of times you may want to use it. PREFER strict, but know when to take advantage of loose. (2) "clever one-liners" is a little misguided. Try to keep you code compact and minimal and, most importantly as he said, readable above all else. But for God sake, AVOID `switch` blocks. I can't believe he used that as the proper solution. Also, notice I said "avoid" not 'never'. First rule of thumb: prefer prefer, prefer avoid, avoid always, and avoid never. That is, don't be dogmatic. Anyway, having writ JavaScript for a decade and a half, I can tell this guy is still learning -- which is great. Just take what he said with a grain of salt and don't be afraid to use all the features of the language at the appropriate times.
Difficult Programming Concepts Explained
11:13
Engineer Man
Рет қаралды 68 М.
Git Good: Solo Development Use Cases
12:24
Engineer Man
Рет қаралды 29 М.
Would you like a delicious big mooncake? #shorts#Mooncake #China #Chinesefood
00:30
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 57 МЛН
КАКОЙ ВАШ ЛЮБИМЫЙ ЦВЕТ?😍 #game #shorts
00:17
Poopigirl
Рет қаралды 10 МЛН
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 451 М.
Start Using ES Modules Now
5:47
Engineer Man
Рет қаралды 24 М.
Do THIS to become a Senior JavaScript Developer
12:12
Mehul - Codedamn
Рет қаралды 173 М.
PROOF JavaScript is a Multi-Threaded language
8:21
Beyond Fireship
Рет қаралды 261 М.
How To Increase the Quality of Your Code
5:58
Engineer Man
Рет қаралды 14 М.
ChatGPT Is Not Replacing Developers Anytime Soon
14:08
Engineer Man
Рет қаралды 11 М.
Understanding Fork Bombs in 5 Minutes or Less
5:55
Engineer Man
Рет қаралды 165 М.
I Switched to VS Code and It's Kinda OK
6:28
Engineer Man
Рет қаралды 22 М.
Understanding Floating Point Struggles in 7 Minutes or Less
7:03
Engineer Man
Рет қаралды 10 М.
How To Plan a Software Project for Success
6:47
Engineer Man
Рет қаралды 23 М.
ЭТОТ ЗАБЫТЫЙ ФЛАГМАН СИЛЬНО ПОДЕШЕВЕЛ! Стоит купить...
12:54
Thebox - о технике и гаджетах
Рет қаралды 154 М.
iPhone 15 Pro vs Samsung s24🤣 #shorts
0:10
Tech Tonics
Рет қаралды 11 МЛН
Не обзор DJI Osmo Pocket 3 Creator Combo
1:00
superfirsthero
Рет қаралды 1,3 МЛН