Super needed video. Not enough emphasis on this topic. I have really started paying attention to my code quality. Not always easy when your under pressure, but I always do my best to keep my code as clean as possible. Appreciate you and your content. See you soon!
let [a,b,c] = [1,2,3] is much less readable than declaring them one below another. If you have more variables it is harder to tell which value belongs to which variable.
In the “Don’t Use Flags” example, you lose the automated process of creating the file based on its type. How would replicate that without using a switch statement?
You are correct. The point is that a function should only do one thing. The function is to save a file. So we separate those functions to save each type of file. But you are also correct that we loose the ability to then automate the type save. I probably should have added another function that decides which type to save. So instead of a single function that does too much, we end up with 4 functions that are clean and can then be reused if needed.
This functionality is not best solved this way. The function could remain dyadic, having 2 args, and then the type would be inserted into the path. Then you just need one option that handles all types including future types not yet required. Where ever name and type came from, it could be a class instance which owns the properties "name" and "type". Then the function could be a method of that class which would have access to those props without the args.
You can create those clean and reusable functions the OP suggested and then create an object which will be a mapping of image type to the function that saves it. You won’t even need a function that saves based on type
In this example, no. You would use ?? when you may have a falsey value like 0 that should be used instead of the default value. In this case, we are only worried about null or undefined. But it's good that you even know about ?? 😃
Good day, Thanks for the tips on how we make clean our codes after I finished that video I re write my To-Do List app next week to make it clean and clearly to some other reader codes. it's a little bit hard to catch up like deconsturcting, because I'm new in Web development. I'm done with HTML CSS then now I'm in JS. it's just a month ago when i started to learn a web development. Because I can't imagine that programming is needed when you get the job in IT Security with Secure Coding but not to use some tools like we download in the internet. I'm Cyber Security Analyst / Web Penetration Tester for 2 years but I don't know how to program. because I'm a tool user. and I can happy in 50%. Why 50%? because I secure or penetrate the system using Kali Linux and other some tools. like i can forensics some files etc.. You know it's hard to jump in advanced but now I realized its hard to find a job in IT Security or IT Industry that you didn't know how to program. because that programming is the 1st bullet if we want to become an IT. sorry for telling my long story that jump in advanced to basic because in tools we don't use logic a little bit only its kind a pattern only like how you use the tool. so that's why I jump into my favorite side which is mastering cmd/terminal and Kali Linux. so my question is.. how you get a HTML DOM in JS file. is it const shopList=document.getElementByID("div1"); or this const shopList=document.getElementByID(".div1"); => with dot sign? is same with CSS. do we really do that in same with CSS? or not? because its a JS file. don't make me wrong about the error. I need advice from you on how you write your code clean to clearly understand some code readers while we read your codes. lastly. how you write your for loop functions in JS? did you really put the semicolon after the loop begins like beside the curly brackets? Thank you in advance sir @Jesse
I tried your example with Optional chaining, but the code stops, saying the first thing isn't defined. code: const something = apple?.sauce?.test; console: Uncaught ReferenceError: apple is not defined; Is there a basic part to this I'm not understanding?
At 3:10 why you used const for the variable, you just said that if in the future you want this variable to be changed to 30$, but you can't reassing a new value to a const
🦸 Become A VS Code SuperHero Today: vsCodeHero.com
🧑🏾🤝🧑🏽 Join my Discord developer community: discord.gg/A9CnsVzzkZ
I really do enjoy this writing clean code series.. They help a lot to correct my bad habits from time to time.
Super needed video. Not enough emphasis on this topic. I have really started paying attention to my code quality. Not always easy when your under pressure, but I always do my best to keep my code as clean as possible. Appreciate you and your content. See you soon!
Props for mentioning James Q Quicks Quokka video. Also a good video. 🙌
The glitch effect is awesome.
this is why i love coding.
So much awesome in one video!!! Thanks for sharing.
Thanks a lot for all these tips, the majority of them are very useful to me :)
Simplicity is the ultimate sophistication. Thanks man.
Great video, i have learned so much from this video
Glad it was helpful!
let [a,b,c] = [1,2,3] is much less readable than declaring them one below another. If you have more variables it is harder to tell which value belongs to which variable.
Now I can flex how cool Javascript is! Kidding tho this video has surely very interesting stuff that really does help while writing large application.
Just found your channel, this video is great. Thanks for sharing. These are some awesome examples.
Great refresher
In the “Don’t Use Flags” example, you lose the automated process of creating the file based on its type. How would replicate that without using a switch statement?
You are correct. The point is that a function should only do one thing. The function is to save a file. So we separate those functions to save each type of file. But you are also correct that we loose the ability to then automate the type save. I probably should have added another function that decides which type to save. So instead of a single function that does too much, we end up with 4 functions that are clean and can then be reused if needed.
This functionality is not best solved this way. The function could remain dyadic, having 2 args, and then the type would be inserted into the path. Then you just need one option that handles all types including future types not yet required.
Where ever name and type came from, it could be a class instance which owns the properties "name" and "type". Then the function could be a method of that class which would have access to those props without the args.
You can create those clean and reusable functions the OP suggested and then create an object which will be a mapping of image type to the function that saves it. You won’t even need a function that saves based on type
SOLID tips, Very much appreciated. Thanks!
So useful tips
Thanks from Saudi Arabia
Super thankyou, this is real PRO TIPS
This code theme for vscode is awesome! bomb tips!
Straight to the point, valuable tips. Love it
Really quick, thanks for your videos. They help me out
No problem!
Awesome tricks thank you so much for this knowledge sharing to us keep posting more videos like this 🙂👌🏼👌🏼👌🏼👌🏼
Nice Video @jesse!! What editing Video softwares used here! Just curious... !
Davinci Resolve :)
Small things that mean a lot ! Great work buddy 👏
How good you are 😁👍🏽👍🏽, i also interested in Vscode how it looks.
Thank you so much i learned a lot of new things and applied it to my work!!!
Cool video. Thank you for sharing. What makes your cursor pulse like that? That's pretty cool. I would like to add that to my workflow. 🙌😀
It's just cursor settings in VS Code.
Nice to see that many of the practices at my work are reflected here. Of course typescript helps a lot too.
So grateful! 🙏THANK YOU, SIR! 🙂
You are very welcome
Really good. It's always nice to know how to write proper and cleaner code
Simple and very effective thanks a lot :)
You're welcome!
Awesome man
Thanks!
I wanted to give you a thumbs up at 5 seconds just for the video quality 😁
EDIT: I had to wait to the end of the video to finally like it
I got really stuck on his pronunciation of quokka. 😆 That said, the video is seriously good stuff.
I remember last year I couldn’t wrap my head around many things in this video like function parameters, destructuring, and many other things.
Please do part 2 👌🏼
Thanks for this video, mate. 🙏 😊
Sure thing!
Default value part also can change code to “let colorScheme=getColorScheme() ?? ‘Dark’ ”
great video thank you!
Glad it helped!
¡Gracias!
Thank you!
Awesome
Do async projects and CSS tricks please codestack
You using theme vscode ? It is beautiful. I want custom theme same you
Thanks! It's my codeSTACKr vs code theme. Link in description :)
All great examples, except for the last one that just reduces readability for typing less characters
Thanks, very insightful
Very welcome
Insightful video, thanks a lot sir.
Please can you share your VsCode theme ?
It's my codeSTACKr theme. The link is in the description.
thank you so much
You're welcome!
Were you and WebDevSimplified made by the same voice machine?
Great one
22:03 would here the nullish coalescing operator (??) not be better?
In this example, no. You would use ?? when you may have a falsey value like 0 that should be used instead of the default value. In this case, we are only worried about null or undefined. But it's good that you even know about ?? 😃
Good day,
Thanks for the tips on how we make clean our codes after I finished that video I re write my To-Do List app next week to make it clean and clearly to some other reader codes. it's a little bit hard to catch up like deconsturcting, because I'm new in Web development. I'm done with HTML CSS then now I'm in JS. it's just a month ago when i started to learn a web development. Because I can't imagine that programming is needed when you get the job in IT Security with Secure Coding but not to use some tools like we download in the internet. I'm Cyber Security Analyst / Web Penetration Tester for 2 years but I don't know how to program. because I'm a tool user. and I can happy in 50%. Why 50%? because I secure or penetrate the system using Kali Linux and other some tools. like i can forensics some files etc.. You know it's hard to jump in advanced but now I realized its hard to find a job in IT Security or IT Industry that you didn't know how to program. because that programming is the 1st bullet if we want to become an IT.
sorry for telling my long story that jump in advanced to basic because in tools we don't use logic a little bit only its kind a pattern only like how you use the tool. so that's why I jump into my favorite side which is mastering cmd/terminal and Kali Linux.
so my question is.. how you get a HTML DOM in JS file.
is it const shopList=document.getElementByID("div1");
or
this
const shopList=document.getElementByID(".div1"); => with dot sign? is same with CSS.
do we really do that in same with CSS? or not? because its a JS file.
don't make me wrong about the error. I need advice from you on how you write your code clean to clearly understand some code readers while we read your codes.
lastly. how you write your for loop functions in JS?
did you really put the semicolon after the loop begins like beside the curly brackets?
Thank you in advance sir @Jesse
Thanks!!
You bet!
This is the best! Thank you for this. L+S.
Glad you liked it!
This video is so FUCKING good.
last one amazing ajshdajshd
I tried your example with Optional chaining, but the code stops, saying the first thing isn't defined.
code: const something = apple?.sauce?.test;
console: Uncaught ReferenceError: apple is not defined;
Is there a basic part to this I'm not understanding?
This only works in latest versions of ECMAScript.
At 3:10 why you used const for the variable, you just said that if in the future you want this variable to be changed to 30$, but you can't reassing a new value to a const
If it needs to be changed globally you would update the const, not reassign it. That way there is only one spot to update it.
@@codeSTACKr okay, i just started learning js ..
What the VSCode theme name is?
amazing
Thanks
❤️
The variable names in the fourth section are lke me.
superb. thank you so much for the tutorial.
You are welcome 😊
guys, is it really clean code or just fast coding?
Your ex with save images... it better create a object with keys like jpeg and so on..
Aula sensacional 😃
which theme are you using??
My codeSTACKr theme. Link in description.
@@codeSTACKr Thanks there :)
Yo that's my last name lol
This cursor is annoying. And selection background makes the text hard to read.
if(isAdmin) {}
if (!isAdmin) {}......????
Why not if(!isAdmin){}else{}
So, I have been writing shit...?👀
😂
First two tips: shorter is NOT better.
I stopped watching after that.
Rule number 1: simplicity and easy readable