Run all submissions through a spell checker.

This commit is contained in:
Solderpunk 2021-07-11 11:32:57 +00:00
parent 00108d7615
commit f4481f40f7
1 changed files with 15 additions and 15 deletions

View File

@ -2,9 +2,9 @@
I am a big believer in making your own tools *when possible*. For example, I do not have the ability to make a computer processor myself (well, not the kind used in modern general purpose computers), but I do have the ability to learn to program software that will run on that chip.
This, of course, can extend beyond computing: making a jig when working with wood, making potery or baskets, sewing, etc. The way the world is at present, or maybe always, it is hard to control the whole chain. You likely have to acquire something to do the making: a hammer, a needle and thread, etc.
This, of course, can extend beyond computing: making a jig when working with wood, making pottery or baskets, sewing, etc. The way the world is at present, or maybe always, it is hard to control the whole chain. You likely have to acquire something to do the making: a hammer, a needle and thread, etc.
With computers it is comparitively easy to make things once you have a general purpose computer. Every operating system I can think of allows for some type of programming of applications and/or the system itself. Once you have a system you can create an endless array of tools for yourself, or modify ones that already exist. You could even code a bootloader and an operating system if you were so inclined.
With computers it is comparatively easy to make things once you have a general purpose computer. Every operating system I can think of allows for some type of programming of applications and/or the system itself. Once you have a system you can create an endless array of tools for yourself, or modify ones that already exist. You could even code a bootloader and an operating system if you were so inclined.
I believe just about anyone can do this (write applications for computers), if they are so inclined. This is not something solely available to C programming wizards that have been doing it for decades. There are lots of easy to approach programming languages and environments for people new to the concepts.
@ -42,22 +42,22 @@ Both of the above are interpreted languages. To run any programs written with th
There are also compiled languages. These languages use a compiler (another program that converts the code you write into lower level code of some sort - it varies from compiler to compiler. Once a program is compiled it can generally be run without needing to have the language installed on the system or invoking and interpreter). Most programs on your system were likely written in the programming language 'C'. This is a fairly old programming language that I do not generally recommend as a first language to people these days. It is VERY powerful, but can be harder to reason about than Python or Lua, especially for a beginner. It can also be tricky to find actionable information on. There are a number of compiler and library implementations, and they may vary in how they are used. The language features and available functions/macros can also vary from OS to OS and architecture to architecture.
'Rust' is a newer programming language that can work in similar domains to 'C'. But it is a complicated language in comparrison the the others being recommended here. The programs it creates, when coded well, can be really solid and safe (from a memory standpoint)... but it can be a lot for someone just starting out.
'Rust' is a newer programming language that can work in similar domains to 'C'. But it is a complicated language in comparison the the others being recommended here. The programs it creates, when coded well, can be really solid and safe (from a memory standpoint)... but it can be a lot for someone just starting out.
As such, I tend to recommend learning Go as a first compiled language:
=> https://go.dev/learn/ Go
Go is a more modern compiled langauge. It differs from C in a number of ways, that mostly make it easier for you to program... but make it less suitable for certain types of applications (anything where garbage collection would be a problem - but that won't be an issue for 99% of people learning to program). The documentation is fantastic and the code is easy to reason about. The built-in library is almost as complete as Python's (though there is no direct help with GUI programming built in).
Go is a more modern compiled language. It differs from C in a number of ways, that mostly make it easier for you to program... but make it less suitable for certain types of applications (anything where garbage collection would be a problem - but that won't be an issue for 99% of people learning to program). The documentation is fantastic and the code is easy to reason about. The built-in library is almost as complete as Python's (though there is no direct help with GUI programming built in).
All of the links provided above are to "Getting Started" instructions. Again, the language doesn't matter so much. If you see something out there other than one of these three that tickles your fancy and have found readable documentation that makes some level of sense to you: go for it!! I just recommend these three to give novices somewhere to start.
You may have noticed I did not include JavaScript. This is intentional. I do not think it is a good place to start. The ecosystem is complicated and the tooling is difficult. To effectively use JavaScript in a modern way in a browser you will likely need to learn HTML and CSS along with JavaScript. Additionally, it has become trendy to use various frameworks and libraries rather than just writing JavaScript code (using React, Vue, Angular, Svelt, jQuery, etc). These extra things to learn can make approaching JavaScript as a beginner confusing and difficult and may create long term confusion about some basic programming concepts. It is also hrder to look up documentation due to the wide variety of frameworks that people work in. While you could use nodeJS to build console applications like you would when starting out with Python or Lua, I just feel like nodeJS is not as good as Lua or Python and that its ecosystem is terrible (opinions on this will vary, and I am just giving you mine).
You may have noticed I did not include JavaScript. This is intentional. I do not think it is a good place to start. The ecosystem is complicated and the tooling is difficult. To effectively use JavaScript in a modern way in a browser you will likely need to learn HTML and CSS along with JavaScript. Additionally, it has become trendy to use various frameworks and libraries rather than just writing JavaScript code (using React, Vue, Angular, Svelt, jQuery, etc). These extra things to learn can make approaching JavaScript as a beginner confusing and difficult and may create long term confusion about some basic programming concepts. It is also harder to look up documentation due to the wide variety of frameworks that people work in. While you could use nodeJS to build console applications like you would when starting out with Python or Lua, I just feel like nodeJS is not as good as Lua or Python and that its ecosystem is terrible (opinions on this will vary, and I am just giving you mine).
You may also notice, if you have experience in such things, that I have not included any sort of shell programming (bash, fish, zsh, etc. scripting). While these options can be very useful for system automation and can even be used to make larger programs... their syntax is often not clear and the ability to just call as if in the shell is unlike most of the rest of the programming world. They might be something good for people to look into, but not a great choice as a first language as I think they would create some misunderstandings and possibly bad habbits.
You may also notice, if you have experience in such things, that I have not included any sort of shell programming (bash, fish, zsh, etc. scripting). While these options can be very useful for system automation and can even be used to make larger programs... their syntax is often not clear and the ability to just call as if in the shell is unlike most of the rest of the programming world. They might be something good for people to look into, but not a great choice as a first language as I think they would create some misunderstandings and possibly bad habits.
There will likely be many opinions that disagree with me and encourage starting with Rust, C, or some functional language (Haskell, Clojure, Elixir, Erlang) or other. All of these languages are powerful languages that can be really great to work with. I have made my recommendations based on my experience and a desire to allow someone to "dip a toe in". Not everyone needs to become a systems programmer, and my advice is really geared toward people that just want to try out coding to see what it is all about. In earlier times BASIC or Pascal would have been recommended for this purpose, but those days are largely past us. I think Python, Lua, and Go are sensible choices for someone to try things out.
@ -66,7 +66,7 @@ There will likely be many opinions that disagree with me and encourage starting
Once you have followed the installation instructions for the language you have chosen, you will likely need to open a terminal window.
Many folks that do not program may not know much about terminals (on any modern system it will liekly be a terminal emulator... but you dont need to worry about that). Each of the major operating systems includes some textual interface to the system. On OSX the application is "Terminal.app". On Linux or BSD there will be a terminal of some form, but its name will vary by distribution/os (gnome-terminal will be present on ubuntu, for example). On windows, if memory serves correctly, it is called "Cmd.exe", but dont quote me on that (I have not used a Windows machine, even in passing, for over a decade).
Many folks that do not program may not know much about terminals (on any modern system it will likely be a terminal emulator... but you don't need to worry about that). Each of the major operating systems includes some textual interface to the system. On OSX the application is "Terminal.app". On Linux or BSD there will be a terminal of some form, but its name will vary by distribution/os (gnome-terminal will be present on ubuntu, for example). On windows, if memory serves correctly, it is called "Cmd.exe", but don't quote me on that (I have not used a Windows machine, even in passing, for over a decade).
Once the terminal is open you will be presented with a prompt of some sort (likely ending in '$', '#', or '>', but that is not a rule). You can type commands at this prompt and get output. On Linux/BSD/OSX type 'ls' and press enter; on Windows type 'dir' and press enter. You should see a list of files in the current folder. You entered the name of a program: 'ls'/'dir'. This program takes your current directory and loops over all of the files in the directory and outputs their names. It then exits, returning control to the terminal (actually the shell, which is running inside of the terminal, but lets not get ahead of ourselves).
@ -92,7 +92,7 @@ Then you can run 'ls' to see any files or subfolders you may want to work on/in.
You now have a place to work on programs. You can navigate to this folder in a graphical file browser as well.
Now you are ready to write a program... but you need something to write it with. Using 'MS Word' or OSX's 'Pages' will not work. Those are word procesors that use their own document formats as output. You want to work in so-called 'plain text'.
Now you are ready to write a program... but you need something to write it with. Using 'MS Word' or OSX's 'Pages' will not work. Those are word processors that use their own document formats as output. You want to work in so-called 'plain text'.
There are editors for your terminal as well as graphical editors. For simple things using Windows' 'Notepad' or OSX's 'TextEdit' can work fine for this purpose in a pinch, but using an actual code editor will provide many useful things to you, including automatic coloring of various words and structures in your given programming language to make the code easier to read.
@ -110,7 +110,7 @@ For those that are used to terminal environments and have used them before, or f
Both of them offer graphical versions as well as terminal versions. But neither are as simple as just opening it up and typing. They require you to learn lots of commands and key combinations to use them. They offer very powerful editing capabilities for coding and other writing, but may not be a good place to start if you are not familiar with them. Vim is likely installed on your system and can be invoked by typing 'vim', followed by an optional filename, at the shell. You will immediately notice that it does not respond like you are used to when keys are pressed. It is a common joke that vim, or its predecessor 'vi' (also likely on your system), traps people in it if they don't already know how to use it. If you end up in one of them and can't get out, type: ':q!'. I have less experience with emacs, but it is not without a steep learning curve as well.
Once you pick and editor and a language and get them both isntalled you may want to try running a program. Here are some very basic example programs that you can type into a file for each of the three languages I recommended above:
Once you pick and editor and a language and get them both installed you may want to try running a program. Here are some very basic example programs that you can type into a file for each of the three languages I recommended above:
### Python Example File
@ -190,7 +190,7 @@ go build
./go_hello
```
You may notice that running the program is a little different here. We call `go buil` first. This compiles the program into an executable file. We then run that file by giving the shell the path to the file ('./' just means "inside the current directory").
You may notice that running the program is a little different here. We call `go build` first. This compiles the program into an executable file. We then run that file by giving the shell the path to the file ('./' just means "inside the current directory").
That file will run on any system with the same OS and Processor architecture (there are maybe two or three in common consumer usage at present, though retrocomputing enthusiasts or people on the cutting edge may have others). This is a cool benefit of using go: you could just share that file (or output one that works on a friends machine) and they do not need to have Go installed on their system at all.
@ -205,17 +205,17 @@ I, for example, am writing this in a text editor I wrote. That editor is being r
Not everyone needs to go to the trouble of all of that, but I can certainly say I have enjoyed it. I know how these programs work (again, at a reasonable abstraction level) and can change them when they do something I don't want them to. They are sometimes buggy, but they get better each time I add to the code.
For first projects I recommend thinking about the tasks that you do on computers or in life a lot. Think about what could benefit from automation or data storage/retrieval. Perhaps you read a lot and want to keep track of what you have read? A simple system to store and recall books by genre, author, title, or rating should be fairly easy to construct (with or without a database). Perhaps you write on gopher or gemini a lot and want to create a tool that converts your documents to HTML? Or maybe you like games? Converting a baord game to a terminal game is a great way to start learning to code. Creating a game for two human players is easier, since you don't need to program a "player" for the game.
For first projects I recommend thinking about the tasks that you do on computers or in life a lot. Think about what could benefit from automation or data storage/retrieval. Perhaps you read a lot and want to keep track of what you have read? A simple system to store and recall books by genre, author, title, or rating should be fairly easy to construct (with or without a database). Perhaps you write on gopher or gemini a lot and want to create a tool that converts your documents to HTML? Or maybe you like games? Converting a board game to a terminal game is a great way to start learning to code. Creating a game for two human players is easier, since you don't need to program a "player" for the game.
Here are some steps for thinking about how to code your first bigger application:
* Come up with the idea
* Understand the problem well, and think out a few different ways to solve it (from a high level perspective, not in code)
* Think about what the inputs and outputs are (often text, but sometimes numbers, or key presses). Think about how they could best be represented in your code. How you structure data will be among the most important things in your code, and there are LOTS of options, from simple variables tp arrays, structs, objects, databases, etc.
* Think about what the inputs and outputs are (often text, but sometimes numbers, or key presses). Think about how they could best be represented in your code. How you structure data will be among the most important things in your code, and there are LOTS of options, from simple variables to arrays, structs, objects, databases, etc.
* Once you have a basic sense of how you will be holding onto and thinking about your inputs/data, you can start to reason about working with that data. This could be a good point to write out a flow chart in plain english for how you think things should flow through your program... or you could just start coding and see what happens. Either way will provide good lessons.
* Start coding! Where possible try running your program as you reach different milestones. Sometimes things will break, most interpreters or compilers will give you a message telling you what line something is broken on and, hopefully, a hint about how to fix it. Get good at reading this output.
* An easy way to test as you develop, that some people frown on but I think is invaluable, is to print out text/variables at various places so you can see that your code is being executed as you think. You can print data or just information text (ie. "made it out of loop" or "got into 'x' function"). Be sure to delete these when you are done using them. Dont rely too much on them, but for a quick sanity check they can be useful. Many languages have testing suites and tooling for debugging that you may want to look into as well.
* Remember that it is an itterative process and you will likely rewrite parts of applications or sometimes the whole thing. This is a normal part of working on a project, even for experienced developers.
* An easy way to test as you develop, that some people frown on but I think is invaluable, is to print out text/variables at various places so you can see that your code is being executed as you think. You can print data or just information text (ie. "made it out of loop" or "got into 'x' function"). Be sure to delete these when you are done using them. Don't rely too much on them, but for a quick sanity check they can be useful. Many languages have testing suites and tooling for debugging that you may want to look into as well.
* Remember that it is an iterative process and you will likely rewrite parts of applications or sometimes the whole thing. This is a normal part of working on a project, even for experienced developers.
If you find you are stuck, there are resources online. Stack Overflow is a code help site where you can post questions and get answers. Your question may have already been asked, so you could search for it.
@ -228,7 +228,7 @@ If you want, feel free to reach out to me: <sloum AT THE HOST rawtext.club>.
## Wrapping Up
This started out as a writeup about creating the tools you use, and turned into more of a "how to get started coding". I know it is cursory at best, but hopefully has some information useful to someone. I know there are a lot of people out there that want to learn how to do these things and may feel overwhelemed by the sheer volume of information and all of the options. We are living in a time of plenty in many respects with regard to languages, libraries, frameworks, tutorials, opinions, etc. Though there is less variety now in the systems themselves (a shame).
This started out as a writeup about creating the tools you use, and turned into more of a "how to get started coding". I know it is cursory at best, but hopefully has some information useful to someone. I know there are a lot of people out there that want to learn how to do these things and may feel overwhelmed by the sheer volume of information and all of the options. We are living in a time of plenty in many respects with regard to languages, libraries, frameworks, tutorials, opinions, etc. Though there is less variety now in the systems themselves (a shame).
The key thing is to try and have fun, but expect there to be some hurdles and roadblocks. I think programming appeals a lot to people who like to solve puzzles and ponder different ways of doing things. If this describes you, then you may enjoy programming. It can be a useful skill, but it can also just be a fun skill that could serve the same role as solving sudoku puzzles for someone, but with the added benefit of creating something cool or interesting. However you come to it, you may be starting down what could become a lifelong obsession. It has been for me (I started coding with BASIC as a kid in the late 80s).