Setting up Atom in Ubuntu 18.04


How do I set it up for C?


It would help if you added details about what sorts of things you want Atom to do for you.


I’m not really sure I’m a beginner. I just want it to run with C. I’m trying to learn the language.


Is this your first programming language? If so, why did you choose C? If there’s not a goal for picking C in particular, then I’d suggest starting with something less high-maintenance, like Python, JavaScript, or Ruby.

You could choose a full-featured IDE that doesn’t need to be set up, but you’re going with Atom, the endlessly configurable code editor that doesn’t hold your hand about anything. So first you should ask yourself why you need anything. You’re trying to learn C, but you can do that just with books. You can write everything in Notepad, if you’re a masochist. All you need is a compiler, and Atom is language-agnostic by default; it doesn’t contain any compilers except for the JavaScript one it has by virtue of being built on top of Chrome (and it isn’t set up to run users’ JavaScript files). So you’re going to have to install a compiler, and you might choose to also install an Atom package that allows you to do your compilation from within Atom. Many people fancy script for its simplicity, but it isn’t well-maintained and it has some glaring flaws that aren’t easy to work around. I like using process-palette, which gives me a single interface for automating every kind of command line instruction and strong tools for running those commands without leaving Atom.

You might decide that you want packages to perform autocompletion, debugging, linting, refactoring, or other code tasks, but none of those are essential and some of them might add complexity early on where you don’t need it.


I agree with most of what @DamnedScholar says.

Regarding editors, there are also IDE options like CLion (free for students), but that’s more for if you want to use C without learning it and all the tools for compiling it. Of course you still need to learn it to some level, but CLion will (sort of) hide away the messy compilation and linking details you would otherwise need to be familiar with.

But if you are trying to learn C, I would stay away from CLion because of this. Use vanilla Atom or Notepad, learn how to write, run, and interpret errors in simple programs manually, and then decide if you want to move to a dedicated IDE like CLion.

Too many beginners think their code is tied to the editor they use, so starting with the absolute minimum should give you a sense of what’s really happening.

As for the language choice, I think C is fine. Python and such may be easier to learn initially, but C is closer to how the computer actually runs the program. In particular, C (and Python and any other language) should be fine for problems in Project Euler, which is a great source of exercises.