Skip to main content

Learn syntax with online courses and programs

In order to master a coding language, you need to understand its syntax. Start learning about syntax with online courses delivered through edX.
Syntax | Introduction Image Description

What is syntax?

Just like natural spoken languages, computer programming languages rely on syntax. Syntax is the rule set defining how characters, words, and symbols are used together to create meaning.Footnote 1 Syntax determines how you write code in a particular programming language and whether the machine will understand its instructions when it’s time to execute the commands. The rules of a particular language’s syntax determine aspects such as capitalization, spacing, punctuation, and line breaks, among other things. 

Different coding languages can have wide variations in syntax rules, even when they share the same use cases. And, immediate readability or brevity doesn't always mean a language is best suited for a project or profession. For example, C# uses a relatively complicated syntax that can be more difficult to master, but it remains one of the most popular programming languages used today.Footnote 2 C# is faster than a language like Python because it's compiled rather than interpreted. This means it is executed directly by the processor.Footnote 3

Maximize your potential

Sign up for special offers, career resources, and recommendations that will help you grow, prepare, and advance in your career.

Browse online syntax courses


Stand out in your field

Use the knowledge and skills you have gained to drive impact at work and grow your career.

Learn at your own pace

On your computer, tablet or phone, online courses make learning flexible to fit your busy life.

Earn a valuable credential

Showcase your key skills and valuable knowledge.





Syntax course curriculum

If you are interested in learning how to use syntax, introductory courses may start by covering the different levels of complexity in syntax, which includes:

  • Lexical elements: This is the most basic level, where characters can have a meaning when in a specific order that forms a token, which is comparable to a word in natural language.Footnote 4

  • Context-free syntax: At this level, you can arrange tokens in a meaningful sequence to form a phrase. Think of them the same way you think of sentences.Footnote 5

  • Context-sensitive syntax: This level takes a holistic view of things, which determines what objects or variables you can reference and whether the types are valid for the language.Footnote 6 For instance, you can’t run a library you haven’t installed.

Though the exact options available vary between languages, tokens are an important concept to grasp early on, and you might encounter different types.Footnote 7 These include:

  • Keywords: Reserved words, such as parameters or commands, with a predetermined meaning that's important to the interpreter or compiler.

  • Operators: Specific mathematical or logical action. The most common ones are basic arithmetic symbols for addition (+), subtraction (-), division (/), and multiplication (*).

  • Identifiers: Names the developer assigns to functions, variables, constants, and other items in the source code.

  • Literals or constants: Values of any data type that have a fixed value and don't change.

Start building the knowledge you need to work in programming with edX. From accelerated boot camps to comprehensive programs that allow you to earn a bachelor’s degree or, for more advanced learners, a master’s degree, there are many different learning formats available to fit your needs. Busy professionals can even take advantage of executive education courses tailored to those in data science and programming positions. Find the right course for you.

Explore syntax jobs

Jobs that use programming syntax are those in which you're likely to write code. Examples of these professions include:

  • Front-end developers, who translate UI design into code.

  • Back-end developers, who work on server-side code for apps and websites.

  • Full-stack developers, who work on both front- and back-end development.Footnote 8

  • Data scientists, who use code to analyze massive datasets.Footnote 9

Some of these careers also contain more specialized roles. For example, front-end, back-end, and full-stack developers can choose to focus on web, mobile, or desktop platforms with different stacks of technology to choose from.

Each of these roles will have different education and skill requirements. For example, you may be able to build relevant skills in a coding boot camp, where you can build essential programming skills and build a portfolio of projects.