You can’t really use Word because the way it saves the text in the document is too “formatted” for use as code. You can use something like Notepad that can create basic text files that are just a collection of ASCII characters. However, everyone today uses dedicated code editors like Atom, VS Code, or Sublime because they all have extra features that help a lot with writing code. Do not actually use Notepad to write code it is a horrible experience.
After you write the file, you have to run it through special programs depending on the language you’re using. They can be interpreters (for languages like Python and JavaScript), compilers (for C/C++, Fortran, etc) or assemblers (for assembly). They take the text you wrote and turn it into something computers can understand and run.
Interpreted languages are usually based on compiled language, which are based on assembled languages, which are based on binary, which act directly on your hardware
Yes, a programmer just writes a bunch of text in a plain text file. Word doesn’t edit plain text files as far as I know, but you can use Notepad. Most programmers use fancier text editors with special features to help them, but they’re still just text editors.
Once you have a text editor you can use a program called an “interpreter” that will read the text file and do what it says (so long as it’s written correctly). Or you can use a program called a “compiler” which will turn your text file into binary gibberish that can be run by the processor. All executables on your computer are composed of this same binary gibberish.
Ok – this is a question with lots of layers and lots of approaches. I’ll stick to using an existing programming language (your pick) and describe the methodology I’ve used to build things.
You want your program to do something. To do that thing, it needs input(s) from somewhere, and does something to make an output. Now that, but for many combinations of inputs and outputs. OK time to simplify….
I sketch out a flow chart showing where things are coming from, going to, and the operations being done on them. Now I realize my inputs need to be tested in case the format is wrong or the data is out of bounds. I’m looking for ways to test the things I want done to see they wind up with valid outputs.
Time to start coding. I need a way to request the data from the source, or respond while waiting for an input. More tests. Data valid? Test. Which action to take? More tests. Action does this. Check to see if results valid. Test. Pass output to next link in the chain (output, or more actions). And while you’re testing, create exits to deal with invalid data.
Lather, rinse, repeat. Design it well, and you get a general purpose process that you can feed endlessly and receive valid output for a variety of conditions and inputs. X + Y = Z Any valid X and Y will (should) give you a valid Z. Test!
And so on, until you’ve built all the steps needed to go from start to finish, while reusing as much code (loops, etc) as possible.
Than help?
It depends.
The starting point is deciding what tool(s) you want to use. Some examples:
– C#
– Java
– Python
– JavaScript
Each has their own specific set of rules, structures, syntax, etc. At its most basic level, yes it really is as simple as opening a text document and start writing. So long as you obey the rules, you need no other tools to write and execute code.
IDEs (Integrated Development Environments) are additional tools which help you write, build and run your code. Sometimes they are specific to a language or set of language. Visual Studio for example is great for C#, C++, TypeScript. IntelliJ is great for Java. PyCharm for Python.
Trying to keep this at the 5yo level….
At a high level the answer to your question is yes. The vast majority of computer programs (everything from a web page to an app on your phone) start life as a series of text files written by a human.
While it would be possible to do all that in MS Word and just save all the files as plain text with the right names in the right places, that’s not the best tool for the job, so we tend to use different text editors to create and organize those text files.
These tools make it quicker to write the text (or code as we call it), because a lot of the text we write is made up of some common patterns of words and symbols. Typing those same patterns out over and over would be repetitive, so we use tools that auto complete for us. In addition for some types of programs, there are a lot of files that are almost the same for every program you write, so the tools we use spilt out those files automatically and we just change a couple of lines here and there, rather than have to type the whole thing out every time.
You know how MS Word has tools like spellcheck to highlight when you’ve made a spelling error? The editors we use have a different set of tools that highlight when we’ve made mistakes, and they use different colors to show different types of code to make it easier for us to recognize.
The tools we use just make writing the text easier, we still end up typing out the vast majority of it though.
Dude I’ve been wondering the same thing forever and a half. When I went to uni, they taught c#. Never used it. If you’re trying to do web dev, html is where you start. Most applications can be made with something like react. It really depends on what your programming agendas are, then figure out the HUGE list of different options and picking a starting point. Different industries use different stuff and a lot of it is OG not normally used by people anymore and is super outdated. That’s the other biatch of learning to program: things get outdated fast! So you’ll have to figure out what software platforms support what version of whatever language. Dude, it’s hard to get into (for me at least). I would suggest finding some kind of mentor/ teacher to help guide you towards your goals.
Trying to ELI5:
At my job, we have a computer that has a program, that can read and execute other programs.
We can just open notepad, type in the proper commands, upload it to the machine and the machine is gonna execute your program.
That machine has an address and can show the result of your program in a browser
<?php echo “Hello World!”; ?>
This would write the text, hello world in your browser
—
It is all programs upon programs upon programs. The root of it all is written with 0s and 1s, machine code.
So as other posters say for some languages you can just start typing away in a text editor, but other times you have special editing programs (Integrated Development Environments, IDEs for short) that help you write a program.
To illustrate one of these IDEs [here’s a screenshot of what you get in Visual Studio when you create a new Windows application project](https://i.imgur.com/NurdnUQ.png). It creates some standard files like a file containing an empty program window for you to build your UI in, an empty code file to write your program’s logic in, and some pre-generated code to start the application up and open the window up.
Technically you could write all of this from scratch, but it saves a bit of time to have everything ready for you and the IDE has nice features like coloring in different parts of your code, previewing the window UI etc.
nobody writes code from scratch anymore – they write code using code someone else wrote which was written using code someone else wrote etc, building on top of it.
A bit like how you don’t build a house from scratch; someone else makes the bricks, someone else makes the roof tiles, the plaster, chops the wood into planks etc.
Latest Answers