This commit is contained in:
Miloslav Ciz 2024-05-14 13:35:32 +02:00
parent fc95f9c631
commit bf2ed8760e
12 changed files with 1919 additions and 1755 deletions

View file

@ -15,7 +15,7 @@ Here there will be a constantly WIP list of [books](book.md) that might be of in
- **Game Engine Black Book: Wolfenstein 3D** (Sanglard, 2019): Same as the Doom engine book from the same author, just about the older game Wolfenstein 3D, also amazing. - **Game Engine Black Book: Wolfenstein 3D** (Sanglard, 2019): Same as the Doom engine book from the same author, just about the older game Wolfenstein 3D, also amazing.
- **Industrial Society and Its Future** (Kaczynski, 1995): A bit boring read by the famous [Unabomber](ted_kaczynski.md), criticizing rapid technology advancement, but an important read for those who are more into politics, if only for the memes :) - **Industrial Society and Its Future** (Kaczynski, 1995): A bit boring read by the famous [Unabomber](ted_kaczynski.md), criticizing rapid technology advancement, but an important read for those who are more into politics, if only for the memes :)
- **ISO/IEC 9899:1999** (1999): Specification of the version of [C](c.md) programming language that [suckless](suckless.md)/[LRS](lrs.md) very often uses. It's nice to skim over it to get an idea how a language is actually specified. You'll also probably learn something new about C in the process. - **ISO/IEC 9899:1999** (1999): Specification of the version of [C](c.md) programming language that [suckless](suckless.md)/[LRS](lrs.md) very often uses. It's nice to skim over it to get an idea how a language is actually specified. You'll also probably learn something new about C in the process.
- **Just for Fun** (2001): Official biography of [Linux Torvalds](torvalds.md), the original creator of [Linux](linux.md). It recounts valuable historical moments with comments by Linus himself, revealing many interesting details and also a bit of Torvalds' personality (shows some of his evil side). - **Just for Fun** (2001): Official biography of [Linus Torvalds](torvalds.md), the original creator of [Linux](linux.md). It recounts valuable historical moments with comments by Linus himself, revealing many interesting details and also a bit of Torvalds' personality (shows some of his evil side).
- **Larousse Desk Reference Encyclopedia** (1995): Very nice single-volume [encyclopedia](encyclopedia.md) that's sorted by topic, with many nice illustrations, published back then when censorship wasn't so extreme, provides overview of all topics of human knowledge. - **Larousse Desk Reference Encyclopedia** (1995): Very nice single-volume [encyclopedia](encyclopedia.md) that's sorted by topic, with many nice illustrations, published back then when censorship wasn't so extreme, provides overview of all topics of human knowledge.
- **Masters of Doom** (Kushner, 2003): Another nice book for [Doom](doom.md) fans, this time not really technical but rather just retelling the story of the game's development -- quite comfy, a lot if interesting trivia. - **Masters of Doom** (Kushner, 2003): Another nice book for [Doom](doom.md) fans, this time not really technical but rather just retelling the story of the game's development -- quite comfy, a lot if interesting trivia.
- **[The Jargon File](jargon_file.md)** (1975...): [Hacker culture](hacking.md) dictionary, a lot of wisdom, inside jokes, and things related to oldschool hacking. - **[The Jargon File](jargon_file.md)** (1975...): [Hacker culture](hacking.md) dictionary, a lot of wisdom, inside jokes, and things related to oldschool hacking.

View file

