101.school
CoursesAbout
Search...⌘K
Generate a course with AI...

    Intro to computers and programming

    Receive aemail containing the next unit.
    • Computer Basics
      • 1.1Overview of Computers
      • 1.2Understanding Operating Systems
      • 1.3Understanding Computer Networks
    • Introduction to Programming
      • 2.1What is Programming?
      • 2.2Basics of a Program
      • 2.3How a Program Runs on a Computer
    • Introduction to Coding
      • 3.1Writing your First Code
      • 3.2Language of Coding
      • 3.3Common Coding Practices
    • Scripting Basics
      • 4.1What is Scripting?
      • 4.2Difference Between Coding and Scripting
      • 4.3First Look at Shell Scripts
    • Basics of a Programming Language
      • 5.1Understanding Syntax
      • 5.2Basic Constructs – Loops & Conditionals
      • 5.3Functions and Procedures
    • Intermediate Programming
      • 6.1Arrays and Lists
      • 6.2File Handling
      • 6.3Error Handling
    • Introduction to Object Oriented Programming
      • 7.1Principles of Object Oriented Programming
      • 7.2Classes and Objects
      • 7.3Inheritance and Encapsulation
    • Practical Uses of Scripting
      • 8.1Process Automation with Scripts
      • 8.2Using Scripts for Data Manipulation
      • 8.3Web Scraping with Scripts
    • Algorithms and Data Structures
      • 9.1Basics of Algorithms
      • 9.2Introduction to Data Structures
      • 9.3Practical Uses of Data Structures
    • Code Efficiency
      • 10.1Writing Efficient Code
      • 10.2Debugging and Testing
      • 10.3Code Performance Analysis
    • Managing Code Project
      • 11.1Understanding Version Control
      • 11.2Use of GitHub for Project Management
      • 11.3Collaborative Coding Practices
    • Real World Coding Examples
      • 12.1Review and Analysis of Real World Code
      • 12.2Case Study—Use of Code in Solving Real World Problems
      • 12.3Building and Presenting a Mini Coding Project
    • Future Learning and Wrap Up
      • 13.1Essentials for Advanced Learning
      • 13.2Overview of Other Programming Languages
      • 13.3Course Wrap Up and Next Steps

    Introduction to Coding

    Understanding the Language of Coding

    set of rules defining the structure of a programming language

    Set of rules defining the structure of a programming language.

    Coding, at its core, is a way of communicating with computers. It involves writing instructions in a language that a computer can understand and execute. This article will introduce you to the basic elements of the language of coding: syntax, semantics, variables, data types, operators, and comments.

    Syntax and Semantics in Coding

    In any programming language, syntax refers to the set of rules that dictate how programs written in the language must be structured. It's like the grammar of the language. For example, in many languages, lines of code are terminated with a semicolon (;), and blocks of code are enclosed in braces ({}).

    Semantics, on the other hand, refers to the meaning of the instructions. It's like the vocabulary of the language. For example, in the Python programming language, the word print is used to display text on the screen.

    Variables, Data Types, and Operators

    Variables are like containers that store data. The data stored in a variable can change, hence the name "variable". For example, you might have a variable called age that stores a person's age.

    Data types define the kind of data that can be stored in a variable. Common data types include integers (whole numbers), floating-point numbers (numbers with a decimal point), strings (text), and booleans (true or false).

    Operators are symbols that perform operations on variables and values. For example, the plus sign (+) is an operator that adds two numbers together.

    Here's an example of variables, data types, and operators in action:

    age = 30 # An integer variable name = "Alice" # A string variable is_adult = age >= 18 # A boolean variable, using the greater-than-or-equal-to operator

    Understanding Comments

    Comments are lines of text in a program that are ignored by the computer. They're used to explain what the code does, making it easier for other people (or yourself in the future) to understand the code.

    In many languages, comments are written after a hash symbol (#) or between /* and */ symbols. Here's an example:

    # This is a comment age = 30 # This is also a comment /* This is a comment that spans multiple lines */

    Understanding the language of coding is the first step towards becoming a proficient coder. As you continue to learn and practice, these concepts will become second nature.

    Test me
    Practical exercise
    Further reading

    My dude, any questions for me?

    Sign in to chat
    Next up: Common Coding Practices