Divinely Simple Computer Programming Part 1: The Buzzwords

A ‘buzzword’ blurs comprehension of reality. Computer programming has thousands of buzzwords. Many buzzwords get used in more than one programming language. Many mean different things depending on the programming language. The secret to learning computer programming quickly and succinctly is to understand the buzzwords that get used throughout all programming languages. To help facilitate comprehension, I will attempt to breakdown all of the thousands of buzzwords used in computer programming into just a small handful. I suspect this will make it incredibly easy (comparatively) for someone new to computer programming to grasp and learn it.

ENVIRONMENT:

The term environment means container of code. It is where something sits physically in the code you write. It can mean terms like application, project, directory, module, package, file, namespace, object, class, interface, struct, method, function and other similar terms. Those terms simply describe differently sized environments (largest to smallest).

The two reasons for grouping chunks of code within an environment is that a computer can generally perform electrical operations faster the closer the code is in physical reality, and to prevent duplicate names within name-value pairs(symbol table). The first concept is almost irrelevant with today’s technology yet the majority of programming languages obsess over it(TempleOS’s HolyC being an exception), and the second concept is made unnecessarily complex in most languages. The concept of an environment exists in programming languages in which where you write something is important.

CONTEXT:

A context helps manage what code in what environment is currently running. A context refers to which of the layered environments is currently running. It is a wrapper to help manage the code that is running. There are lots of environments. Which one is currently running is managed via execution contexts. It can contain things beyond what you’ve written in your code.

NAME-VALUE PAIRS:

A name that refers to a unique value. The name may be defined more than once, but only can have one value in any given context. That value may be more name-value pairs. Also called a ‘symbol table/s’. An example of how this works in python:

myvar = 70
class MyClass:
myvar = 44
def somefunction():
myvar = 33
return myvar
print(myvar)

That code will print out 70 cause the MyClass class and somefunction function are never invoked but the myvar variable was invoked because it is within the environment of the file not the class or function and since the execution context of the class or function was never called the execution context remains in the file not the class or function. If instead:


mc = MyClass()
print(mc.myvar)
print(somefunction())

Then it will print out 44 from the print(mc.myvar) call and print out 33 from the print(somefunction()) call. Each of the calls have separate execution contexts, and therefore have separate name-value pairs(symbol tables) that can be worked with.

INVOCATION OR INVOKE:

Invoke means running a function. Example in python:

def b():
print("b")
def a():
b()
a()

The example creates a global execution context on code start. The function call ‘a’ creates a execution context for the code contained inside of it when it gets called with ‘a()’, in this case the function ‘a’ calls the the function ‘b()’ and so the function ‘b’ creates a execution context for the code contained inside of it, then the function ‘b’ calls the python ‘print’ function which again changes the execution context to within the code for pythons print function when it gets called with print(“b”). These nested execution contexts are the basis for almost all programming languages including python, javascript, java, c#, c, c++, go, etc. Execution contexts add name-value pairs to the cpu execution stack, therefore increasing the allowable code that can be executed in the program at that current time.

SYNTAX:

The grammar rules of the programming language.

PARSER:

A program that reads your code and determines what it does and if its syntax(grammar) is valid. Code is not magic. Someone else wrote a program to translate it for the computer.

OPERATORS:

Special functions whose syntax is written differently. Generally, operators take two parameters and return one result. Some examples are multiply:’*’, divide:’/’, add:’+’, subtract:’-‘, bitwise and: ‘&’, bitwise or:’|’, bitwise xor:’^’, bitwise shift right:’>>’, bitwise shift left:'<<‘, parenthesis:'(‘,’)’.

PRECEDENCE:

Operators have a specific precedence depending on the language that determines which operator function gets called first. The precedence generally is ordered from top of the file to the bottom and if on the same line then in a ‘pemdas’ (parenthesis, exponents, multiplication, division, addition, subtraction) order with a few differences between languages.

STATEMENT:

A statement is a special function that may or may not contain operators and does not return a value. A statement usually changes the state of whatever runs its code. Some examples are ‘if’, ‘else’, ‘while’, ‘for’, ‘return’ etc.

EXPRESSION:

An expression is a statement that may or may not contain operators but unlike statements, returns a value and they usually end in a semi-colon ‘;’ a new-line ‘\r\n’ or a comma ‘,’.

The Facts That Matter:

Every single language in computer programming uses hundreds to thousands of buzzwords that mean different things in different languages the buzzwords used in almost every single programming language can be narrowed down to environment, context, name-value pairs(symbol tables), invocation/invoke, syntax, parser, operators, precedence, statements, and expressions. They are the only buzzwords that need to be understood. If one understands the above buzzwords, they can read any programming languages documentation and instantly understand what is occurring in physical reality. Hopefully this breakdown will make it easier for newcomers to enter into the computer programming world.

2 Comments

  1. Loving Context

    Very good stuff. Wish this is how they taught it in college. Interested on hearing your thoughts on the OOP vs Functional dichotomy with the context of static methods.

    More importantly, I would love to hear you expand on TempleOS and how it is the exception. I remember reading a comment of your’s on a video mentioning how the memory structure is genius.

    Like

    1. I think oop and functional are not the best on their own, they are much better when combined. I also think terry does neither of them, hes doing procedural programming (i think thats what its called). The memory structure is genius because he doesn’t use paging. All the code is identity mapped on the stack. Meaning it never has to switch out paging files for memory context. The reason for paging as far as i know is to allow for different memory contexts for when different programs run, many programs are larger than 2gb because of all the operating system bloat or the program is using alot of bloat code. Terry puts everything within the first 2gb and its identity mapped. The reason for using 2 gb is because its the farthest difference REL32 can travel in a single call, REL32 is fastest assembly call(according to terry, i have no idea, im not good with low level stuff yet). Meaning you can call all the code in the operating system, kernal code, compiler code, any code you include even if its a 3d game it will be a small amount of code because TempleOS has zero bloat and its compiler creates zero bloat. So instead of having to load in paging memory context, check for file permission, call the code, and possibly have to constantly be changing paging context because some code is linked to a different paging context, where it checks for file permission each time. Instead all TempleOS does when you want to call code is call the code, no loading paging files, no checking for file permission (TempleOS runs on ring 0 max privilege levels at all times), no switching between paging files, just call the code and thats it. I think this is the reason its significant, Im not an expert on lower level stuff, TempleOS is how im learning lower level stuff because you can access the kernal source code with a hotkey.

      Like

Leave a Reply to Loving Context Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s