So, this is going to be my first blog post. Exciting stuff. The sole purpose of this blog is to get myself to learn something new everyday, and maybe by extension share some cool stuff with you, the reader, as well.
Let's get started with today's subject: The association between C and Linux programming.
For the newbies, C is a low-level programming language, meaning that C exposes much more of what the computer is actually doing than something like Java. For instance, in C, there's no such thing as a string- those are actually just arrays of characters that Java has created an object for, an abstraction for those who don't really want to deal with it. It also supports manual memory management through malloc() and free(). C lacks the abstractions that Java has. But we'll get back to that in a moment.
Let's discuss the relationship between C and Linux programming. For those who don't already know, Linux is an open-source operating system created by the one and only Linus Torvalds (You can see the kernel here).
NOTE: For those who are interested, the history surrounding UNIX and Linux is pretty interesting. See this article by the Linux Documentation Project for more details.
Linux programming is so associated with C programming because, well, it was all written in C. The kernel itself was written in C, as are most of its basic utilities (ls, pwd, cd, you name it!) were. The Bourne Again Shell that many new users will usually first encounter is again, written in C. The point here is that Linux is the optimal system to do your C programming shenanigans, whatever they might be, because the system itself was built in C.
For those of you that are just beginning programming, I would argue that you would be one big step ahead if you did yourself a favor and started with Linux right now. Not only is it the most diverse kind of the operating system due its open-source nature (there are many different 'flavors' of it), it is the optimal system to do all kinds of development on (unless you're doing Win32 programming or really, really enjoy Visual Studio. In which case, good job!) I would start with Ubuntu or Fedora, and replace Windows. Hear me out- there's a good reason for it.
The thing is, if you were to install either of these systems as a virtual machine or onto a computer you don't really use, you're probably never going to use them. You'll have to boot up the system, wait a bit, figure out how to use the terminal, never mind how the package system works. Maybe something breaks and you won't be too inclined to fix it since you'll just be inclined to run off back to Windows again. We can't have that.
Here's the thing: You won't learn anything that way. Trust me.
The first thing I learned about programming was that to figure out how a program works, you have to get down and dirty with it to make it do something cool. We can't just sit there and poke it with the longest stick we can find- how would you know how it does the cool thing otherwise? If you want to learn something, you gotta get close to it. I'm not talking just 'glimpsing' it. Commit to it, or get nothing instead.
Venturing into Linux is much of the same. Once you figure out the basics, maybe you'll write a shell script to make things easier; write a welcome script to pop up onto your terminal every time you start it, or swap out your desktop environment for a nifty window manager like bspwm or i3 and customize your system even more! The possibilities are endless!
For those that take my advice:
A good command line tutorial by William Shotts.
Welcome to the wonderful world of Linux.
![]() |
| Arch Linux, with BSPWM and the polybar. For those interested, the Bash script doesn't really do what it's supposed to do just yet. It's supposed to use lynx, a headless web browser, to scrape a quote from a website. The sed command doesn't do what I want to do. |

No comments:
Post a Comment