I believe it’s a great language to be your first programming language ever.
- web applications
- server-side applications using Node.js
- create mobile applications using tools like React Native
- create programs for microcontrollers and the internet of things
- create smartwatch applications
The things you’ll learn in this course can be applied to all the things I mentioned.
A bit of history
Created 20 years ago, it’s gone a very long way since its humble beginnings.
Being the first - and the only - scripting language that was supported natively by web browsers, it stuck.
In the beginnings, it was not nearly powerful as it is today, and it was mainly used for fancy animations and the marvel known at the time as Dynamic HTML.
- high level: it provides abstractions that allow you to ignore the details of the machine where it’s running on. It manages memory automatically with a garbage collector, so you can focus on the code instead of managing memory like other languages like C would need, and provides many constructs which allow you to deal with highly powerful variables and objects.
- dynamic: opposed to static programming languages, a dynamic language executes at runtime many of the things that a static language does at compile time. This has pros and cons, and it gives us powerful features like dynamic typing, late binding, reflection, functional programming, object runtime alteration, closures and much more. Don’t worry if those things are unknown to you - you’ll know all of those at the end of the course.
- dynamically typed: a variable does not enforce a type. You can reassign any type to a variable, for example, assigning an integer to a variable that holds a string.
In programming, we call a language loosely typed when you don’t have to explicitly specify types of variables and objects.
A strongly typed language, on the contrary, wants types specified.
There are pros and cons, you can argue forever but the reality is that both approaches are great, in their intended context and usage.
A strong type system instead gives much more structure to a program and it’s a great aid for example, when working in teams when one single programmer can’t really have all the codebase in mind when working on it, and having types helps keep the code manageable.
You trade some of the flexibility that a loosely typed language gives you to get more security and trust in the codebase.
The compiler thanks to types can detect errors at compile time, rather than at runtime, making it simpler to write code that does what you want (and makes the testing phase slightly easier, although nothing can make your programs perfect).
Being loosely typed doesn’t mean you don’t have types, of course. You just make use of types implicitly, as you’ll soon see.