To really feel comfortable learning any language there are four main areas you need to start with.
1. Data and Data Types
What types of data can my variables be, how do I declare the variable? What operators are available to do mathematical and boolean operations with my variables?
What collections are available to group my data like arrays, objects, maps, tuples, etc.?
2. Control Flow
How can I make conditional code? (ifs, switches, ternary)
How can I repeat code? (while and for loops)
How can we encapsulate code into a function I can call when needed?
How do I pass parameters to that function?
How does that function return a value, what if it doesn’t?
What’s a pure vs impure function?
4. Object-Oriented Programming
How can I encapsulate data and functions into a class (if possible)?
How can I define what occurs when an instance of the class is created and destroyed? (constructors/destructors)
How can a new class borrow the structure of a class already created? (inheritance/polymorphism)
How can I alter the structure from the borrowed class into the new class? (overriding)
Once you learn these concepts it is just a matter of applying a particular language’s nuances and syntax to these concepts. Below is a coding exercise that will help you practice all the above.
- Create a fighter class
- each fighter should have a name, health, strength and defense attribute
- each fighter should have an attack method and defense method
- use randomization to set each fighter’s stats and to randomize the effects of the attack and defense methods
- instantiate two fights
- create a loop in which the two fighters will fight till one’s health is depleted
repeat this exercise for each language you learn.
below are playlists I’ve made teach the basics for several programming languages:
Bonus for WebDev
Full Stack with Express -> https://www.youtube.com/watch?v=SZxyYKhAvQQ&list=PLY6oTPmKnKbZeKlNGxOrL2Crl-tm1bxbJ
Full Stack with Koa -> https://www.youtube.com/watch?v=8_aWw7lfKKI&list=PLY6oTPmKnKbbF4t0Y9DcUVYi7f4kix7Qj
Full stack with FoalTS -> https://www.youtube.com/watch?v=mvoBeTdMFUE&list=PLY6oTPmKnKbY6v7zR9h1INfywh-qFLSQ_
Full stack with Laravel -> https://www.youtube.com/watch?v=3eWGqdyMJ5Y&list=PLY6oTPmKnKbZ5TgZKeh0uKT6d1DenRmx1
Full Stack with NextJS -> https://www.youtube.com/watch?v=ES0luPNdbRs&list=PLY6oTPmKnKbZBfml7eZ-ubwCEMC4EjdTN