1 Tip to Improve Programming skills in 2020

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey everyone welcome to my channel in this video i will share with you one tip one tip that will make you a better programmer instantly it instantly really seems like a lie oh it's a clickbait oh okay so let's get started so the one question that i have been asked quite a lot over facebook instagram youtube even tic toc actually nobody cares about tick tock so the question that i've been asked is how do you go from beginner to an intermediate or an expert stage so you have understood the basics of programming so you went through the if statements the while loops the for loops the operators the functions the object oriented programming whatever the basics are you have covered them now what what do i do next so the answer is very simple and everybody pretty much knows it already and that is projects so you start with creating projects that you get excited about so uh one example would be my uh opencv tutorial in which i have half of the tutorial based on basics and the other half is just for projects so i have created three projects that actually help you understand and implement the basics you have learned and this is important because you have to dive in right away to the projects so you don't really get tired of the programming language and you don't really lose the will to actually go through with the programming language so i have done the basics i am doing the projects what's next how do i get better at programming so the idea is that whenever you are creating projects the projects are basically derivatives of other projects so there is literally no project that is completely entirely new so what you are doing is you are replicating projects you are taking pieces of different projects and you are putting them together right so what do you have to do to get better at building these projects in two folds one is how do you increase the speed at which you program and second is how do you actually write better code more efficient code so the answer to both of these questions is modular functions and this is the tip that i was referring to so we all know that functions basically they are snippet of code that perform a certain task so let's say that task um let's let's take an example of a fish game so i have a game where i have to spawn a lot of fishes so there's an aquarium and inside that aquarium i have to bring up these fishes but of course i will put them in different places that's called spawning right so what i will do is i will create a function that will create these fishes and it will randomly generate some positions for these fishes right so i can create this function very easily all i have to do is i will input the object which is the fish object and i will tell for example i need 100 fishes i need 50 fishes i need 20 fishes and that's it that's very simple so what i need to do now is if i have done this part which is basically spawning objects i should be take i should be able to take this part and replicate that in another project uh let's say i'm creating a city in which i have lots of cars right now i want to generate a random city or random locations of cars every time so i can use that same fish function in my car project and instead of the fish i will give the object as the car so i will say that okay now i want the car to be spawned in different locations within our city so this way not only you will be able to increase this time you have to spend coding but you will also increase to your efficiency and i will tell you how that is but before i tell you that one thing to note is that when you are writing modular functions you have to name your variables in a modular way so for example if you are creating that fish game you don't say fish object okay you will just say spawn object or a my object something like this so that even if you are using it in another project it should not be something very specific it should be something generic so that it is easy to read even in another project right so that is the basic concept so this can tell you this can give you the idea of how this will speed up your process of creating different projects but how does it increase efficiency how does it increase uh or how does it make you a better coder over time right so the answer is very simple once you create a let's say a function later on you will learn new techniques for example you have learned four state uh for loops right now when you are learning better techniques you might come across list comprehensions now list comprehensions are like for loops but in one line they are a little more easier to read now what you can do is once you have that function stored already again you don't store a function or whatever code you have you don't store it on your hard disk stop living in 1980s okay store your code all of it online put it on the cloud doesn't matter where you put it github kit lab kit wherever you put it just put it somewhere online so that you can retrieve it easily okay that being said coming back what we have to do is you have to take that code and for example i have learned a new technique of list comprehension so what i will do is now that i have understood that technique i will change my previous function i will enhance it enhance it a little bit more this time with i will change the for loop to list comprehension this way i will keep up to date all of my codes online and i will have an archive all of all my functions that i can use anytime i want right so this makes it very easy for you to actually use these functions it doesn't matter which type of programming language you are using or which type of developer you are whether you are using web development whether you are creating an app for delivery system for dating system maybe you are trying to fill that hole in your heart with that dating system i i don't know maybe you are doing that whatever you are doing there is a way that you can do it better right and that better way is modeler functions so if you keep those snippets of code archived in your github or gitlab or wherever you have stored them then at any given instance you can take those code and you can put it you can take that function and that you can put it in your new project and this will allow you to create projects very fast and you might have seen my projects what i have done in the previous few months and i have been using this technique and i have been able to create a lot of projects with a small amount of time and a lot of you have been asking how do you actually do that and this is one of my secrets that i have this library i'm not sharing it publicly but i have this library and i have this uh archive of functions where i just grab them and paste it and i write the code and it helps me tremendously to create new projects very very efficiently and fast and this technique is not just applied in software it's even applied in hardware and a lot of big companies are using this technique let me give you an example i have here a drill machine now this drill is by drill machine is by black and decker now what they did was very smart now this drill machine basically has some drill bits that you can have you can replace and you can add and it also has a very modular part which is the battery now what they did was they created a system by the name 20 volts and they created another system by the name 40 volts so they have these two modular batteries that you can take any of their tools whether it's a drill machine or it's a saw whatever it is you can take that and you can just plug in the battery whatever tools you have so what they did was they designed it once and now they are using it again and again in different projects and that is what modularity is all about so whenever you are creating a new project think of modularity think of how i can make a code okay how i can make a function that could be used elsewhere as well right so this is a brilliant idea because not only the consumer is benefiting but the manufacturer is benefiting as well because they don't have to produce many different designs and many different ideas they can just produce these lithium batteries uh one one single type and they are good to go and even for the consumer it's very easy to go and use this as this will be the same type and the charger will be same as well so i don't have to go and buy a bunch of batteries and a bunch of charger just to use the use some tools when i'm working right so that is the idea behind modularity and this is a very good and strong idea that you have to understand when you are writing a new project so to conclude first of all don't make that dating app it's it's not worth it just stop okay don't try to fill that void second you have to make modular functions no matter what you do just think ahead don't just think of right now think of what you will be doing with this later on as well because every piece of code could be applied in a different project as well okay so that is the second step third step archive your projects archive your functions put them online don't put it on a hard disk for the love of god don't put it on a hard disk this is not 1980s or 1970s everything is on cloud so put your code up upstairs please so this is it for today's video i hope you have learned something new make sure you create these functions and maybe put it on the comments share your links maybe i will create a very big archive where all of you have given your different functions and i will put them all in one place so other people can benefit as well think of the community just don't think of a single project right so that is it for today's video i hope you have learned something new uh if you like the video give it a thumbs up if you would like to see more of these tips again give it a thumbs up if you don't like it it's okay give it dislike it doesn't matter it's your choice and do subscribe and hit the notification bell and i will see you in the next video bye bye
Info
Channel: Murtaza's Workshop - Robotics and AI
Views: 9,191
Rating: 4.969543 out of 5
Keywords: coding skills, better at coding, how to code, learn to code, learn programming
Id: t1Enxd1lfr4
Channel Id: undefined
Length: 11min 35sec (695 seconds)
Published: Sun Sep 06 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.