Overview of Programming Languages Types

Sep 14, 2024

Types of Programming Languages

Introduction

  • Importance of understanding programming languages for data structures, algorithms, etc.
  • Focus on languages like Java, Python, C++.
  • Computers operate on binary numbers (zeros and ones).

Programming Languages

  • Definition: Allow us to write code that executes specific tasks.
  • Examples of tasks:
    • Inputting student data
    • Performing calculations (e.g., multiplication table)
  • Programming languages convert human-readable code into machine-readable instructions.

Types of Programming Languages

1. Procedural Language

  • Early programming years focused on well-structured steps.
  • Involves a sequence of statements, commands, and functions to complete tasks.
  • Example:
    • Input first number, input second number, perform addition, print result.
  • Languages like Java, Python, and C++ support procedural programming.

2. Functional Language

  • Programs written using pure functions.
  • Functions bundle code that can be reused multiple times.
  • Focus on creating new outputs without modifying original variables.
  • Example of functional programming:
    • Operations on datasets in machine learning without altering original data.
  • Key concept: First-class functions allow functions to be assigned to variables and passed as arguments.

3. Object-Oriented Programming (OOP)

  • Revolves around objects that combine code (functions) and data (variables).
  • Example: Creating a class for students that includes properties like name, roll number, and marks.
  • OOP promotes code organization for easier development, debugging, and maintenance.
  • Languages like Java, Python, and C++ support OOP principles.

4. Static vs. Dynamic Languages

  • Static Languages: Type checking is done at compile time.
    • Example: If a variable is declared as an integer, assigning a string will result in a compile-time error.
  • Dynamic Languages: Type checking is performed at runtime.
    • Example: A variable can change types during execution without causing an error.

Memory Management

  • Stack Memory: Stores reference variables.
  • Heap Memory: Stores actual objects.
  • Variables point to objects in memory, and changes to objects are reflected across all references.
  • Concept of garbage collection: Objects without references are automatically removed from memory.

Conclusion

  • Understanding types of languages and concepts is crucial for programming.
  • Future lectures will cover more detailed aspects of memory, data types, and programming concepts.
  • Encouragement to engage with the content through likes and subscriptions.