Skip to content

nyangweso-rodgers/My-Journey-Into-Computer-Science

Repository files navigation

Computer Science

Table of Contents

  1. Overview Of Computer Science

  2. Software Development Concepts

  3. Operating Systems & Command Line

  4. Algorithms & Data Structures

  5. Big O Notation

Overview Of Computer Science

  • Computer Science is the study of how computers work, mostly the theoratical and mathematical perspective.

Definition of Terms in Computer Science

  1. Algorithm is a step by step procedure to resolve a problem. It's an effective method expressed a finite set of well-defined instructions.

  2. Computer Program is a sequence of instructions written using a Computer Programming Language to perform a specified task by the computer. A computer program is also called a computer software, which can range from two lines to millions of lines of instructions.

  3. Source Code is a code written in a particular programming language.

  4. Translators: responsible for converting the source code to a machine language (binary). Translators can be any of:

    • Interpreters: processes the source code line by line and runs every line in the final program or app. Interpreted source code start running until it encounters an error. Then the interpreter stops to report such an error. Python is a good example of an interpreted programming language
    • Compilers: convert the source code in its entirety via a compilation process to binary. The binary is then executed. If there were errors in the source code, they are detected during the compilation time and flagged. This interrupts the compilation process, and no binary is generated.
    • Hybrid Translators: combination of the interpreter and compiler. A popular hybrid programming language is Java which first compiles the source code to an intermediate format known as Bytecode. The bytecode is then interpreted and executed by a runtime engine (also known an a virtual machine). This enables the hybrid translators to run the bytecode on various operating systems.
    • Assemblers: for translating low-level Assembly language to binary
  5. Bytecode is a program that has been compiled from a source code into low-level code designed for a software interpreter. It may be executed by a virtual machine (e.g., Java Virtual Machine) or further compiled into machine code, which is recognized by the processor. NOTE: Bytecode is similar to assembly language in that it is not a high-level language, but it is still somewhat readable, unlike machine language. Both may be considered "intermediate languages" that fall between source code and machine code. The primary difference between the two is that bytecode is generated for a virtual machine (software), while assembly language is created for a CPU (hardware).

  6. Common bugs

    • Syntactic Errors: caused when one breaks the expected form or structure of the language.
    • Semantic Errors (Logical Errors): the program fails to produce the desired output.
    • Run - time Errors: Unlike semantic errors, this type of error interrupt the program ad prevents it from executig further - they are usually caused by unexpected result of some computation within the source code. e.g.,
      • ZeroDivisionError
      • StackOverflowError
      • IndexOutofBoundError