SSC Notes / Computer Awareness / Chapter 10
Chapter 10 of 13

Computer Programming and Languages

Generations of programming languages, compiler vs interpreter, and the basic programming concepts SSC tests conceptually.

📖 ~13 min read 💻 SSC Computer Awareness

Introduction

Programming languages allow humans to write instructions that a computer can execute. SSC tests the evolution of these languages, plus the crucial distinction between how compiled and interpreted languages are translated into machine code.

Generations of Programming Languages

GenerationTypeExample
1st Generation (1GL)Machine Language — direct binary code (0s and 1s)Pure machine code
2nd Generation (2GL)Assembly Language — uses mnemonics instead of raw binaryAssembly
3rd Generation (3GL)High-Level Languages — closer to human language, needs translationC, C++, Java, Python
4th Generation (4GL)Very high-level, often used for database queries/report generationSQL
5th Generation (5GL)Used in AI, based on solving problems using constraints rather than an algorithmProlog

Low-Level vs High-Level Languages

FeatureLow-Level LanguageHigh-Level Language
Closeness to hardwareVery close (machine/assembly)Far from hardware, closer to human language
Ease of writingDifficult, hardware-specificEasier to read/write/debug
Execution speedVery fast (direct hardware execution)Slower (needs translation first)
PortabilityNot portable across different hardwarePortable across different systems

Compiler vs Interpreter vs Assembler

Flowchart — How Source Code Becomes Executable
Compiler — translates the ENTIRE program at once into machine code before execution
Interpreter — translates and executes code line-by-line, in real time
Assembler — translates assembly language into machine code
FeatureCompilerInterpreter
TranslationWhole program at onceLine by line
Speed of executionFaster (already fully translated)Slower (translates as it runs)
Error detectionShows all errors after compiling the whole programStops at the first error encountered
Example languagesC, C++Python, JavaScript (traditionally)
📌 Note: Some modern languages (like Java) use a hybrid approach — compiled to intermediate "bytecode," which is then interpreted/JIT-compiled by a virtual machine (JVM) — blurring the classic compiler/interpreter distinction.

Programming Paradigms

ParadigmApproachExample Language
ProceduralSequence of instructions/proceduresC
Object-Oriented (OOP)Organises code around "objects" combining data and behaviourJava, C++, Python
FunctionalTreats computation as evaluation of mathematical functionsHaskell

Key OOP Concepts

ConceptMeaning
ClassA blueprint/template for creating objects
ObjectAn instance of a class
InheritanceA class acquiring properties/behaviours of another (parent) class
PolymorphismThe ability of an object/function to take multiple forms
EncapsulationBundling data and methods together, restricting direct access to some components
UPSC/SSC Focus: Five generations of programming languages · Low-level vs high-level language trade-offs · Compiler (whole-program) vs interpreter (line-by-line) distinction · Four core OOP concepts (class, object, inheritance, polymorphism, encapsulation).

💡 Want More? Get the Full eBook

This free chapter covers the key concepts. For complete coverage with 500+ MCQs, mock tests, and previous year analysis — grab the premium eBook.

📚 Browse Premium eBooks →