I have been programming since last 17
years and based on that experience I am
going to share with you seven effective
tips that you can use to make your code
development faster. When you're writing
code usually you write few lines of code
run it see if it works okay. Usually
things don't work okay on first attempt
correct? So you fix the bug you again run
it. Then you write new code again run it.
It's a set of iterations that you go
throughout the day. So if you
learn how to reduce the time it takes
for individual iteration or if you can
reduce number of iterations then it's
gonna be super helpful. Number one is
productivity setup and that includes
hardware and software both. I have this
dual screen system where in one screen I
will be writing my code in the other one
I will see the output. I will execute my
screen and see what happens. I will have
my browser open and so on having these
two big screen is very very helpful. I
also have a very convenient keyboard
that can help as well of course your
system needs to have good memory ssd. It
should be a powerful system so that
whenever you are running your core it
executes
really fast- good internet speed
obviously. So having a good hardware
setup is number one thing number two is
software tools.
There are AI powered
tools which helps you write code and we
are going to look into these two tools
are github co-pilot and kite.
Github copilot is an amazing AI based
productivity tool which can convert
comments into a functioning code. Let me
just demo it. So when I replay here you
wrote this comment
whether the sentiment of text is
positive or not and it actually
wrote the code for you. You will find
many such examples such as if you want
to find average run time of successful
runs in seconds.
when you write this command and when you
write this function name, rest of it, it
will auto complete. And it is doing this
based on the AI engine that they have
built on
millions of lines of code on github.
You can see other examples as well.
Such as for example this and let's say
you're writing markers for different
languages- Javascript, Python and so on.
When you type these two line it will
automatically know that you might
include more languages and it will write
after two lines the remaining lines are
returned by github co-pilot.
You can also write function name it will
detect your intention and it will give
you different suggestions because same
function can be written in multiple ways.
When you click on next see it will
give you different suggestion on writing
same function and these are valid
function it will function fine when you
say accept it. Will
put that code into your IDE
the tool is recently released so you
need to join the
waiting list basically. So click on sign
up join their waiting list but at some
point in future it will be available for
all.
Kite is another productivity tool
similar to Github pilot where when you
type writing code for example. As you can
see here
if you are going through all the files
in a directory in python it will try to
identify your intent and it will do auto
completion of code on your behalf.
This is AI powered tool which works
really well. I personally use it and it
increases your productivity. It gets
integrated really well with Pycharm vs
code.
Majority of the editors
you can download it for free from
kite.com website and start using it in
your IDE. It to be obviously using a
better IDE for example vs Core Pycharm
are the one that I like personally
people will use the Sublime even Vim. I
interviewed Pablo Galindo who is a
Python council member. He's a person who
writes Python programming language and
he uses Vim because
Vim if you're good with keyboard
shortcuts, I've seen these programmers
who are super fast and you don't see
them using mouse. They know all the
keyboard shortcuts and they can write
code really super fast. Second one is
brainstorming and coming up with a
design plan before you write your first
line of code. I have seen programmers who
are given Jira tasks and they just
immediately start typing good that's not
a good approach.
It's like building a home. If you are
designing a home, if you have a good
design you will have less issues later.
Similarly think about the design of your
software with your teammates. Do some
whiteboarding session draw technical
architecture diagram, data pipeline
information flow, class design whatever.
But do
enough brainstorming with your friends
so that you can come up with good design
and then you will not have to make
many changes later on. I've seen cases
where you don't do enough brainstorming.
You write let's say thousand line of
code
then you go to your friend for a code
review and the person will be like
this is not a correct design or they
will say
there is a ready-made library available,
why are you writing this code now? You
just wasted hours and hours of your time.
So therefore it's important that we
brainstorm and do design discussion in
advance.
Having sound knowledge of data structure
and algorithm is super important it goes
by Einstein saying
about politics is for the moment and it
equation is for eternity. Similarly data
structures doesn't matter what
programming language it is. Python, Java
tomorrow five new programming language
come up but data structures will remain
same. Your trees,
hash map
you know graph these are the essential
data structure and if you have a good
understanding of these
it will help you write better code. For
data structure, always I have a complete
playlist in Python super easy to
understand with exercises. So you can
follow that good understanding of
software architecture and design pattern
is equally important. I usually follow
martin fowler's blog. He's a well-known
software architect and I read his
articles and get my understanding clear
on various software architecture
patterns that are going in the industry
and that really helps build a better
software architecture wise. There are so
many books out there as well and if I'm
doing solo programming writing my own
functions you know little snippet of the
code, I have a habit of using pen and a
paper and I draw out my plan. See that's
very important- I write down my plan that
this is how I'm going to do my
programming and then only I start
writing code.
I have a friend whose team works in
react.js and couple of other web
technologies.
Every time they were writing a new
project they would do same kind of setup
again and again. So to automate that
thing what they did is they wrote this
cookie cutter tool where you run a
simple command and it builds the whole
project skeleton structure for you. It
will set up folders create scripts,
write files with small code snippets etc.
That way in the future now they have a
new react.js project they can use this
tool and get that whole skeleton ready.
Manually doing that would take you few
minutes. Now it is done in few seconds so
that's tip number three. Automate your
daily repetitive task.
You can automate lot of things through
ci cd pipeline as well. You can have a
pipeline which runs let's say your 200
test on every comment and now that is
saving you a lot of time on running
these days manually.
Making wise use of Google and ready-made
libraries is tip number four.
You need to know how to use Google or
how to ask a question in a right way.
Many times you're trying to do something
you type that in Google and most likely
you'll find an answer on stack overflow
where you get a ready-made core snippet.
I'm not saying blindly copy it.
Understand it. But
you can
make good or use of other people's work.
Same applies for
the ready-made libraries. Once I wanted
to write a retry logic in my Python code
so we are calling http server. It is
failing and we want to retry it after
two seconds and let's say after seven
attempts we want to give up. Now I wrote
that code manually but later on I
realized there is a library called
tenacity in Python where if you want to
try less seven attempts and then give up.
You can do it with single line of
annotation on top of your function. So
making good use of Google and readymade
library can improve your speed
like anything. Sometimes I think
as a programmers we are like plumbers
you know we take ready-made components
from different places we assemble them
together we are like assembly people, you
know. We assemble them and we create a
full pipeline where data can flow
thoroughly and you get an expected
output.
Think about the software program that
you're writing as a big problem and
usually we try to divide big problem
into small problems and those small
problems could be your functions, your
classes, the components that you're
writing. So that's tip number five divide
and conquer. First you divide it into
small sub tasks then you complete one
sub task at a time and when you are
doing that don't overthink about the
bigger problem because that will
negatively impact your
productivity. You can use test driven
development to test each individual
components. Make sure they are giving the
expected output and then as I said
before,
you are an assembly person who is just
joining those small working piecing
pieces together to create a big working
software. You all already know what is
number one productivity killer. It is
this stupid phone you get distracted so
much because of the phone that it
negatively impacts your programming
productivity.
Usually when we are doing intense coding,
we need to have few hours of distraction
free time you know almost like a
distraction free zone
where
no one is disturbing
us. We are in our own zone and just
focusing on our program. If you're
getting restricted by meetings
usually what I do is on Google calendar
or whatever calendar you're using
book a time slot where you have
restriction free
coding time. For example, morning 9 to 12
if you have booked it as coding hours or
whenever it could be in during the time
then during that time people will not
schedule meeting with you and you can
focus in your
work. Now,
keeping away this cell phone is very
important because if I'm writing a code
if I face an error
and if it's a complex error my brain
will tell me
hey this is too complex my brain wants
to go to an easy place and he'll say oh
why don't you check facebook whatsapp or
news and once I go that route
by the time I come back, I have already
spent half an hour 40 minutes, you know.
It's a big killer of your time
another tip is I have seen some folks
what they do is they come to office
literally they adjust their working
hours so when they come literally listen
instead of nine they come at
8 or 7 30. You get that time window where
there is no distraction no one has
scheduled meetings there are
not many people in the office, you can
really focus well, so finding those time
duration tweaking your work schedule in
a way that
you can focus is going to be extremely
crucial. And in the morning when your
brain is fresh maybe you want to
work on your intense coding problems.
Let's say you're writing some complex
score you know, I generally do it in the
morning in the afternoon or in the
evening maybe you can schedule your
usual maintenance work or meetings and
so on. So
you know tweaking your schedule is going
to be super useful.
The last tip is having good debugging
skills
really helps you improve your coding
overflow. There are people who have been
programming for years and they don't
know even what is conditional breakpoint.
By the way, if you don't know it, I have a
video on what is conditional breakpoint.
I use that all the time and conditional
break point is just one thing. There are
so many other cool debugging techniques
So when I'm writing code, when I run it
if I'm facing error, if I have good
debugging skill, I can figure out the
problem really fast, fix it and move on.
You know that way my overall development
speed
increases. These were seven tips which I
used in my professional career and I
have seen tremendous benefit out of it.
If I have missed any tips then
that you think could be useful then
please post in a comment below and try
these seven tips out and and let me know
how it goes.
[Music]
Thank you.