Quick Notes: Java

Main Notes

  • Class-based, Object-Oriented
  • Commonly used for Client-Server Web Applications.
  • Portability
    • Designed to have as few implementation dependencies as possible.
    • “Write once, run anywhere”: Compiled code can be run be run on all platforms without recompilation.
    • Compiled to Java bytecode that can be run on any Java virtual machine.
  • Principles
    • It must be simple, object-oriented, and familiar.
    • It must be robust and secure.
    • It must be architecture-neutral and portable.
    • It must execute with high performance.
    • It must be interpreted, threaded, and dynamic.
  • Designed in terms of nouns(classes) interacting with eachother with verbs(methods) as operations on and between them.
  • Automatic Garbage Collector: Collects memory when objects no longer referenced for security and safety.
  • All code is within classes.

Criticism

  • Overhead of interpreting bytecode generally slower than native executables.
  • Possibly slower and requiring more memory than programs written in C++.

Variables

  • Every variable is an object excluding primitive data types.
  • Primitive data types: integers, floating-point numbers, booleans, characters.

Functions

  • Does not support operator overloading.
  • java launcher calls the main method to pass control to the program.

Syntax

Similar syntax to C and C++.

Libraries/Dependancies

  • Standard libraries provide access to host-specific features such as graphics, threading and networking.
  • Comments: single line: \\ preceding the comment, /* */ for multi-line comments.

(Wikipedia: Java (programming language))

Quick Notes: Python

Main Notes

  • Philosophy: “There should be one obvious way to do one thing.”
  • Zen of Programming:
    • Beautiful is better than Ugly
    • Explicit is better than Implict
    • Simple is better than Complex
    • Complex is better than Complicated
    • Readability Counts
  • Multi-Paradigm Language

Variables

  • Variables hold value by reference, and are called “names” instead of variables.
  • Variables are dynamic, meaning the same variable can be set to different types.
  • Comparisons are done with values but can be done with references as well.
  • Variable Unpacking: multiple variables can be set in one expression.

Data Structures

def foo(a,b,c):
  baz = a + b + c
  print(baz)
bar = [1,2,3]
foo(*bar) #prints 6

The tuple bar is unpacked to the function foo as bar by itself would give a type error.
(GeeksforGeeks: Packing and Unpacking Arguments For Python)

Functions

  • All functions return a value.

Syntax

  • Python just has one way to write comments, with the # character preceding the comment, not working in strings.
  • Blocks are delimited by white space characters instead of parenthesis.
  • Quote (‘) and double quote (“) can be used interchangeably, triple quotes denotes multi-line strings.

(Wikipedia: Python (programming language))
(Microsoft | Vistual Studio Docs: Python In Visual Studio)

Quick Notes: Javascript

Main Notes

  • Used for dynamic content, to manipulate the DOM on web pages
  • Mostly known to function “client-side” but there are other implementations.
  • Run-Time Environment is on web browsers.
  • Supported by pretty much all browsers.
  • Multi-Paradigm
  • Mostly Object-Oriented

Other Notes

  • Uses html to include other scripts.
  • No natural facilities for input/output, networking, and storage but uses these services from the host environment.
  • console.log() used for output usually.
  • Hoisting: function and variable definitions are moved to the top of their scope before code execution. (1)
  • Hoisting only applies to var and function, not let and const. (2)
  • Semicolons are optional.(3)

1. Scotch: Understanding Hoisting in JavaScript by Mabishi Wakio
2. Don’t Use JavaScript Variables Without Knowing Temporal Dead Zone by Dmitri Pavlutin
3. Semicolons in JavaScript by Flavio Copes

Variables

  • Keyword ‘var’: function scope, re-assignable.
  • Keyword ‘let’: block scope, re-assignable.
  • Keyword ‘const’: block scope, not re-assignable.
  • variables 0, empty strings, undefined and null are equal to boolean false.

(Digital Ocean: Understanding Variables, Scope, and Hoisting in JavaScript )

Functions

  • When a function is called as a method on an object, the object is set as a local variable keyword “this”.
  • Function arguments are set in the local variable array “arguments”.
  • Function parameters are optional where they are set to undefined or set in the function itself.

Objects

  • Built in objects: Date, Function, Regex, etc.
  • Uses prototypes for inheritance.

(Wikipedia: Javascript)

Define: Programming Overview

Terms: Programming Paradigm, Object Oriented Programming, Functional Programming, Structured Programming

Languages, Libraries, etc: Java, C, C++, jQuery, HTML, XML, SQL, PHP, Node.js, WordPress, CMS, API, cURL, AJAX, Lisp, PERL.

Some of these terms may deserve their own page. I will need a common methodology in comparing these languages such as what’s different between them, what’s similar, and their general structures.

Programming Paradigm

A way of thinking of software production based on fundamental, defining principles. (1)

Object Oriented Programming

  • Data structures and functions have defined data types.
  • Objects are data structures with functions that operate with that specific object.
  • Objects may have relationships with each-other such as inheriting functions and variables.

(webopedia: OOP)

Functional Programming

  • “Declarative” instead of “Imperative”. (1)
  • Avoids shared state, mutable data, and side-effects. (1)
  • Focus on “what to solve” instead of “how to solve”. (2)
  • Expressions instead of statements. Expressions are evaluated to produce a value. (2)
  • Uses Pure Functions. Given the same input, always return the same output. Has no side-effects. (1)

Sources and References

(1. Medium: Master the JavaScript Interview: What is Functional Programming?)
(2. GeeksforGeeks: Functional Programming Paradigm)

Define: Linux, Unix, Command Prompt

Terms: Unix, Linux, Kernel, POSIX, Command Prompt, PowerShell, Web API.

A number of terms and phrases that I’ve heard of and probably used but haven’t clearly defined them for myself. I expect to make multiple posts looking up definitions for a number of terms. A wiki would help in sorting these terms should I ever decide to make one.

I want to summarize just the important points.

Unsorted
Command Line, Web API.

Unix

  • A type of operating system that includes a number of modern operating systems.
  • Small, modular utilities that do one thing and that one thing well.
  • “everything is a file”, everything such as resources and functions, are treated, organized, and accessed like files.
  • The other major type is Microsoft’s Windows NT-based OS.

(HTG)

Linux
A kernel. A Unix clone written by Linus Torvalds and people across the net. Free open-source and “aims towards POSIX compliance.” (nixcraft)

Kernel
A program that serves as the core of a operating system. One of first programs to load after the bootloader. (Wikipedia)

POSIX
IEEE standard for compatibility and portability between operating systems. Not just for UNIX systems. (Linux Hint)

Command Prompt
“Default command line interface provided by Microsoft”(maketecheasier)

Web API
I’ll look up definitions at a later date, this post will just reference them for now.

General Goals

Basic Goals:

  • List any and all code bits looked up.
  • Cleanup code of planned userscripts.
  • Make organized documentation of planned userscripts.
  • Implement user interfaces for planned userscripts.
  • Work on something that isn’t considered just front-end development.
  • Record changes to the site for site creation reference.