@ -45,7 +45,7 @@ Computers are theoretically studied by [computer science](compsci.md). The kind
**The power of computers is mathematically limited**, [Alan Turing](turing.md) mathematically proved that there exist problems that can never be completely solved by any [algorithm](algorithm.md), i.e. there are problems a computer (including our [brain](brain.md)) will never be able to solve (even if solution exists). This is related to the fact that the power of mathematics itself is limited in a similar way (see [Godel's theorems](incompleteness_theorems.md)). Turing also invented the theoretical model of a computer called the [Turing machine](turing_machine.md). Besides the mentioned theoretical limitation, many solvable problems may take too long to compute, at least with computers we currently know (see [computational complexity](computational_complexity.md) and [P vs NP](p_vs_np.md)). **The power of computers is mathematically limited**, [Alan Turing](turing.md) mathematically proved that there exist problems that can never be completely solved by any [algorithm](algorithm.md), i.e. there are problems a computer (including our [brain](brain.md)) will never be able to solve (even if solution exists). This is related to the fact that the power of mathematics itself is limited in a similar way (see [Godel's theorems](incompleteness_theorems.md)). Turing also invented the theoretical model of a computer called the [Turing machine](turing_machine.md). Besides the mentioned theoretical limitation, many solvable problems may take too long to compute, at least with computers we currently know (see [computational complexity](computational_complexity.md) and [P vs NP](p_vs_np.md)).
And let's also mention some [curious](interesting.md) **statistics** and facts about computers as of the year 2024. The fist computer in modern sense of the word is frequently considered to have been the Analytical Engine designed in 1837 by an Englishman Charles Babbage, a general purpose [mechanical computer](mechanical_computer.md) which he however never constructed. After this the computers such as the Z1 (1938) and Z3 (1941) of a German inventor Konrad Zuse are considered to be the truly first "modern" computers. Shortly after the year 2000 the number of US households that had a computer surpassed 50%. The fastest [supercomputer](supercomputer.md) of today is Frontier (Tennessee, [USA](usa.md)) which achieved computation speed of 1.102 exaFLOPS (that is over 10^18 [floating point](float.md) operations per second) with power 22.7 MW, using the [Linux](linux.md) kernel (like all top 500 supercomputers). Over time transistors have been getting much smaller -- there is the famous **[Moore's law](moores_law.md)** which states that number of transistors in a chip doubles about every two years. Currently we are able to manufacture [transistors](transistor.md) as small as a few nanometers and chips have billions of them. { There's some blurriness about exact size, apparently the new "X nanometers" labels are just [marketing](marketing.md) lies. ~drummyfish } And let's also mention some [curious](interesting.md) **statistics** and facts about computers as of the year 2024. The fist computer in modern sense of the word is frequently considered to have been the Analytical Engine designed in 1837 by an Englishman Charles Babbage, a general purpose [mechanical computer](mechanical_computer.md) which he however never constructed. After this the computers such as the Z1 (1938) and Z3 (1941) of a German inventor Konrad Zuse are considered to be the truly first "modern" computers. Shortly after the year 2000 the number of US households that had a computer surpassed 50%. The fastest [supercomputer](supercomputer.md) of today is Frontier (Tennessee, [USA](usa.md)) which achieved computation speed of 1.102 exaFLOPS (that is over 10^18 [floating point](float.md) operations per second) with power 22.7 MW, using [Linux](linux.md) as its kernel (like all top 500 supercomputers). Over time transistors have been getting much smaller -- there is the famous **[Moore's law](moores_law.md)** which states that number of transistors in a chip doubles about every two years. Currently we are able to manufacture [transistors](transistor.md) as small as a few nanometers and chips have billions of them. { There's some blurriness about exact size, apparently the new "X nanometers" labels are just [marketing](marketing.md) lies. ~drummyfish }
## Typical Computer ## Typical Computer

View file

@ -177,7 +177,8 @@ Bear in mind the main purpose of this quiz is for you to test your understanding
74. If your computer resides in a private network that's connected to the Internet through a router that performs network address translation ([NAT](nat.md), common with many ISPs), why you typically cannot host a server that would be publicly accessible from the outside [Internet](internet.md)? I.e. explain how NAT works and say what's preventing outside computers from reaching your server behind it. How can you make your server work even behind NAT? 74. If your computer resides in a private network that's connected to the Internet through a router that performs network address translation ([NAT](nat.md), common with many ISPs), why you typically cannot host a server that would be publicly accessible from the outside [Internet](internet.md)? I.e. explain how NAT works and say what's preventing outside computers from reaching your server behind it. How can you make your server work even behind NAT?
75. We know that in C (C99) we can kind of use arrays and pointers "interchangeably", we are taught they are really the same. However show at least one example of when the difference matters, i.e. considering e.g. `int *a;` vs `int a[N];` write some expressions with `a` in it where the distinction will be significant. 75. We know that in C (C99) we can kind of use arrays and pointers "interchangeably", we are taught they are really the same. However show at least one example of when the difference matters, i.e. considering e.g. `int *a;` vs `int a[N];` write some expressions with `a` in it where the distinction will be significant.
76. Write sed substitution command (the one that starts with `s/`) that will convert Markdown links (format: `[link text](destination)`) to HTML links (format: `<a href="destination">link text</a>`). You probably need [regular expression](regex.md) capture groups for this. 76. Write sed substitution command (the one that starts with `s/`) that will convert Markdown links (format: `[link text](destination)`) to HTML links (format: `<a href="destination">link text</a>`). You probably need [regular expression](regex.md) capture groups for this.
77. Did you enjoy this quiz? 77. Give at least three examples of palindromic English words (read the same forward and backwards), each at least four letters long.
78. Did you enjoy this quiz?
### Answers ### Answers
@ -257,7 +258,8 @@ Bear in mind the main purpose of this quiz is for you to test your understanding
74. Behind NAT you're in a private network, computers inside it have no public addresses (their IP addresses are in the private range and potentially same as addresses of computers in other private networks), only the router has a public IP address that's unique within the Internet, i.e. from Internet's point of view there is only one device connected -- your router. Computers behind this router are invisible, so no one can connect to the server that's behind it. The possibility of you having a two way communication from within this private network with the outside Internet is enabled by the router who communicates for you when you ask for it, i.e. when you (from inside the private network) initiate the connection -- the router then creates the connection for you and talks to the outside world for you (translating your private address to its public address, hence *network address translation*). But no one can initiate communication from the outside, the router wouldn't know to whom he wants to speak. This can be solved e.g. by port forwarding (setting some default computer to which communication from outside will be redirected) or tunneling (keeping a constant connection with some outside proxy server that's listening to requests and resending them). 74. Behind NAT you're in a private network, computers inside it have no public addresses (their IP addresses are in the private range and potentially same as addresses of computers in other private networks), only the router has a public IP address that's unique within the Internet, i.e. from Internet's point of view there is only one device connected -- your router. Computers behind this router are invisible, so no one can connect to the server that's behind it. The possibility of you having a two way communication from within this private network with the outside Internet is enabled by the router who communicates for you when you ask for it, i.e. when you (from inside the private network) initiate the connection -- the router then creates the connection for you and talks to the outside world for you (translating your private address to its public address, hence *network address translation*). But no one can initiate communication from the outside, the router wouldn't know to whom he wants to speak. This can be solved e.g. by port forwarding (setting some default computer to which communication from outside will be redirected) or tunneling (keeping a constant connection with some outside proxy server that's listening to requests and resending them).
75. For example `sizeof(a)`: if `a` is a pointer, size of pointer will be returned whereas in case of array the size of the whole array will be returned. Similarly e.g. `&a`: if `a` is a pointer, we'll get a pointer to pointer (generally a different address) whereas in case of array `a` and `&a` gives the same address -- that of the array's first element (though the type will be different). 75. For example `sizeof(a)`: if `a` is a pointer, size of pointer will be returned whereas in case of array the size of the whole array will be returned. Similarly e.g. `&a`: if `a` is a pointer, we'll get a pointer to pointer (generally a different address) whereas in case of array `a` and `&a` gives the same address -- that of the array's first element (though the type will be different).
76. Something like `s/\[\([^]]*\)\](\([^)]*\))/<a href="\2">\1<\/a>/g`. 76. Something like `s/\[\([^]]*\)\](\([^)]*\))/<a href="\2">\1<\/a>/g`.
77. yes 77. For example: poop, boob, civic, deed, level, rotor, madam, refer, stats etc.
78. yes
## Other ## Other

