learn C with me - week 0 - setting up development environment
In order to write and compile C programs on your machine you will need few tools and skills.
- text editor capable of saving text โas isโ without any additional information like font or size (not today MS Word ๐๐๐)
- C compiler like GCC, Clang or if you feel fancy you can opt for specialised compilers like AOCC or Intel oneAPI
- internet connection (optional)
- knowledge how to install software and create files and folders on your computer
choosing right text editor and compiler
As I mentioned above, program you will use for editing code have to be able to save text files in raw form, with .c extension. There is a lot of different text editors capable of doing this. As developer I used many different text editors, from Vim to Emacs to Xcode and Visual Studio and choosing right editor for you is purely matter of preference, because all can get job done. When it comes to the compiler, I personally use Clang most of the time, but every C compiler should be able to do the job well enough. Some compilers generate more optimised machine code than the others, but it depends on many factors and performance is not concern for us, at least for now.
If you are learning C as your 2nd or even 11th language, there is great chance you already know how to set this up, but for everyone else I prepared collection of useful links, because writing another tutorial would be purely reinventing the wheel. Also I am not mentally ready to deal with troubleshooting of Visual Studio on Puppy Linux. Internet is already full of various tutorials and I believe that you will find even more than you need. If you donโt feel comfortable enough to install software on the computer on your own, I am not sure whether programming is good for you at the moment. You can manage this technical debt right now, with tutorials I gathered.
- creating folders
- on windows
https://support.microsoft.com/en-us/office/create-a-new-folder-cbbfb6f5-59dd-4e5d-95f6-a12577952e17 - on mac
https://support.apple.com/en-vn/guide/mac-help/mh26885/mac - on unix-like systems through the CLI
mkdir name-of-the-folder
- on windows
- installing software
- on windows
https://support.microsoft.com/en-us/windows/how-to-install-programs-from-online-sources-on-windows-10-a503e8b6-e45b-fd5a-f4c5-5a08c8bd9821 - on mac
https://www.wikihow.com/Install-Software-on-a-Mac - on linux
https://opensource.com/article/18/8/how-install-software-linux-command-line - on BSD
https://docs.freebsd.org/en/books/handbook/ports/
https://www.openbsd.org/faq/faq15.html
TIP: If this is not solving your problem, just google it.
- on windows
- text editors
Simple GUI editors
- textEdit - mac
- notepad - windows
- notepad++ - windows CLI editors
- GNU nano - unix-like systems
- Vim - cross platform
- neovim - cross platform More advanced GUI editors
- VS Code - cross platform
- VS Codium - cross platform
- GNU Emacs - unix-like systems Integrated Development Environments (IDEs)
- Xcode - mac
- Code::Blocks - cross platform
- Visual Studio - windows
- compilers
gcc for windows:
https://www.digitalocean.com/community/tutorials/c-compiler-windows-gcc
gcc for mac:
https://osxdaily.com/2023/05/02/how-install-gcc-mac/
gcc for ubuntu:
https://linuxcapable.com/how-to-install-gcc-compiler-on-ubuntu-linux/
using gcc:
https://www.wikihow.com/Compile-a-C-Program-Using-the-GNU-Compiler-(GCC)
summary
From me this is everything for today. I hope you have good time preparing your development environment. Donโt forget that internet is your best friend when it comes to troubleshooting things, especially related to computers.
Have a nice day and stay tuned for the next part,
Laura