C Programming Language
Linux was originally written in C. Although there is a lot of code written in other languages added to Linux, like Perl and Python, C is Linux’s native language.
Exploring and learning an elementary understanding of C first, will make it a lot easier for you to learn other programming skills, such as shell scripting and learning other programming languages.
I highly recommend that you start your deep dive into learning how Linux works, by getting yourself a recent C Programming text book and reading it. Seek the truth about computer science in general and the C Programming Language in particular.
Its going to take work. Reading these manuals is a lot like reading a dictionary, not a very interesting story. This is not a get rich quick scheme. It is a work fast, work smart and work safely, to produce something valuable to trade in our one worldwide free marketplace, and to live long and prosper (Spock, 1965) scheme.
Holistic Home Office is teaching you to create your own private enterprise, rather than get a job in someone else’s private enterprise. While teaching you how to get a job as a computer programmer is not the goal of this story, learning any one of these languages will open up opportunities for you to get a good paying job as a software engineer. And getting a job doing that, is one good way to learn how to be a high-performance computer scientist.
Learning C Programming
There are two kinds of development environment, interpreted and compiled. QML, Javascript and Python are interpreted. C and C++ are compiled. C# is an intermediate form that is compiled into an Intermediate Language and then “jitted,” (Just In Time (JIT)), into Assembly Language.
Interpreted programs are dynamic, because each line is evaluated and executed as soon as it is entered, and the results are immediately returned to the console.
Compiled programs are compiled all at once and run as a whole program. Compiled programs usually execute faster, because the compilation of the program runs separately from the interpretation of the program.
C source code files have a .c file extension. A .h extension indicates a C header file. Header files are the #include statements at the beginning of C programs, which call in resources from other libraries.
For Linux, GCC is your main library. It is the GNU Compiler Collection. It includes the compiler, clang, make and many other applications and libraries that you can use to run C programs.
The compiler takes your source code, and the .c and .h files, as input and translates them into machine language. It links all the various pieces of the puzzle together into an executable file, consisting of machine language, which will run on your specific hardware and your specific operating system.
A complete C program consists of one or more source code files that you write, and several predefined routines called a runtime library that comes with the computer. For example, printf() is a part of the C runtime library, which will run differently on different machines and different operating systems. All you have to do is call printf(). The C runtime library converts it to machine language that your particular machine and operating system can understand.
Run the Program. Verify that the program does no more or less than it is supposed to do. Repeat the process over and over again until you get it right. Exercise your muscle memory to get more and more efficient at programming in C.
You will spend a lot of time debugging programs. Experiment with your code. Don’t be afraid to break it. Test your code often. Learn what those error messages mean. Get in the habit of writing good comments to remind you of what you are doing and why, and to let other programmers know what you are doing with your code. And get familiar with whatever text editor, IDE and other tools that you use in your workflow.
Development Workflow
While you’re reading the manual, work on getting your development environment set up. You can use Konsole, Bash and Kate to start with. Later, once you get familiar with C and Linux, you’ll build your own custom, programmable, Integrated Development Environment using Kitty, Zsh, Vim and Ranger.
Open Konsole and Kate on one workspace of your lap top. Make each one half the size of your screen and side by side with each other. For now, use Kate as your text editor and Konsole as your terminal.
You need GCC to be installed and it usually is installed by default on Linux. Type gcc -v
in your terminal and it should tell you what version of gcc is installed on your computer. which gcc
will tell you where gcc is installed on your computer.
You write your programs in your text editor and save them with a name like greetings.c in a seperate directory for each project. Then, in your terminal, you change directories (cd
) into the directory where you saved the program. Run cc greetings.c
.
It should generate a file named a.out in your project directory. Use your ls
command to make sure it is there. Then, enter ./a.out
. It should print out your greeting.
Study. Experiment. Learn how to use your computer, Linux and the C programming language to amplify your creativity. These tools are very advanced sticks and stone tools, which you can use to extend your human consciousness with artificial intelligence.
Use C and Linux to create something valuable. Have fun improving yourself and making the world a better place.