2
fsf.md
View file

@ -8,7 +8,7 @@ FSF stands for Free Software Foundation, a non-profit organization established b
TODO TODO
In September 2019 Richard Stallman, the founder and president of the FSF, was cyberbullied and [cancelled](cancel_culture.md) by SJW fascists for simply stating a rational but unpopular opinion on child sexuality and was forced to resign as a president. This might have been the last nail in the coffin for the FSF. The new president would come to be [Geoffrey Knauth](geoffrey_knauth.md), an idiot who spent his life writing [proprietary](proprietary.md) software in such shit as [C#](c_sharp.md) and helped built military software for killing people (just read his cv online). What's next, a porn actor becoming the next Pope? Would be less surprising. In September 2019 Richard Stallman, the founder and president of the FSF, was cyberbullied and [cancelled](cancel_culture.md) by SJW fascists for simply stating a rational but unpopular opinion on child sexuality and was forced to resign as a president. This might have been the last nail in the coffin for the FSF. The new president would come to be [Geoffrey Knauth](geoffrey_knauth.md), an idiot who spent his life writing [proprietary](proprietary.md) software in such shit as [C#](c_sharp.md) and helped make [military](military.md) software for killing people (just read his cv online). What's next, a porn actor becoming the next Pope? Would be less surprising.
After this the FSF definitely died. After this the FSF definitely died.

View file

@ -36,10 +36,10 @@ Up until recently in history every engineer would tell you that *the better mach
Under [capitalism](capitalism.md) technological minimalism is suppressed in the mainstream as it goes against [corporate](corporation.md) interests, i.e. those of having monopoly control over technology, even if such technology is "[FOSS](foss.md)" (which then becomes just a cool brand, see [openwashing](openwashing.md)). We may, at best, encounter a "shallow" kind of minimalism, so called [pseudominimalism](pseudominimalism.md) which only tries to make things appear minimal, e.g. aesthetically, and hides ugly overcomplicated internals under the facade. [Apple](apple.md) is infamous for this [shit](shit.md). Under [capitalism](capitalism.md) technological minimalism is suppressed in the mainstream as it goes against [corporate](corporation.md) interests, i.e. those of having monopoly control over technology, even if such technology is "[FOSS](foss.md)" (which then becomes just a cool brand, see [openwashing](openwashing.md)). We may, at best, encounter a "shallow" kind of minimalism, so called [pseudominimalism](pseudominimalism.md) which only tries to make things appear minimal, e.g. aesthetically, and hides ugly overcomplicated internals under the facade. [Apple](apple.md) is infamous for this [shit](shit.md).
There are movements such as [appropriate technology](appropriate_tech.md) (described by E. F. Schumacher in a work named *Small Is Beautiful: A Study of Economics As If People Mattered*) advocating for small, efficient, decentralized technology, because that is what best helps people.
**Does minimalism mean we have to give up the nice things?** Well, not really, it is more about giving up the [bullshit](bullshit.md), getting rid of addiction and changing an attitude. People addicted to [modern](modern.md) consumerist technology often worry that with minimalism they will lose their drug, typically [games](game.md) or something similar. Remember that with minimalism **we can still have technology for entertainment**, just a non-consumerist one -- instead of consuming a new game each month we may rather focus on creating deeper games that may last longer, e.g. those of a [easy to learn, hard to master](easy_to_learn_hard_to_master.md) kind and building communities around them, or on modifying existing games rather than creating new ones from scratch over and over. Sure, technology would LOOK different, our computer interfaces may become less of a thing of fashion, our games may rely more on aesthetics than realism, but ultimately minimalism can be seen just as trying to achieve the same effect while minimizing waste. If you've been made addicted to bullshit such as buying a new GPU each month so that you can run games at 1000 FPS at progressively higher resolution then of course yes, you will have to suffer a bit of a withdrawal just as a heroin addict suffers when quitting the drug, but just as him in the end you'll be glad you did it. **Does minimalism mean we have to give up the nice things?** Well, not really, it is more about giving up the [bullshit](bullshit.md), getting rid of addiction and changing an attitude. People addicted to [modern](modern.md) consumerist technology often worry that with minimalism they will lose their drug, typically [games](game.md) or something similar. Remember that with minimalism **we can still have technology for entertainment**, just a non-consumerist one -- instead of consuming a new game each month we may rather focus on creating deeper games that may last longer, e.g. those of a [easy to learn, hard to master](easy_to_learn_hard_to_master.md) kind and building communities around them, or on modifying existing games rather than creating new ones from scratch over and over. Sure, technology would LOOK different, our computer interfaces may become less of a thing of fashion, our games may rely more on aesthetics than realism, but ultimately minimalism can be seen just as trying to achieve the same effect while minimizing waste. If you've been made addicted to bullshit such as buying a new GPU each month so that you can run games at 1000 FPS at progressively higher resolution then of course yes, you will have to suffer a bit of a withdrawal just as a heroin addict suffers when quitting the drug, but just as him in the end you'll be glad you did it.
Remember, you can't lose if you don't play.
## Importance Of Minimalism: Simplicity Brings Freedom ## Importance Of Minimalism: Simplicity Brings Freedom
It can't be stressed enough that minimalism is absolutely required for technological freedom, i.e. people having, in **practical** ways, control over their tools. While in today's society it is important to have legal freedoms, i.e. support [free software](free_software.md), we must not forget that this isn't enough, a freedom on paper means nothing if it can't be practiced. We need both legal AND [de facto](de_facto.md) freedom over technology, the former being guaranteed by a free [license](license.md), the latter by minimalism. Minimal, simple technology will increase the pool of people and parties who may practice the legal freedoms -- i.e. those to use, study, modify and share -- and therefore ensure that the technology will be developed according to what people need, NOT according to what a corporation needs (which is usually the opposite). It can't be stressed enough that minimalism is absolutely required for technological freedom, i.e. people having, in **practical** ways, control over their tools. While in today's society it is important to have legal freedoms, i.e. support [free software](free_software.md), we must not forget that this isn't enough, a freedom on paper means nothing if it can't be practiced. We need both legal AND [de facto](de_facto.md) freedom over technology, the former being guaranteed by a free [license](license.md), the latter by minimalism. Minimal, simple technology will increase the pool of people and parties who may practice the legal freedoms -- i.e. those to use, study, modify and share -- and therefore ensure that the technology will be developed according to what people need, NOT according to what a corporation needs (which is usually the opposite).
@ -52,5 +52,6 @@ Minimalism and simplicity increases freedom even of [proprietary](proprietary.md
## See Also ## See Also
- [KISS](kiss.md)
- [primitivism](primitivism.md) - [primitivism](primitivism.md)
- [single instruction computer](single_instruction.md) - [single instruction computer](single_instruction.md)

160
network.md Normal file
View file

@ -0,0 +1,160 @@
# Network
TODO
## Code Examples
First let's try writing some **UDP** C program under [Unix](unix.md). Remember that UDP is the unreliable protocol, so it's possible our messages may get lost or distorted, but in programs that can handle some losses this is the faster and more KISS way. Our program will be peer-to-peer, it will create two sockets, one listening and one sending. It will make a few message exchange turns, in each turn it will send something to its partner, it will check if it itself got any message and then will wait for some time before the next round. Note that we will use a non-blocking receiving socket, i.e. checking if we have any messages won't pause our program if there is nothing to be received, we'll simply move on if there is nothing (that's how realtime games may do it, but other kinds of server may rather a use blocking socket if they intend to do nothing while waiting for a message). Also pay attention to the fact that the program will choose its port number based on a one letter "name" we give to the program -- this is so that if we test the programs on the same computer (where both will have the same IP address), they will choose different ports (different processes on the same computer cannot of course use the same port).
```
#include <stdio.h>
#include <unistd.h> // for sleep
#include <arpa/inet.h>
#include <sys/socket.h>
#define BUFFER_LEN 8
#define PORT_BASE 1230
// run as ./program partner_addr partner_letter my_letter
char buffer[BUFFER_LEN + 1]; // extra space for zero terminator
char name; // name of this agent (single char)
int sockIn = -1, sockOut = -1; // receive/send socket file descriptors
void error(const char *msg)
{
printf("%c: ERROR, %s\n",name,msg);
if (sockIn >= 0)
close(sockIn);
if (sockOut >= 0)
close(sockOut);
exit(1);
}
int main(int argc, char **argv)
{
if (argc < 4)
error("give me correct arguments bitch");
name = argv[3][0];
char *addrStrDst = argv[1];
int portSrc = PORT_BASE + name, // different name => different port
portDst = PORT_BASE + argv[2][0];
struct sockaddr_in addrSrc, addrDst;
sockIn = socket(AF_INET,SOCK_DGRAM | SOCK_NONBLOCK,IPPROTO_UDP);
if (sockIn < 0)
error("couldn't create listen socket");
sockOut = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);
if (sockOut < 0)
error("couldn't create send socket");
addrSrc.sin_family = AF_INET;
addrSrc.sin_port = htons(portSrc);
addrSrc.sin_addr.s_addr = htonl(INADDR_ANY);
if (bind(sockIn,(struct sockaddr *) &addrSrc,sizeof(addrSrc)) < 0)
error("couldn't bind listen socket");
addrDst.sin_family = AF_INET;
addrDst.sin_port = htons(portDst);
if (inet_aton(addrStrDst,&addrDst.sin_addr) == 0)
error("couldn't translate address");
printf("%c: My name is %c, listening on port %d, "
"gonna talk to %c (address %s, port %d).\n",
name,name,portSrc,argv[2][0],addrStrDst,portDst);
for (int i = 0; i < 4; ++i)
{
printf("%c: Checking messages...\n",name);
int len = recv(sockIn,buffer,BUFFER_LEN,0);
if (len > 0)
{
buffer[len] = 0;
printf("%c: Got \"%s\"\n",name,buffer);
}
else
printf("%c: Nothing.\n",name);
for (int j = 0; j < BUFFER_LEN; ++j) // make some gibberish message
buffer[j] = 'a' + (name + i * 3 + j * 2) % 26;
printf("%c: Sending \"%s\"\n",name,buffer);
if (sendto(sockOut,buffer,BUFFER_LEN,0,
(struct sockaddr *) &addrDst,sizeof(addrDst)) < 0)
printf("%c: Couldn't send it!\n",name);
printf("%c: Waiting...\n",name);
usleep(2000000);
}
printf("%c: That's enough, bye.\n",name);
close(sockIn);
close(sockOut);
return 0;
}
```
We can test this for example like this:
```
./program 127.0.0.1 A B & { sleep 1; ./program 127.0.0.1 B A; } &
```
Which may print out something like this:
```
B: My name is B, listening on port 1296, gonna talk to A (address 127.0.0.1, port 1295).
B: Checking messages...
B: Nothing.
B: Sending "oqsuwyac"
B: Waiting...
A: My name is A, listening on port 1295, gonna talk to B (address 127.0.0.1, port 1296).
A: Checking messages...
A: Nothing.
A: Sending "nprtvxzb"
A: Waiting...
B: Checking messages...
B: Got "nprtvxzb"
B: Sending "rtvxzbdf"
B: Waiting...
A: Checking messages...
A: Got "rtvxzbdf"
A: Sending "qsuwyace"
A: Waiting...
B: Checking messages...
B: Got "qsuwyace"
B: Sending "uwyacegi"
B: Waiting...
A: Checking messages...
A: Got "uwyacegi"
A: Sending "tvxzbdfh"
A: Waiting...
B: Checking messages...
B: Got "tvxzbdfh"
B: Sending "xzbdfhjl"
B: Waiting...
A: Checking messages...
A: Got "xzbdfhjl"
A: Sending "wyacegik"
A: Waiting...
B: That's enough, bye.
A: That's enough, bye.
```
TODO: TCP

2
oop.md
View file

@ -2,7 +2,7 @@
*"I invented the term 'object oriented' and [C++](cpp.md) was not what I had in mind"* --[Alan Kay](alan_kay.md), inventor of OOP *"I invented the term 'object oriented' and [C++](cpp.md) was not what I had in mind"* --[Alan Kay](alan_kay.md), inventor of OOP
Object-oriented programming (OOP, also object-obsessed programming, objectfuscated programming, capital-oriented programming or artificial inelegance) is a [programming paradigm](paradigm.md) that tries to model reality as a collection of abstract objects that communicate with each other and obey some specific rules. While the idea itself isn't bad and can be useful in certain cases and while pure OOP in very old languages like [Smalltalk](smalltalk.md) may have even been quite elegant, by later adoption by [capitalist businesses](capitalist_software.md) the concept has been extremely twisted and degenerated to unbelievable levels -- **OOP has become extremely overused, extremely badly implemented and downright forced in programming languages** that nowadays try to apply this [abstraction](abstraction.md) to every single program and concept, creating [anti-patterns](anti_pattern.md), unnecessary issues and of course greatly significant amounts of [bloat](bloat.md). [We](lrs.md) therefore see the OOP of today as a **[cancer](cancer.md) of programming**. OOP was basically a software development fashion wave that scarred the industry for decades, it has poisoned minds of several generations. Nowadays despite OOP still keeping many fans the critical stance towards it isn't even controversial anymore, many others have voiced the criticism over and over, usually the most competent programmers like [Richard Stallman](rms.md) and [Linux Torvalds](torvalds.md) and groups like [suckless](suckless.md) and [bitreich](bitreich.md). Ugly examples of OOP gone bad include [Java](java.md) and [C++](cpp.md) (which at least doesn't force it). Other languages such as [Python](python.md) and [Javascript](javascript.md) include OOP but have lightened it up a bit and at least allow you to avoid using it. You should probably learn OOP but only to see why it's bad (and to actually understand 99% of code written nowadays). Object-oriented programming (OOP, also object-obsessed programming, objectfuscated programming, capital-oriented programming or artificial inelegance) is a [programming paradigm](paradigm.md) that tries to model reality as a collection of abstract objects that communicate with each other and obey some specific rules. While the idea itself isn't bad and can be useful in certain cases and while pure OOP in very old languages like [Smalltalk](smalltalk.md) may have even been quite elegant, by later adoption by [capitalist businesses](capitalist_software.md) the concept has been extremely twisted and degenerated to unbelievable levels -- **OOP has become extremely overused, extremely badly implemented and downright forced in programming languages** that nowadays try to apply this [abstraction](abstraction.md) to every single program and concept, creating [anti-patterns](anti_pattern.md), unnecessary issues and of course greatly significant amounts of [bloat](bloat.md). [We](lrs.md) therefore see the OOP of today as a **[cancer](cancer.md) of programming**. OOP was basically a software development fashion wave that scarred the industry for decades, it has poisoned minds of several generations. Nowadays despite OOP still keeping many fans the critical stance towards it isn't even controversial anymore, many others have voiced the criticism over and over, usually the most competent programmers like [Richard Stallman](rms.md) and [Linus Torvalds](torvalds.md) and groups like [suckless](suckless.md) and [bitreich](bitreich.md). Ugly examples of OOP gone bad include [Java](java.md) and [C++](cpp.md) (which at least doesn't force it). Other languages such as [Python](python.md) and [Javascript](javascript.md) include OOP but have lightened it up a bit and at least allow you to avoid using it. You should probably learn OOP but only to see why it's bad (and to actually understand 99% of code written nowadays).
**A [real life](irl.md) analogy** to give a bit of high level overview: the original [Smalltalk](smalltalk.md) style OOP was kind of like when society invented [democracy](democracy.md) -- a simple idea which everyone understands (we are 10 cavemen, let's just vote on stuff mkay?) that's many times useful and works well, e.g. on a scale of a village or a small city. Then cities grew bigger (just as software did), into states and empires and the idea kept getting more and more complicated -- people just wanted to keep the democracy, apply it to everything and scale it indefinitely, but for that they had to add more complexity, they implemented representatives, parliaments, senates, presidents, vicepresidents, ministers, judges, more and more bureaucracy, hybrid ideas (free market, controlled economy, ...), corruption and inefficiencies crept in, the system degenerated into what we have today -- a hugely expensive paperworking machine that's exploited and hacked, with laws so complicated no one really understands them, with [magic](magic.md), randomness and unpredictability, producing just waste and bullshit, crumbling under own weight. This is also the way OOP went -- they started inventing static classes/methods, abstract classes/methods, multiple inheritances, interfaces, design patterns, overriding, hybrid paradigms and so on until we ended up with ugly abominations on which today's technology stands. Now a few things have to be noted. Firstly these abominations are a disaster, they came from our mistake of taking the original simple idea (simple small scale voting democracy) and saying "let's make this the only thing in the world and let's scale it a million times!" Such idea is stupid from the start and there is no doubt about that. However another evil is that people are taught to do everything this way -- today's programmers will use the mainstream OOP everywhere, even in simple programs, they don't even think about if they should, they are simply taught "always use this". This is like in real life wanting to govern a family by having elections each year to vote for the head of the family, then having members of family vote for other members of the family to be their representatives that will talk for them (the same kind of craziness as wanting to strictly respect encapsulation even in trivial programs), then if someone wants to buy anything he has to ask for a budget several months in advance and have others vote on it while an elected anti corruption committee is watching etcetc. This kind of insanity is what's normal in software nowadays. Now the only sane discussion can be had only about the usefulness and scope of the original, simple idea (simple voting in small groups, simple pure OOP) and here we say that it may be good, but only applied to just some specific situations, i.e. we say simple OOP is good for some problems but not all, just like voting is a good solution to some problems (e.g. a group of friends deciding where to go party), but not all (e.g. passengers in a car voting on which way to steer and which pedals to press). **A [real life](irl.md) analogy** to give a bit of high level overview: the original [Smalltalk](smalltalk.md) style OOP was kind of like when society invented [democracy](democracy.md) -- a simple idea which everyone understands (we are 10 cavemen, let's just vote on stuff mkay?) that's many times useful and works well, e.g. on a scale of a village or a small city. Then cities grew bigger (just as software did), into states and empires and the idea kept getting more and more complicated -- people just wanted to keep the democracy, apply it to everything and scale it indefinitely, but for that they had to add more complexity, they implemented representatives, parliaments, senates, presidents, vicepresidents, ministers, judges, more and more bureaucracy, hybrid ideas (free market, controlled economy, ...), corruption and inefficiencies crept in, the system degenerated into what we have today -- a hugely expensive paperworking machine that's exploited and hacked, with laws so complicated no one really understands them, with [magic](magic.md), randomness and unpredictability, producing just waste and bullshit, crumbling under own weight. This is also the way OOP went -- they started inventing static classes/methods, abstract classes/methods, multiple inheritances, interfaces, design patterns, overriding, hybrid paradigms and so on until we ended up with ugly abominations on which today's technology stands. Now a few things have to be noted. Firstly these abominations are a disaster, they came from our mistake of taking the original simple idea (simple small scale voting democracy) and saying "let's make this the only thing in the world and let's scale it a million times!" Such idea is stupid from the start and there is no doubt about that. However another evil is that people are taught to do everything this way -- today's programmers will use the mainstream OOP everywhere, even in simple programs, they don't even think about if they should, they are simply taught "always use this". This is like in real life wanting to govern a family by having elections each year to vote for the head of the family, then having members of family vote for other members of the family to be their representatives that will talk for them (the same kind of craziness as wanting to strictly respect encapsulation even in trivial programs), then if someone wants to buy anything he has to ask for a budget several months in advance and have others vote on it while an elected anti corruption committee is watching etcetc. This kind of insanity is what's normal in software nowadays. Now the only sane discussion can be had only about the usefulness and scope of the original, simple idea (simple voting in small groups, simple pure OOP) and here we say that it may be good, but only applied to just some specific situations, i.e. we say simple OOP is good for some problems but not all, just like voting is a good solution to some problems (e.g. a group of friends deciding where to go party), but not all (e.g. passengers in a car voting on which way to steer and which pedals to press).

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
# Unix Philosophy # Unix Philosophy
Unix philosophy is one of the most important and essential approaches to [programming](programming.md) (and by extension all [technology](tech.md) design) which advocates great [minimalism](minimalism.md) and is best known by the saying that **a program should only do one thing and do it well**. Unix philosophy is a collective [wisdom](wisdom.md), a set of design recommendations evolved during the development of one of the earliest (and most historically important) [operating systems](os.md) called [Unix](unix.md), hence the name. Having been defined by [hackers](hacking.md) (the true, old style ones) the philosophy naturally advises for providing a set of many highly effective tools that can be combined in various ways, i.e. to perform [hacking](hacking.md), rather than being restricted by a fixed, intended functionality of huge do-it-all programs. Unix philosophy advocates [simplicity](kiss.md), clarity, modularity, reusability and composition of larger programs out of very small programs rather than designing huge monolithic programs as a whole. Unix philosophy, at least partially, lives on in many project and Unix-like operating systems such as [Linux](linux.md) (though Linux is more and more distancing from Unix), has been wholly adopted by groups such as [suckless](suckless.md) and [LRS](lrs.md) (us), and is even being reiterated in such projects as [plan9](plan9.md). Unix philosophy is one of the most important and essential approaches to [programming](programming.md) (and by extension all [technology](tech.md) design) which advocates great [minimalism](minimalism.md) and is best known by the saying that **a program should only do one thing and do it well**. Unix philosophy is a collective [wisdom](wisdom.md), a set of design recommendations evolved during the development of one of the earliest (and most historically important) [operating systems](os.md) called [Unix](unix.md), hence the name. Having been defined by [hackers](hacking.md) (the true, old style ones) the philosophy naturally advises for providing a set of many highly effective tools that can be combined in various ways, i.e. to perform [hacking](hacking.md), rather than being restricted by a fixed, intended functionality of huge do-it-all programs. Unix philosophy advocates [simplicity](kiss.md), clarity, modularity, reusability and composition of larger programs out of very small programs rather than designing huge monolithic programs as a whole. Unix philosophy, at least partially, lives on in many project and Unix-like operating systems such as [GNU](gnu.md)/[Linux](linux.md) (though GNU/Linux distros are more and more distancing from Unix), has been wholly adopted by groups such as [suckless](suckless.md) and [LRS](lrs.md) (us), and is even being reiterated in such projects as [plan9](plan9.md).
NOTE: see also *[everything is a file](everything_is_a_file.md)*, another famous design principle of Unix -- this one is rather seen as a Unix-specific design choice rather than part of the general Unix philosophy itself, but it helps paint the whole picture. NOTE: see also *[everything is a file](everything_is_a_file.md)*, another famous design principle of Unix -- this one is rather seen as a Unix-specific design choice rather than part of the general Unix philosophy itself, but it helps paint the whole picture.

File diff suppressed because one or more lines are too long

View file

@ -3,9 +3,9 @@
This is an autogenerated article holding stats about this wiki. This is an autogenerated article holding stats about this wiki.
- number of articles: 579 - number of articles: 579
- number of commits: 798 - number of commits: 799
- total size of all texts in bytes: 3771245 - total size of all texts in bytes: 3777760
- total number of lines of article texts: 28949 - total number of lines of article texts: 28967
- number of script lines: 262 - number of script lines: 262
- occurences of the word "person": 8 - occurences of the word "person": 8
- occurences of the word "nigger": 74 - occurences of the word "nigger": 74
@ -35,60 +35,72 @@ longest articles:
top 50 5+ letter words: top 50 5+ letter words:
- which (2158) - which (2162)
- there (1637) - there (1637)
- people (1425) - people (1429)
- other (1181) - other (1181)
- example (1164) - example (1166)
- software (1062) - software (1067)
- number (1034) - number (1034)
- about (980) - about (985)
- program (858) - program (859)
- their (808) - their (809)
- because (769) - because (771)
- would (757) - would (760)
- called (746) - called (746)
- language (734) - language (734)
- computer (729) - computer (730)
- being (710) - being (710)
- things (697)
- simple (696) - simple (696)
- things (693)
- numbers (688) - numbers (688)
- something (665) - something (668)
- without (655) - without (656)
- programming (645) - programming (645)
- function (643) - function (643)
- these (608) - these (608)
- however (604) - however (605)
- different (603) - different (605)
- world (571) - world (571)
- system (555) - system (555)
- should (544) - should (544)
- games (539) - games (539)
- doesn (537) - doesn (538)
- point (531) - point (531)
- society (530) - society (530)
- though (504) - though (504)
- while (498) - while (498)
- memory (497) - memory (497)
- drummyfish (494) - drummyfish (494)
- using (490) - using (491)
- technology (479) - technology (479)
- still (477) - still (478)
- similar (472) - similar (472)
- course (470) - course (471)
- simply (455) - simply (455)
- possible (454) - possible (454)
- https (445) - https (446)
- really (424) - really (424)
- computers (418) - computers (418)
- extremely (412) - extremely (413)
- actually (412)
- always (411) - always (411)
- first (409)
latest changes: latest changes:
``` ```
Date: Mon May 13 17:20:02 2024 +0200
coc.md
exercises.md
fsf.md
hexadecimal.md
jesus.md
kiss.md
name_is_important.md
programming_tips.md
random_page.md
wiki_pages.md
wiki_stats.md
Date: Sat May 11 20:41:35 2024 +0200 Date: Sat May 11 20:41:35 2024 +0200
ascii_art.md ascii_art.md
disease.md disease.md
@ -110,18 +122,6 @@ Date: Wed May 8 22:32:14 2024 +0200
gnu.md gnu.md
military.md military.md
needed.md needed.md
random_page.md
stereotype.md
sw.md
wiki_pages.md
wiki_stats.md
Date: Tue May 7 21:18:26 2024 +0200
21st_century.md
4chan.md
bloat.md
communism.md
debugging.md
exercises.md
``` ```
most wanted pages: most wanted pages:
@ -149,7 +149,7 @@ most wanted pages:
most popular and lonely pages: most popular and lonely pages:
- [lrs](lrs.md) (278) - [lrs](lrs.md) (279)
- [capitalism](capitalism.md) (211) - [capitalism](capitalism.md) (211)
- [c](c.md) (210) - [c](c.md) (210)
- [bloat](bloat.md) (200) - [bloat](bloat.md) (200)
@ -165,7 +165,7 @@ most popular and lonely pages:
- [programming](programming.md) (80) - [programming](programming.md) (80)
- [free_culture](free_culture.md) (80) - [free_culture](free_culture.md) (80)
- [gnu](gnu.md) (78) - [gnu](gnu.md) (78)
- [fun](fun.md) (78) - [fun](fun.md) (77)
- [math](math.md) (76) - [math](math.md) (76)
- [censorship](censorship.md) (75) - [censorship](censorship.md) (75)
- [public_domain](public_domain.md) (74) - [public_domain](public_domain.md) (74)

View file

@ -100,6 +100,7 @@ Here is a list of almost all historically notable women:
- **Judit Polgar**: best non-fictional female [chess](chess.md) player that at her peak managed the incredible feat of ranking #56 in the world while actually existing. - **Judit Polgar**: best non-fictional female [chess](chess.md) player that at her peak managed the incredible feat of ranking #56 in the world while actually existing.
- **[Marie Curie](marie_curie.md)**: this one was actually probably quite skilled and based, won two Nobel Prizes (at the time when there were no diversity quotas so it actually counts), though she probably stole most of her work from her husband. She was quite ugly tho. - **[Marie Curie](marie_curie.md)**: this one was actually probably quite skilled and based, won two Nobel Prizes (at the time when there were no diversity quotas so it actually counts), though she probably stole most of her work from her husband. She was quite ugly tho.
- **Lisa Nowak**: a female astronaut, military pilot, i.e. someone who would ideally be among those with highest mental stability and reliability, who nonetheless one day went on a rage frenzy over a sexual affair with some army chad, pepper sprayed some other bitch and was subsequently charged with attempted murder after weapons were found in her car... women... :D - **Lisa Nowak**: a female astronaut, military pilot, i.e. someone who would ideally be among those with highest mental stability and reliability, who nonetheless one day went on a rage frenzy over a sexual affair with some army chad, pepper sprayed some other bitch and was subsequently charged with attempted murder after weapons were found in her car... women... :D
- **Miss Marple**: smart woman detective, fictional.
- **Olga Hepnarova**: ran over 8 people with a truck, later executed. - **Olga Hepnarova**: ran over 8 people with a truck, later executed.
- **Yoko Ono**: destroyed the most famous music band in history. - **Yoko Ono**: destroyed the most famous music band in history.
- ... - ...