1/171
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Who was Abu Ja’far Muhammad ibn Musa and what was his contribution to mathematics and computing?
Abu Ja’far Muhammad ibn Musa (780–850) lived in Baghdad and was the chief mathematician in Khalif Al Mamun’s “House of Wisdom.” He authored “A Compact Introduction To Calculation Using Rules Of Completion And Reduction” and introduced the concept of “al-gabr” (removing negative units from an equation by adding the same quantity to the other side).
Who was Gottfried Wilhelm Leibniz and what were his key contributions?
Gottfried Wilhelm Leibniz (1646–1716) invented calculus and the binary system
Who was Gottlöb Frege and what was his major contribution?
Gottlöb Frege (1848–1925) developed Predicate Logic
What were Alan Turing’s contributions to computing?
Alan Turing developed the concept of the Turing Machine
Who was Alonzo Church and what did he contribute to computing?
Alonzo Church (1903–1995) developed Lambda Calculus
What were Stephen Kleene’s contributions to computer science?
Stephen Kleene (1900–1994) worked on recursive functions and automata
What is the Church-Turing Thesis?
The Church-Turing Thesis states that recursion
Who was David Wheeler and what were his achievements?
David Wheeler (1927–2004) was the first computer science Ph.D. (1951)
Who was Dennis Ritchie and what was his main contribution?
Dennis Ritchie (1941–2011) designed the C programming language.
Who is Brian Kernighan and what is his role in C programming?
Brian Kernighan (1942– ) co-authored the first C programming language book and contributed to its development.
Who were the key figures in combinatorics related to computing?
Moses Schönfinkel (1889–1942) and Haskell Curry (1900–1982) were influential in combinatorics and combinatory logic.
Who contributed to Post-production systems in computing?
Emil Post (1897–1954) developed Post-production systems.
Who developed Markov algorithms?
Andrey Markov (1903–1979) developed Markov algorithms.
Who was Kristen Nygaard and what was his contribution?
Kristen Nygaard (1926–2002)
Portability
Ease of running programs on different platforms without modification.
Type Safety
Ability of the language to prevent type errors and enforce correct use of data types.
Performance
How efficiently programs execute in terms of speed and resource usage.
Ease in Debugging
Support for finding and fixing errors, including debugging tools and clear error messages.
System Resource Access
The extent to which the language allows direct interaction with hardware, memory, or low-level system functions.
Stability
How reliably programs run without crashes or unexpected behavior.
Learning Curve
How easy or difficult it is for a new programmer to learn and use the language effectively.
Size
The storage and memory footprint of programs written in the language (smaller is better).
Analysis
How well the language supports code analysis for optimization, verification, or understanding program behavior.
Availability in Several Facilities
The variety of built-in functions, libraries, and tools available for development.
NOTE
No single language can maximize all factors due to hardware limits. Trade-offs are necessary; there is no perfect programming language.
What is Machine Language?
The native language of the computer; the most basic type of computer language consisting of strings of numbers that the hardware can use. Different hardware types have different machine codes. Consists of two parts: OpCode (tells the computer what functions to perform) and Operand (tells where to find and store data).
What are the advantages of Machine Language?
Translation-free, high-speed.
What are the disadvantages of Machine Language?
Machine dependent, complex, error prone, tedious.
What is Assembly Language?
Invented in the 1950s, it is easier to work with than machine language. Uses mnemonics instead of binary opcodes, features macros and subroutines, and uses cryptic English-like phrases. Translated into object code by an assembler.
What is an Assembler?
A program that converts assembly code into binary code. Uses abbreviations for instructions, also consists of an opcode and an operand.
What are the advantages of Assembly Language?
Easier to understand and use, less error prone, efficient, more control on hardware.
What are the disadvantages of Assembly Language?
Machine dependent, harder to learn, slower development time, no standardization.
What are Higher-level Programming Languages?
More powerful than assembly languages, allowing programmers to work in a more English-like environment. Includes 3rd, 4th, and 5th generation languages.
What are Third-generation Languages (3G)?
The first to use true English-like phrasing, making them easier to use and portable across systems. Examples: Fortran, COBOL, C/C++, Java.
What are the advantages of 3G Languages?
Readability, machine independent, easier debugging, easier to maintain, easier documentation.
What are the disadvantages of 3G Languages?
Poor control on hardware, less efficient in translation.
What are Hybrid Languages?
Advanced 3G languages that combine 4G features. Often run without compilers and use interpreters. Usually do not assign types to variables. Examples: Python, Ruby, Perl.
What are Fourth-generation Languages (4G)?
Easier to use than 3G languages, may use text-based or visual environments with graphical tools. Often do not need a compiler. Examples: Visual Basic, SQL, Unix Shell, R, Matlab, LabVIEW.
What are Fifth-generation Languages (5G)?
A debated concept; uses artificial intelligence to create software and solve problems using constraints rather than algorithms. Example: Prolog.
Procedural Programming
Execution of code is based on each statement, called procedures. Originated from structural programming. Programs are written step-by-step as a list of instructions. Examples: COBOL, Algol.
Procedure
A mini-program or block of code that performs a specific task and can be called from anywhere in the main program.
Object-Oriented Programming (OOP)
Encapsulates data and behavior into objects that can interact with each other. Procedures are called methods. A class acts as the blueprint for objects. Examples: C++, Java, Swift.
Method
A function or procedure that belongs to a specific object or class in OOP.
Class
A blueprint that defines the attributes (data) and methods (behavior) of objects in OOP.
Functional Programming
Passes data from function to function to produce a result. Treats functions as data that can be passed, returned, and combined to form new functions. Avoids shared state and uses immutable data. Examples: Haskell, Lisp.
Immutable Data
Data that cannot be changed once created, common in functional programming.
Pure Function
A function that always returns the same result when given the same input, without side effects.
Logic Programming
Based on formal logic, using facts and rules to derive conclusions. Programs consist of logical statements, and computation is the process of proving queries. Examples: Prolog, Datalog.
Compilers
A program that translates a high-level language into machine language. During translation, the compiler reads the source program, checks for syntax errors, and will not create object code until all errors are resolved. After compiling, the resulting code is saved separately and can run independently anytime. If the source code is modified, it must be compiled again to apply changes.
Interpreters
A programming language translator similar to a compiler, but executes each translated line immediately before moving to the next. When an error is encountered, execution stops and an error is displayed.
Summary (Compiling in C)
The compiling process in C involves writing source code, compiling to check for errors, generating object code when error-free, and linking to create an executable program.
Compiler vs Interpreter - Object Code
Compiler: Provides separate object program
Compiler vs Interpreter - Translation Process
Compiler: Converts program into entire machine code
Compiler vs Interpreter - Debugging
Compiler: Slower removal of errors (due to compile time and runtime errors)
Compiler vs Interpreter - Implementation
Compiler: Complex because they require hardcore coding and more memory to execute a program
Compiler vs Interpreter - Execution Time
Compiler: Faster because each statement is translated only once and saved in an object file, which can be executed anytime without translating again
C Program Development Environment - Edit
Program is created in the editor and stored on disk.
C Program Development Environment - Preprocess
Preprocessor processes the code (e.g., handling #include, #define).
C Program Development Environment - Compile
Compiler converts the preprocessed code into object code and stores it on disk.
C Program Development Environment - Link
Linker links the object code with required libraries to produce an executable.
C Program Development Environment - Load
Loader loads the executable into primary memory.
C Program Development Environment - Execute
CPU executes the instructions, possibly storing new data values as the program runs.
Components - Editor
For writing code.
Components - Preprocessor
Handles directives.
Components - Compiler
Generates object code.
Components - Linker
Combines object code and libraries.
Components - Loader
Loads program into memory.
Components - CPU
Executes instructions.
Components - Disk
Stores source and object code.
Components - Primary Memory
Holds the program during execution.
What are the three main definitions of a program?
A set of structured activities; a tool for instructing machines; a notation for algorithms.
What is programming?
The process of creating programs; the software that controls a machine; the logic expressed in such software; operating instructions.
What is a programming language?
A formal notation for specifying instructions, with syntax defined by context-free grammar, semantics for each syntactic construct, and a practical implementation on a real or virtual machine.
What are the three main ways to execute a programming language?
Translation, compilation, interpretation.
What is the trade-off between efficiency and portability?
Efficiency means faster execution optimized for specific hardware, while portability means the ability to run on multiple platforms without modification; optimizing for one can reduce the other.
Why do we design new programming languages?
Because of diverse applications, diverse programmers, changing problems, complexity classes like P vs NP vs NP-complete, changing computers, Moore’s Law-like hardware growth, and progress in language design and implementation.
What are the five elements in a variable’s 5-tuple?
Name, Type, Scope, Location value, Real value.
What does the "Name" in a variable’s 5-tuple represent?
The name of the variable.
What does the "Type" in a variable’s 5-tuple represent?
The data type of the variable.
What does the "Scope" in a variable’s 5-tuple represent?
The visibility of the variable (global or local).
What does the "Location value" in a variable’s 5-tuple represent?
The memory address where the variable is stored.
What does the "Real value" in a variable’s 5-tuple represent?
The actual value that the variable holds.
What must happen before creating a variable?
It must be declared.
How are variables declared in most languages?
By stating the type followed by the variable name.
Does variable declaration apply in functional languages?
No (more on that later).
Where is all program data stored?
In memory.
What is an address in programming?
A specific location in memory where data is stored.
Example of variable assignment in C: int i = 0; — what does this mean?
i is an integer variable with a value of 0.
Why does int = 0; cause an error?
Because there is no variable name (no location value).
What does int i; do in C?
Declares i as an int with a random value.
Why is int c = ; not allowed in C?
Because there is no value on the right side of the assignment.
What are basic arithmetic operators in C?
=, +, -, *, /, %.
What does ++ do in C?
Increments the value by 1.
What does -- do in C?
Decrements the value by 1.
What are compound operators in C?
+=, -=, *=, /=, %=.
What does 5 / 2 yield in C?
2 (integer division).
What does 5.0 / 2 yield in C?
2.5 (double division).
What does 5 % 2 yield in C?
1 (remainder).