Coding

Why “vanilla JavaScript first” might NOT be the best approach!

  • 00:00:00 hi so you are on your way to becoming a
  • 00:00:03 web developer you're learning web
  • 00:00:05 development and as part of that you will
  • 00:00:07 almost certainly also learn JavaScript
  • 00:00:10 because JavaScript is probably the most
  • 00:00:13 important programming language to learn
  • 00:00:15 these days as a web developer because
  • 00:00:18 you can use it in so many places and if
  • 00:00:20 you're ever going to do some front-end
  • 00:00:22 web development you will need JavaScript
  • 00:00:25 because on the client-side
  • 00:00:26 in the browser JavaScript is essentially
  • 00:00:29 the only programming language you can
  • 00:00:31 use there now the thing is if you learn
  • 00:00:34 JavaScript it can be a bit strange at
  • 00:00:37 the beginning I guess every programming
  • 00:00:39 language is and like most programming
  • 00:00:41 languages javascript also has its weird
  • 00:00:44 parts a side note I do have a course
  • 00:00:47 about the worst parts but this video is
  • 00:00:49 not about the course instead when you
  • 00:00:51 learn JavaScript you will face some
  • 00:00:53 weird parts but there actually is also
  • 00:00:56 another difficulty when you learn
  • 00:00:57 JavaScript it has evolved quite a bit
  • 00:01:00 over the last ten years or so the
  • 00:01:03 JavaScript we wrote ten years ago is
  • 00:01:06 totally different or at least very
  • 00:01:08 different to the JavaScript code were
  • 00:01:10 writing today and this is actually a
  • 00:01:12 good thing I'd say because JavaScript
  • 00:01:15 code 10 years ago
  • 00:01:16 wasn't that great the JavaScript code
  • 00:01:18 were writing today is much much better
  • 00:01:26 still if you are learning JavaScript
  • 00:01:29 today this can be a challenge because
  • 00:01:31 you'll find a lot of books and courses
  • 00:01:34 and tutorials out there that actually
  • 00:01:35 start with the old JavaScript syntax and
  • 00:01:38 therefore when you learn JavaScript the
  • 00:01:40 journey can feel very daunting because
  • 00:01:43 you'll learn a certain tax then you'll
  • 00:01:45 learn a different version to do the same
  • 00:01:48 thing essentially so you learn a new
  • 00:01:50 syntax to do the same thing then you
  • 00:01:53 dive into advanced features then there
  • 00:01:55 is that this keyword which is kind of
  • 00:01:57 tricky in JavaScript it can be
  • 00:02:00 challenging but of course every
  • 00:02:02 programming language you're going to
  • 00:02:03 learn has it's challenging aspects and
  • 00:02:06 at least one of the great advantages of
  • 00:02:09 javascript is that when you're learning
  • 00:02:12 it you typically learn it by building
  • 00:02:14 some basic web applications some basic
  • 00:02:17 websites at least you can immediately
  • 00:02:19 see what your code is doing if you learn
  • 00:02:22 JavaScript that will often be something
  • 00:02:25 like adding an event listener to a
  • 00:02:27 button and then maybe rendering
  • 00:02:29 something on the webpage hiding an
  • 00:02:31 element adding an element things like
  • 00:02:33 that and at least at some visual
  • 00:02:35 feedback I mean I actually started with
  • 00:02:38 JavaScript though that was at a time
  • 00:02:40 where you couldn't do too many useful
  • 00:02:42 things with it and then I actually also
  • 00:02:45 switched to languages like C++ and C
  • 00:02:48 sharp and I can tell you if you're
  • 00:02:50 learning those languages there's way
  • 00:02:52 less you can do with them out of the box
  • 00:02:55 you got no graphical user interface that
  • 00:02:58 you could easily generate with those
  • 00:02:59 languages instead you work a lot in the
  • 00:03:02 terminal in the console and yeah it's a
  • 00:03:06 long way to building something useful
  • 00:03:08 and actually building something which
  • 00:03:11 you're used to working with desktop
  • 00:03:13 applications games all of that is pretty
  • 00:03:16 hard to build if you're just starting
  • 00:03:17 with c-sharp C++ or related languages
  • 00:03:21 that's probably why web development and
  • 00:03:24 mobile development is so popular for
  • 00:03:26 beginners because you learn to program
  • 00:03:29 whilst actually building something fun
  • 00:03:32 something you can see something you can
  • 00:03:34 touch at least digitally I guess and
  • 00:03:37 something you can potentially turn into
  • 00:03:39 a
  • 00:03:39 business I mean that's also the reason
  • 00:03:41 driver into development right we want to
  • 00:03:44 ultimately build something which people
  • 00:03:47 are going to use which could earn us
  • 00:03:48 some money which could get us a job now
  • 00:03:51 when you start to learn JavaScript
  • 00:03:53 though even though you have that
  • 00:03:55 graphical feedback even though you do
  • 00:03:58 start in the browser and you can see
  • 00:04:00 what is caused by your code even then
  • 00:04:05 you have different ways of learning
  • 00:04:07 JavaScript and what do I mean with ways
  • 00:04:10 here I mean whether you spend your time
  • 00:04:13 in just vanilla JavaScript and you learn
  • 00:04:16 all the basics there first or if you
  • 00:04:19 just learn some general basics the core
  • 00:04:22 syntax something like variables
  • 00:04:25 functions control statements like if
  • 00:04:27 statements and for loops arrays objects
  • 00:04:31 these core essentials maybe and then you
  • 00:04:33 take that knowledge that basic knowledge
  • 00:04:36 and you actually dive into some popular
  • 00:04:39 library or framework like react or
  • 00:04:41 angular now I see that a lot of people
  • 00:04:44 are advocating that you should start
  • 00:04:47 with JavaScript and learn all the
  • 00:04:49 fundamentals there first
  • 00:04:51 and that goes beyond what I just listed
  • 00:04:53 that also includes advanced features
  • 00:04:55 like promises a single way to call big
  • 00:04:59 functions niche cases so way more than
  • 00:05:02 just the core essentials and I see where
  • 00:05:05 those people are coming from but I don't
  • 00:05:08 think that's the best way of learning
  • 00:05:09 JavaScript for everyone
  • 00:05:11 for some people it might be and that is
  • 00:05:13 totally fine but I think it can also be
  • 00:05:16 very motivating if you can build
  • 00:05:18 something more amazing quickly and for
  • 00:05:21 dad you typically need a framework or a
  • 00:05:24 library I know that it is popular to
  • 00:05:27 state that we build an app with just
  • 00:05:29 vanilla JavaScript but I'm not a huge
  • 00:05:32 fan of that I mean why is that so cool
  • 00:05:35 because we don't use something that
  • 00:05:37 makes our life easier and helps us build
  • 00:05:39 more amazing things I don't get where
  • 00:05:42 the appeal is of building everything on
  • 00:05:45 my own that's a bit like if I would only
  • 00:05:47 buy the wood and construct all my
  • 00:05:50 furniture myself instead of buying
  • 00:05:53 finished
  • 00:05:53 furniture right that's I don't get this
  • 00:05:56 spot sure if you're an Avenue la
  • 00:05:58 JavaScript fan and you want to build
  • 00:05:59 everything with that definitely do it
  • 00:06:01 in reality in bigger projects you're not
  • 00:06:05 going to use just vanilla JavaScript
  • 00:06:06 instead you're going to use libraries
  • 00:06:09 and for big single page applications for
  • 00:06:12 big front-end applications you're
  • 00:06:14 definitely going to go with a popular
  • 00:06:17 library like react or a framework like
  • 00:06:19 angular or view and that's good because
  • 00:06:21 these libraries and frameworks do a lot
  • 00:06:24 of heavy lifting for you and they allow
  • 00:06:27 you the developer to focus on the things
  • 00:06:29 that really make your applications
  • 00:06:30 awesome that set your applications apart
  • 00:06:33 from other applications and that provide
  • 00:06:35 a good user experience there for my
  • 00:06:38 personal I guess recommendation is that
  • 00:06:40 you definitely get some basics in
  • 00:06:43 JavaScript first if you're learning that
  • 00:06:45 language but definitely all the try
  • 00:06:47 switching to a library like react or to
  • 00:06:51 a framework like angular or view early
  • 00:06:53 yes there will be challenging parts
  • 00:06:56 because you then don't just learn
  • 00:06:58 JavaScript but also a framework at the
  • 00:07:00 same time but on the other hand you will
  • 00:07:03 also be able to build more amazing
  • 00:07:05 things and it will be easier to see why
  • 00:07:08 you are learning this because you will
  • 00:07:10 be able to build web applications single
  • 00:07:13 page applications that make more sense
  • 00:07:15 that are more realistic that are more
  • 00:07:18 what you're used to when you are
  • 00:07:20 browsing the web and that can be highly
  • 00:07:22 motivating in addition you then also
  • 00:07:25 have the chance of learning something
  • 00:07:27 which you'll need to learn anyways side
  • 00:07:30 by side with JavaScript language itself
  • 00:07:32 and this does not mean that you
  • 00:07:34 shouldn't dive into the advanced parts
  • 00:07:36 of JavaScript you should but maybe you
  • 00:07:39 do this when the need arises whilst
  • 00:07:41 you're building your first basic react
  • 00:07:43 application whilst you're learning view
  • 00:07:46 or angular so you can learn these things
  • 00:07:49 side by side of course that'll be work
  • 00:07:51 of course there will also be frustrating
  • 00:07:54 moments if you do this side by side
  • 00:07:57 learning because sometimes you'll
  • 00:07:59 struggle with react sometimes you'll
  • 00:08:01 struggle with JavaScript sometimes
  • 00:08:03 you'll struggle with both and that can
  • 00:08:06 of course be frustrating
  • 00:08:07 ultimately I think that at least for
  • 00:08:09 some people this might be a good
  • 00:08:11 approach though because it can be faster
  • 00:08:14 and ultimately also more motivating and
  • 00:08:17 you can simply try it out you can simply
  • 00:08:19 try it out you can get your basic
  • 00:08:21 JavaScript knowledge the things I listed
  • 00:08:23 earlier variables control structures
  • 00:08:25 functions arrays objects that stuff and
  • 00:08:28 then you take that knowledge and you
  • 00:08:30 dive into something like react or
  • 00:08:33 angular or maybe view I think view might
  • 00:08:36 be one of the easiest frameworks to get
  • 00:08:39 started if you only have basic
  • 00:08:40 JavaScript knowledge because you then
  • 00:08:42 don't have to learn and use syntax like
  • 00:08:44 JSX
  • 00:08:45 or something like typescript instead you
  • 00:08:47 can use vanilla JavaScript with the
  • 00:08:49 extra view magic and build amazing
  • 00:08:51 applications so that might be a great
  • 00:08:53 first step side note if you don't want
  • 00:08:56 to work with view in the future even if
  • 00:08:59 you start with view and learn that it'll
  • 00:09:01 be easier to learn another library or
  • 00:09:03 framework like react or angular after
  • 00:09:06 you picked up your first framework and
  • 00:09:07 that's true no matter with which
  • 00:09:09 framework you start of course but view
  • 00:09:11 is particularly easy to start with I
  • 00:09:14 would argue so that is definitely
  • 00:09:16 something I can recommend and of course
  • 00:09:19 if you're interested in that I got
  • 00:09:21 course on all of that
  • 00:09:22 I got a JavaScript course that takes you
  • 00:09:24 from A to C and you could dive into that
  • 00:09:26 course go through the first few sections
  • 00:09:29 pick up the basics there and then pause
  • 00:09:31 that course and switch to the view
  • 00:09:34 course for example to learn that or to
  • 00:09:36 react or angular if you find that more
  • 00:09:38 appealing and then you can always come
  • 00:09:40 back to the JavaScript course and type
  • 00:09:42 into the advanced topics there as well
  • 00:09:44 this is an approach I would recommend
  • 00:09:47 that you check out and if it doesn't
  • 00:09:49 work for you you can of course always go
  • 00:09:50 back to the vanilla JavaScript first
  • 00:09:53 approach and then dive into frameworks
  • 00:09:55 or libraries that you need for your job
  • 00:09:57 but the average could be worth a look as
  • 00:10:00 well