From 2cf32776c02c61e532b4bb3e898e825ee620b2c8 Mon Sep 17 00:00:00 2001 From: Miloslav Ciz Date: Thu, 26 Oct 2023 22:28:40 +0200 Subject: [PATCH] Update --- programming.md | 8 ++++---- programming_language.md | 22 ++++++++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/programming.md b/programming.md index 1374894..0550a6c 100644 --- a/programming.md +++ b/programming.md @@ -2,11 +2,11 @@ *Not to be confused with [coding](coding.md).* -Programming is the act, [science](science.md) and [art](art.md) of writing computer [programs](program.md); it involves creation of [algorithms](algorithm.md) and [data structures](data_structure.md) and implementing them in [programming languages](programming_language.md). +Programming is the act, [science](science.md) and [art](art.md) of writing computer [programs](program.md); it involves creation of [algorithms](algorithm.md) and [data structures](data_structure.md) and implementing them in [programming languages](programming_language.md). It may involve related activities such as [testing](testing.md), [debugging](debugging.md), [hacking](hacking.md) and drinking coffee. -You may also encounter the term [coding](coding.md) which is used by [noob](noob.md) [wannabe programmers](soydev.md), so called "coders" or [code monkeys](code_monkey.md). "Coding" doesn't reach the quality of programming, it is done in baby handholding languages like [Python](python.md), [JavaScript](javascript.md) or [Rust](rust.md) by people with very shallow knowledge of technology and its context, barely qualified to turn on a computer (like [jewtubers](youtube.md)), who have flooded the computer industry since it became lucrative. What they do is not real programming. Do not try to imitate them. +You may also encounter the term [coding](coding.md) which is used by [noob](noob.md) [wannabe programmers](soydev.md), so called "coders" or [code monkeys](code_monkey.md). "Coding" doesn't reach the quality of programming, it is done in baby handholding languages like [Python](python.md), [JavaScript](javascript.md) or [Rust](rust.md) by people with very shallow knowledge of technology and its context, barely qualified to turn on a computer (like [jewtubers](youtube.md)), who have flooded the computer industry since it became lucrative. It is mostly done for money and/or creating an image for oneself. What they do is not real programming. Do not try to imitate them. -At high level programming becomes [spiritual](spirituality.md). Check out e.g. the famous [Tao of Programming](tao.md) (yes, it's kind of a [joke](jokes.md) but it's based on reality, programming can truly be kind of a [meditation](meditation.md) and pursuit of enlightenment). Many people say that learning programming opens your eyes in a certain new way, you then see the world like never before (but that's probably kind of true of almost all skills so this may be a [shit](shit.md) statement). Others say too much programming cripples you mentally and gives you [autism](autism.md). Anyway it's [fun](fun.md). Programming requires a good knowledge of advanced [math](math.md). Also probably at least above average [IQ](iq.md), as well as below average social intelligence. Being a [man](man.md) is an advantage. +At high level programming becomes [spiritual](spirituality.md). Check out e.g. [zen](zen.md) and the famous [Tao of Programming](tao.md) (yes, it's kind of a [joke](jokes.md) but it's rooted in the reality of a common hacker's mindset, programming can truly be kind of a [meditation](meditation.md) and pursuit of enlightenment, often leading one to asking deeper questions about the world). Many people say that learning programming opens your eyes in a certain new way, you then see the world like never before (but that's probably kind of true of almost all skills taken to a high level so this may be a [shit](shit.md) statement). Others say too much programming cripples you mentally and gives you [autism](autism.md). Anyway it's [fun](fun.md). Programming requires a good knowledge of advanced [math](math.md). Also probably at least above average [IQ](iq.md), as well as below average social intelligence. Being a [white](white.md) [man](man.md) is an advantage. ## How To Learn Programming And Do It Well @@ -14,7 +14,7 @@ At high level programming becomes [spiritual](spirituality.md). Check out e.g. t The key thing to becoming a programmer is learning a [programming language](programming_language.md) very well (and learning many of them), however this is not enough (it's only enough for becoming a coding monkey), you additionally have to have a wider knowledge such as general knowledge of computers ([electronics](electronics.md), [hardware](hardware.md), theory or computation, [networks](networking.md), ...), tech [history](history.md) and culture ([free software](free_software.md), [hacker cutlure](hacking.md), [free culture](free_culture.md), ...), [math](math.md) and [science](science.md) in general, possibly even society, philosophy etc. Programming is not an isolated topic (only coding is), a programmer has to see the big picture and have a number of other big brain interests such as [chess](chess.md), voting systems, linguistics, physics, music etc. Remember, becoming a good programmer takes a whole life, sometimes even longer. -**Can you become a good programmer when you're old?** Well, as with everything to become a SERIOUSLY good programmer you should have probably started before the age of 20, the majority of the legend programmers started before 10, it's just like with sports or becoming an excellent musician. But with enough enthusiasm and endurance you can become a pretty good programmer at any age, just like you can learn to play an instrument or run marathon basically at any age, it will just take longer and a lot of energy. You don't even have to aim to become very good, becoming just average is enough to write simple gaymes and have a bit of fun in life :) Just don't try to learn programming because it seems cool, because you want to look like movie haxor, gain followers on youtube or because you need a job -- if you're not having genuine fun just thinking before sleep about how to swap two variables without using a temporary variable, programming is probably not for you. +**Can you become a good programmer when you're old?** Well, as with everything to become a SERIOUSLY good programmer you should have probably started before the age of 20, the majority of the legend programmers started before 10, it's just like with sports or becoming an excellent musician. But with enough enthusiasm and endurance you can become a pretty good programmer at any age, just like you can learn to play an instrument or run marathon basically at any age, it will just take longer and a lot of energy. You don't even have to aim to become very good, becoming just average is enough to write simple gaymes and have a bit of fun in life :) Just don't try to learn programming because it seems cool, because you want to look like movie haxor, gain followers on youtube or because you need a job -- if you're not having genuine fun just thinking before sleep about how to swap two variables without using a temporary variable, programming is probably not for you. **Can you become a good programmer if you're black or [woman](woman.md)?** No. :D Ok, maybe you can, but all the above applies, don't do it for politics or money or followers -- if you become a seriously based programmer (from [LRS](lrs.md) point of view) of unlikely minority, we'll be more than happy to put an apology here, in ALL CAPS and bold letters :) Hopefully this will inspire someone... **Which programming language to start with?** This is the big question. Though languages such as [Python](python.md) or [JavaScript](javascript.md) are objectively really REALLY bad, they are nowadays possibly the easiest way to get into programming, so you may want to just pick one of these two, knowing you'll abandon it later to learn a true language such as [C](c.md) (and knowing the bad language will still serve you in the future in some ways, it's not a wasted time). Can you start with C right away? It's probably not impossible for a genius but it will be VERY hard and you'll most likely end up failing, overwhelmed, frustrated and never returning to programming again. Absolutely do NOT even consider [C#](c_sharp.md) (shit, unusable), [Java](java.md) (shit, slow, bloated, unusable), [C++](cpp.md) (like C but shit and more complicated), [Haskell](haskell.md) (non-traditional, hard), [Rust](rust.md) (shit, bad design, unusable), [Go](go.md) (prolly hard), [Lisp](lisp.md) (non-traditional), [Prolog](prolog.md) (lol) and similar languages -- you may explore these later. Whichever language you pick for the love of god **avoid [OOP](oop.md)** -- no matter what anyone tells you, when you see a tutorial that uses "classes"/"objects" just move on, learn normal [imperative](imperative.md) programming. OOP is a huge pile of shit meme that you will learn anyway later (because everyone writes it nowadays) so that you see why it's shit and why you shouldn't use it. diff --git a/programming_language.md b/programming_language.md index 60e90d9..2fb7991 100644 --- a/programming_language.md +++ b/programming_language.md @@ -1,25 +1,31 @@ # Programming Language -Programming language is an artificial [language](formal_language.md) created so that humans can relatively easily communicate [algorithms](algorithm.md) to [computers](computer.md). Such language often tries to mimic human language (practically always [English](english.md)) but is much MUCH simpler so that a computer can actually analyze it and understand it precisely so it also partially looks like [math](math.md) expressions. A programming language can be seen as a middle ground between pure machine code (very hard to handle by humans) and natural language (very hard to handle by computers). +Programming language is an artificial [formal](formal.md) (mathematically precise) [language](formal_language.md) created in order to allow humans to relatively easily write [algorithms](algorithm.md) for [computers](computer.md). It allows a human to very specifically and precisely tell computer what to do. Such language often tries to mimic human language (practically always [English](english.md)) so as to be somewhat close to humans but is also much MUCH simpler so that a computer can actually analyze it and understand it precisely, without ambiguity, so in the end it also partially looks like [math](math.md) expressions. A programming language can be seen as a middle ground between pure [machine code](machine_code.md) (the computer's native language, very hard to handle by humans) and natural language (very hard to handle by computers). For beginners: a programming language is actually much easier to learn than a foreign language, it will typically have fewer than 100 "words" to learn (out of which you'll mostly use like 10) and once you know one programming language, learning another becomes a breeze because they're all (usually) pretty similar in basic concepts. The hard part may be learning some of the concepts. -A programming language is distinct from a general computer language by its purpose to express algorithms and be used for creation of [programs](program.md). There are computer languages that are NOT programming languages (at least in the narrower sense), such as [HTML](html.md), [json](json.md) and so on. +A programming language is distinct from a general computer language by its purpose to express algorithms and be used for creation of [programs](program.md). This is to say that there are computer languages that are NOT programming languages (at least in the narrower sense), such as [HTML](html.md), [json](json.md) and so on. We divide programming languages into different groups. Perhaps the most common divisions is to two groups: -- **compiled** languages: Meant to be transformed by a [compiler](compiler.md) to a [native](native.md) (directly executable) binary program. These languages are more efficient but usually more difficult to program in, less flexible and the compiled programs are non-portable (can't just be copy-pasted to another computer with different [architecture](isa.md) and expected to run). These languages are usually [lower level](low-level), use static and strong [typing](typing.md) and manual [memory management](memory_management.md). Examples: [C](c.md), [C++](cpp.md), [go](go.md), [rust](rust.md), [Haskell](haskell.md) or [Pascal](pascal.md). -- **interpreted** languages: Meant to be interpreted by an [interpreter](interpreter.md) "on-the-go". Basically to run the program you need the interpreter of the language installed on your computer and this interpreter reads the [source code](source_code.md) as it is written and performs what it dictates. These languages are generally less efficient (slower, use more RAM) but also more flexible, easier to program in and [independent of platforms](platform_independent.md). These languages usually [higher-level](high_level.md), use weak and dynamic [typing](typing.md) and automatic [memory management](memory_management.md) ([garbage collection](garbage_collection.md)). Examples: [Python](python.md), [Perl](perl.md), [JavaScript](js.md) and [BASH](bash.md). +- **compiled** languages: Meant to be transformed by a [compiler](compiler.md) to a [native](native.md) (directly executable) binary program, i.e. before running the program we have to run it through the process of compilation into runnable form. These languages are typically more efficient but usually more difficult to program in, less flexible and the compiled programs are non-portable (can't just be copy-pasted to another computer with different [architecture](isa.md) and expected to run; note that this doesn't mean compiled languages aren't [portable](portability.md), just that the compiled EXECUTABLE is not). These languages are usually [lower level](low-level), use static and strong [typing](typing.md) and more of manual [memory management](memory_management.md). Examples: [C](c.md), [C++](cpp.md), [go](go.md), [Haskell](haskell.md) or [Pascal](pascal.md). +- **interpreted** languages: Meant to be interpreted by an [interpreter](interpreter.md) "on-the-go", i.e. what we write we can also immediately run. To run such program you need the interpreter of the language installed on your computer and this interpreter reads the [source code](source_code.md) as it is written and performs what it dictates (well, this is actually simplified as the interpreter normally also internally does a kind of quick "lightweight" compilation, but anyway...). These languages are generally less efficient (slower, use more RAM) but also more flexible, easier to program in and [independent of platforms](platform_independent.md). These languages usually [higher-level](high_level.md), use weak and dynamic [typing](typing.md) and automatic [memory management](memory_management.md) ([garbage collection](garbage_collection.md), ...). Examples: [Python](python.md), [Perl](perl.md), [JavaScript](js.md) and [BASH](bash.md). -Sometimes the distinction here may not be completely clear, for example Python is normally considered an interpreted language but it can also be compiled into [bytecode](bytecode.md) and even native code. [Java](java.md) is considered more of a compiled language but it doesn't compile to native code (it compiles to bytecode). [C](c.md) is traditionally a compiled language but there also exist C interpreters etc. +Sometimes the distinction here may not be completely clear, for example Python is normally considered an interpreted language but it can also be compiled into [bytecode](bytecode.md) and even native code. [Java](java.md) is considered more of a compiled language but it doesn't compile to native code (it compiles to bytecode). [C](c.md) is traditionally a compiled language but there also exist C interpreters. [Comun](comun.md) is meant to be both compiled and interpreted etc. We can divide language in many more ways, for example based on their **[paradigm](paradigm.md)** ([impertaive](imperative.md), [declarative](declarative.md), [object-oriented](oop.md), [functional](functional.md), [logical](logical.md), ...), **purpose** (general purpose, special purpose), computational power ([turing complete](turing_complete.md) or weaker), level of **[abstraction](abstraction.md)** (high, low), [typing](data_type.md) (strong, weak, dynamic, static) or function evaluation (strict, lazy). +A computer language consists from two main parts: + +- **[syntax](syntax.md)**: The grammar rules and words, i.e. how the language "looks", what expressions we are allowed to write in it. Syntax says which words can follow other words, if indentation has to follow some rules, how to insert comments in the source code, what format numbers can be written in, what kinds of names variables can have etc. Syntax is the surface part, it's often considered not as important or hard as semantics (e.g. syntax errors aren't really a big deal as the language processor immediately catches them and we correct them easily), but a good design of syntax is nevertheless still very important because that's what the programmer actually deals with a great amount of time. +- **[semantics](semantics)**: The meaning of what we write, i.e. semantics says what the syntax actually stands for. E.g. when syntax says it is possible to write `a / b`, semantics says this means the mathematical operation of division and furthermore specifies what *a* and *b* can actually be, what happens if *b* is zero etc. Semantics is the deeper part as firstly it is more difficult to define and secondly it gives the language its [features](feature.md), its power to compute, usability, it can make the language robust or prone to errors, it can make it efficient or slow, easy and hard to compile, optimize etc. + ## Nice Languages { *THIS IS NOT A COMPREHENSIVE LIST, I can only include languages that I am familiar with, please add more* ~drummyfish } -- [C](c.md): the one and only, the go-to language of the [suckless](suckless.md) community and of compiled languages in general, greatly [future-proof](future_proof.md), uncontested in performance and with nice oldschool [meme](meme.md)-free design, our beloved C +- [Brainfuck](brainfuck.md): However funny and meme this language may look, its simple design is actually pretty beautiful and interpreters are ultra extremely simple to make. It is a GOOD language. +- [C](c.md): The one and only, the go-to language of the [suckless](suckless.md) community and of compiled languages in general, greatly [future-proof](future_proof.md), uncontested in performance and with nice oldschool [meme](meme.md)-free design, our beloved C. It has many flaws, but has stood as the best practically used language, and is also [historically](history.md) most significant. - [Comun](comun.md): official [LRS](lrs.md) language - [Scheme](scheme.md): the minimal/elegant member of [lisp](lisp.md) family of [functional](functional.md) languages - [Forth](forth.md): beautifully simple stack-based language @@ -27,9 +33,9 @@ We can divide language in many more ways, for example based on their **[paradigm - [LIL](lil.md): very nice KISS & [suckless](suckless.md) interpreted language - [Lua](lua.md) - [Sigma calculus](sigma_calculus): yes or no? seems like yes -- [Brainfuck](brainfuck.md): However funny and meme this language may look, its simple design is actually pretty beautiful and interpreters are ultra extremely simple to make. ## See Also - [esoteric programming language](esolang.md) -- [constructed language](conlang.md) \ No newline at end of file +- [constructed language](conlang.md) +- [compiler](compiler.md) \ No newline at end of file