oh excuse me sorry do you have the time
I must have forgotten my watch today
wrong again it is coffee time with your
host the tech lead on the tech lead show
and I'm an ex-googler Clete it is coffee
time now what we're going to be talking
about today is how you can code faster I
know this love you guys out there you
may know how to code but you're just
coding at this exceedingly slow pace and
you're just hardly able to get anything
done out there as an ex-googler khalid i
wanted to provide you some of my top
tips on how you can increase your
developer velocity and ship more code
quicker because the fact is it's one
thing to be able to code many people may
know how to do that but entirely
different thing to be able to swim
through code and churn through it like
butter I participated in the ACM
programming competition and even there
my teammates was like me to be the one
who would be sitting at the computer
coding and they made such a strategies
and algorithms and through my many jobs
I've always been praised as a fast coder
by my teammates and managers so I wanted
to give you some of my top tips on how
you can increase your velocity one thing
you can do by the way is check out my
free interview tips program daily
interview procom in which every day I
send you a free whiteboarding question
that a top-tier tech company has asked I
can also provide you the solution for
that with complete time space complexity
check it out daily interview procom now
one of my top tips for you here is to
learn to avoid making mistakes when you
type and as you're coding things up
because one mistake is going to be
extremely costly the best way to imagine
this is if you make one mistake it may
cost you 10 to 20 minutes maybe even an
hour later on as you try to figure out
where this bug was that you introduced
into your program it can cause all sorts
of issues you can accidentally mess up
your database in the most minimal case
maybe you have a few typos here and
there and then the code starts looking
really strange you misspelled some
characters some with variable names or
it may just not compile and then that's
going to just cause you extra
compilation cycles as you have to keep
recompiling the code personally for me
I'm able to type at 145 words per minute
with a hundred percent accuracy I don't
make mistake and I rather type slowly
flawlessly then type very quickly I make
mistakes all over the place as I'm
coding if I get to a portion that's
particularly tricky I will slowed
and just make sure that anything I type
is really correct and all the way there
I see some junior engineers they'll just
start blazing through it and they write
something that kind of works 80% but
then there's all sorts of holes and gaps
all over the place and all of those are
opportunities for bugs and the key thing
here is to avoid any type of bug if you
don't make bugs then you're going to be
much faster later on each bug is just
extremely costly and that's the way to
think about it the other thing I'll do
is I'll have a to-do list of all the
loose ends that I need to wrap up and I
tried to be very conscious and
detail-oriented about loose ends that I
may need to tie up strange error pages
maybe some user input that I forgot to
validate that one make sure I do
sanitize that later on potential bugs
and education I just write all of those
down and make sure that I resolve all of
them as I go now the second tip I have
for you here is to leverage consistency
either consistency in the UI design or
consistency in your system but what you
want to do here is to make sure that
you're not creating multiple different
variations of something that you can
actually reuse learn to either reuse UI
design patterns such that you can create
a general view or something like that
and just have that be reused for many
different components and usage scenarios
or you can learn to reuse your code in
certain ways if you take a look at the
YouTube app for instance you may notice
there's only really two different views
and those two views it's a small view
and a large view they're being reused
for many different types of surfaces and
components right so that's how you can
save on recreating hundreds or thousands
of views based on say the view surface
the content what type of context is
going to be in and similarly you can
also use consistency in the system and
code to save yourself and just reuse
things for example if you were needing
to store data there may be many
different data stores that you can be
using right you can store into a
database you can start as a text file
you can store it into local memory into
some cash but if you were to for example
forgo some of these potential
optimizations that may save you just a
few milliseconds here and there let's
say for example you just write
everything into a comment database store
that may actually vastly simplify your
code and allow you to ship things much
quicker and then later on if you were to
find that you need to optimize something
and put layers of caching in front of it
then yeah you can go ahead and do that
but as a first
you know keeping things simple and
delaying the optimization try to just
reuse as much of that code as possible
and it will make things much quicker for
you I know that in the field of tech
it's very easy to get lured in by the
newest crazy technologies maybe your
programming in Objective C and then
Swift comes out and you want to start
doing things in Swift and then you wanna
start using reactive cocoa mix in some
react native you know all of that stuff
is just going to add so many different
ways to do things and each of these have
maintenance burdens and costs to bring
in these new technologies and that
inconsistency that you create is going
to create churn as you try to navigate
your files as you try to get things done
there's just going to be so many
different ways to do something and each
time you approach a problem you have to
do it an entirely different new way
that's just going to slow you down now
another tip I have for you is to take
some time and learn your editor I would
advocate actually putting in say half a
day to an entire day just really
learning to use your editor figure out
all the keyboard shortcuts how to do
fast regular expression based search and
replace how to do multi cursor selection
how to jump around and navigate through
the file quickly how to quick open files
all of that stuff is going to speed up
your development by say 20% 30% or more
and along with this spend some time
learning to increase your typing speed
maybe just set up your environment and
your keyboard better fix your posture
such that you can actually type quickly
and personally for me and I've mentioned
this before I would never use like a
clunky Dell keyboard those keyboards are
just so mushy and even like a standard
Apple MacBook Pro keyboard those MacBook
keyboards are complete garbage as well I
would recommend finding a keyboard that
you like type Y on and let me know what
your favorite keyboards are out there
for me I tend to use the standard Apple
keyboards and they have a smaller travel
distance now another tip I have for you
here is to learn to choose the right
tool for the right job and in order to
really make this effective for you I
would highly recommend picking up some
sort of scripting language if you don't
know one already so scripting languages
tend to really speed up your workflow if
everything you're doing is say in C++ or
Java those are just very slow languages
you got a compiler you need all this
type checking and you just don't need
all that power and structure all the
time so if you were to use like say
Python PHP JavaScript you can really
increase
workflow and you can use that to write
quick scripts to do quick reef actors
and a lot of the game companies they'll
use scripting languages like Lua to set
up the level design so it depends on the
project that you're trying to create
here but if you're out to build like a
web back-end and there's a pretty simple
web back and then if you're to try to
build that out and say Java that may
just require a lot more infrastructure
setup before you can even get a simple
app running and you know everything that
you do just may require a lot more
boilerplate code now one thing that I
want to pause for a moment here and
recognize is that testing can slow you
down as you write tests it can actually
sometimes double the amount of code that
you need to write you write one
implementation for it and then you have
to write tests and sometimes the tests
can actually be longer than the actual
implementation the way I like to think
about testing is that they're kind of
like training wheels so imagine you're
learning to ride the bicycle well you're
going to want those training wheels
because they help prevent you from doing
anything truly dangerous they keep you
on track but if you take a look at the
pros the pros use training wheels for
them the training wheels actually reduce
their airspeed and it slows them down it
makes them less aerodynamic less sleek
now as I mentioned before if you're
really good like me you don't make any
mistakes when you code there are no bugs
you just catch them all and you're able
to type at like 140 150 words per minute
with a hundred percent accuracy zero
bugs it's a lot like that free solo
climber who's able to climb El Capitan
without making a single mistake and he
doesn't need those safety harnesses or
ropes that actually just slows him down
and reduces his speed as he climbs if
you really want to type fast and code
fast you'll learn to be able to code
within no tests and no bugs as well
tests aren't needed they're redundant
now the same goes for comments as well
comments can also reduce your air speed
so to speak you're coding speed what you
really want to do is structure your code
and make it self documenting the
elegance and composition of your code
should be documentation alone enough it
should be simple and beautiful by itself
and if you've done this correctly you
won't need comments where you're going
and then one final tip for you here is
to set up a good environment for
yourself you
our friend Joma he's not using fast
internet he's on like a dial-up modem
yeah man it was not my finest hour but I
got rekt by Amazon
[Applause]
which is why he codes so slowly all the
time so I would recommend that you get
yourself good internet so that you can
log into the computer quickly you can
surf the net faster you can look up
documentation you get yourself some nice
equipment a good chair good keyboard
monitor just make it more comfortable
for yourself and remember to also join
me at daily interview procom will solve
interview whiteboarding questions
together it's going to be tons of fun
just sign up over there I'll send you a
free interview question every day that's
been asked by a real tech company and if
you're serious about landing your dream
job in tech I also recommend you check
out Tech interview procom where fellow
youtuber Jonah and I X Google and X
Facebook engineers we coach you on how
you can pass the technical interviews so
they'll do for me let me know what your
top tips are on how to code faster if
you liked the video give it a like and
subscribe and I'll see you next time
thanks bye