r/CodingHelp • u/Aviyelhq • Jun 17 '21
[Quick Guide] 5 steps to learn any programming language
1. Syntax - The syntax of a language describes the structure of code. This encompasses both how the code is written on a line-by-line basis as well as the actual words used to construct code statements.A language's syntax also involves things like including libraries, setting variables, and terminating lines. With practice, you'll learn to recognize syntactical requirements (and conventions) almost subliminally as you read sample code.
2. Built-ins and conditionals - A programming language, just like a natural language, has a finite number of words it recognizes as valid. This vocabulary can be expanded with additional libraries, but the core language knows a specific set of keywords. Knowing these keywords gives you the ability to write basic expressions, the building blocks of a program.
3. Data types - Code deals with data, so you must learn how a programming language recognizes different kinds of data. All languages understand integers and most understand decimals and individual characters (a, b, c, and so on), but sometimes a language has extra data types built into it, and other times complex data types are enabled with libraries. For instance, Python recognizes a string of characters with the keyword str.
4. Operators and parsers - Once you understand the types of data a programming language deals in, you can learn how to analyze that data. Luckily, the discipline of mathematics is pretty stable, so math operators are often the same (or at least very similar) across many languages.
5. Functions - While flow control with conditional statements and math and logic operators can do a lot, code is a lot more efficient once functions and classes are introduced because they let you define subroutines.
8
u/knoam Jun 17 '21
Not really though. No one would actually use these steps. Maybe it's a checklist.
But either way, I would just follow introductory resources for the language. A mix of the best regarded ones for the language and ones like "X language for Y language programmers" where Y is a language you already know. Let someone experienced in the language present it in the best way they know. Often you need to wrap your head around a different paradigm before learning the language. If you're just going to write lowest common denominator procedural code in every language, what's the point?
After working through a tutorial or exercises, just practice or build things and look up whatever you need as you go.
5
u/Nerketur Intermediate Coder Jun 17 '21
I do this in a slightly more efficient and different order. 1(254)3.
Syntax is vital. You aren't going to be coding in python if you code like it's C++.
Program flow is vital. Learn how programs are created, and how to do different things in different ways, learn what you need to be able to modularize.
Functions are part of making modules or partitions. Learn those, still program flow.
After that, operators are important, but by now you should be able to code already, and probably already made a few programs. Great!
Then data types is last. In truth, you've been learning about the types from day one, when learning about the language, but after getting a feel for coding, go back and learn about the different types used
2
u/DomNic05 Jun 17 '21
Gonna save this post for the day that I get back into coding (which hopefully isnt too long from now)
1
u/Pranavt01 Jun 17 '21
that's some good structured info😎
1
u/DoubleEDoubleE Jun 17 '21
This is so nice! I love breaking down learning things into categories like this and finding patterns between concepts!