User:Engineer-1024/Sample page

Overview
The FOO (Function-Oriented with Objects) programming methodology uses particular kinds of objects. The FOO approach was codified by Gregory McPherran in 2024.

Background
From the 1950s to 1970s, programming languages evolved thusly:

CPL -> BCPL-> B -> C -> C++, then Java (1990s) and C# (2000s )

In the mid 20th century, "object" was a general term and often referred to a computer language data entity. Here we see the term "object" in the BCPL language manual: "variety of different kinds of objects such as integers, truth values, vectors or functions." Note that here, a function is called an "object".

The development of what we today call "object-oriented" languages mainly started with Simula in the late 60s.

C++ is a language that supports object-oriented programming and uses a "this" pointer (for non-static class members).

FOO
The essence of FOO is avoidance of coupling data sets with function sets in the way that C++ does. Use of the "this" pointer is considered to be a core cause of inflexibility of class data and functions (brittleness, including inheritance). In FOO, the class code format is viewed as reducing clarity, pattern visibility, and productivity.

FOO Ideas (proposals):

Data models are generally useful beyond the role given them by a small set of functions. Thus FOO eliminates use of the "this" pointer, such that data can be separated from the class. Then, data models and functions can be mixed and matched freely. This broad flexibility applies to data composition, data as function arguments, and functions with other functions. Importantly, you can still control access by any function to any _instance_ of a data model / struct (see below).

In FOO interfaces with no data are allowed. Interfaces, functions that accept functions (and lambdas) as arguments, and data composition, are elements of polymorphism and abstraction in FOO.

With regards to data protections as compared to class-based OO, FOO protects data using: a.) Stack-resident data and data pointers that are only visible to the main and other top-level thread functions, b.) Syntax e.g. "mutable" and "const" and c.) Language scoping mechanisms.