Linux C programming - IDE vs. editor + command line

Asked

Viewed 4,380 times

14

I’ve been looking for a similar question here and I haven’t found anything so if you’ve already answered I’m sorry.

I’m a beginner in C programming and would like to know if it is more appropriate to use an IDE to create/edit code, compile and execute code or if it is more appropriate to use a text editor of the Notepad++ genre, compile and run the code through the Linux terminal.

At the level of identification of error's and Warning'Which of these methods provides the most complete and reliable information?

By compiling and executing the code through the terminal we can get a better understanding of how the code works on the machine?

  • Also remembering that you can use simpler editors that call the compiler without having to enter the terminal all the time, such as Sublimetext, Syn (which I use for several languages, but is for windows only) and even Notepad++. Almost all of these editors have a way for you to set up a script to compile your code at a keystroke, even without being an IDE.

  • 3

    Whenever you have a question like "what’s best" or "what’s best" - try the alternatives and draw your own conclusions. You will enrich your knowledge much more than if you had let someone else decide for you in addition to finding out what is best suited to your case ;)

2 answers

17


Most of what I will say is for any language. I will make reservations when necessary.

I understand you’d like to see a comparison between a IDE complete and the option to use a simpler code editor with command line tools.

In some languages the IDE helps a lot. These languages have even been designed with the idea of an IDE in mind. In C this occurs less. Because less object-oriented languages tend to have a little less advantage when using an IDE.

I don’t think it makes any difference whether it’s on Linux or another operating system. But Linux has a culture of using simpler tools, of preferring the command line. This can influence the decision.

Experience of the programmer

  • Novice programmers tend to use an IDE a lot because it makes most of the tasks easier, is intuitive and helps to learn little by little. The great trump card of a IDE is to help do the same things easier.

  • More experienced programmers who are also more hardcore are divided between those who like IDE and those who prefer a more simplified, more objective solution without intermediate layers.

Editors + command line

These programmers like to have more control over everything they are doing. They want little interference in their work. The communion of a simpler editor, such as what you and other members have already cited or a VIM or Emacs, just to name a few, "raw" development tools make them more productive, which is ultimately what matters.

Some these publishers are not that simple, they can be considered almost Ides. Many are so configurable and programmable that the integration of the development tools themselves are practically part of them.

I will not go around quoting examples of editors because it causes holy wars. Everyone thinks that what he uses is the best.

Integration

Not always the integration of these editors with the tools (compiler, Debugger, profiler, dishwasher, etc.) are good. This is a reason to wonder whether or not to choose an editor. Integration helps a lot, although it’s not tragic to be without it.

In some cases you will have to set up a lot to use the editor well, but luckily, for C and other languages, most editors already have good settings.

What can be more complicated is to integrate the Debugger, probably the feature that most programmers will miss most of having something well integrated.

Regarding the compiler, receive warnings and errors It’s usually pretty quiet to integrate into most of these editors. Then you can have this information in the editor (which is reasonably configurable) without problems, including making it easy to go to the pointed error location.

If you don’t have that integration, it’s not a big deal either. Many programmers find it more productive to use these tools independently as a command line on the console.

IDE

A full IDE can be advantageous especially if it already has specific tools for the language in question.

An IDE is not limited to the above mentioned tools and code helpers (syntax hightlight, code completation, help inline, etc.), which editors also tend to have to a greater or lesser degree.

With an IDE you also have project management and building archive (build) application, extra static analysis, tools Refactoring, Complex searches, easy navigation, code generators, code organization viewers, etc..

Since these IDES are usually made or adapted specifically for a particular language they have more suitable tools that can go a little further than a simple editor can.

Helps but doesn’t work magic

But don’t think an IDE will work magic. Especially in C. And always remember that even if in practice it is a little easier to develop software, the simplest tools can do everything you need, it will only be in a different way.

Rarely will you have any additional information in an IDE (this has changed a little in some cases). The reverse is no longer true. Since Ides rely heavily on "raw" tools, nothing guarantees that everything in the tool is available in the IDE. Of course a good IDE will provide you with everything important, it just won’t guarantee the darkest things, the latest novelty of the debugger the next day (the new development cycles have allowed this in some cases).

You can understand/understand better with an IDE because it is more visual, has more ways to present information, has everything else at hand. But it depends on each person, it depends on the style that the person adopts, how well he knows the various tools.

Minimizing one of the IDE’s problems

An IDE that uses a lot of mouse changes the context of the work of the hands. If you have to change the keyboard to the mouse at all times, it can become tiresome or unproductive. But there are those who get used to it. The general recommendation is to minimize or eliminate the use of mouse

Disadvantages

One of the main disadvantages of an IDE is its "heaviness". In general these applications are large and relatively slow. They require very modern machines to run well. Some are boring to leave the way you want and it is a type of application that tends to break with a higher frequency than normal, even according to the intimacy that it has with its application.

Making the caveat that I don’t take it so literally, I question the programmer who is no longer a novice who can’t program without a helping IDE. Nor do I say that a good programmer needs to get away from a good IDE to prove something.

If IDE were certainly advantageous in all cases, 100% of programmers would use one.

Debugging

If your last question is about following the execution step by step, it’s usually easier to visually do this in an IDE. But nothing that is impossible in some editors. If you want to see the instructions being executed by a dishwasher, is easier to see in an IDE. But you see everything in one dishwasher command line also.

Completion

Answering a part of your original question, all editors have technical advantages and disadvantages, but you should also note what you like the most, which one feels most comfortable.

How to choose

Ideally it’s good that you choose an editor or IDE and stick with it for all the languages you use. The better you know how to use a tool, the better you will explore it and better results will be obtained.

You will only know for sure what is good for you by testing. You have nothing to lose, all experience is valid. Random people on the internet can’t tell you what’s good for you.

Do you like to use the command line? Do you get along with it? Do you usually have several console tasks? Or prefer a visual environment with everything a click or two away?

It seems the answer is that taste and background existing is more important than the advantages of each. In the absence of a reliable metric, a study that indicates that one side is better than the other, I’m going to rely on feeling.

Career moment

C is one of the most suitable languages for a simpler solution than an IDE. But a beginner will suffer quite a lot on the command line. On the other hand it is the only way for the programmer to gain experience with everything that may be needed. No one will become a good C developer by clicking several clicks on a GUI. It’s the egg and chicken paradox. That goes for anything in programming. It would be better: learn in the most concrete way, lower level and understand everything how it works and then learn the facilities, or it is better to go straight to the most abstract, which has more layers hiding the difficult part, not giving you the correct and complete basis?

Style

If I had to summarize the answer, both solve the same problem with similar quality through different styles.

Didn’t help much? That was the intention. There’s no way to give a definitive answer, just a guide for you to find the best solution for you. Maybe that’s why no one wants to answer.

I put in the Github for future reference.

7

Maniero’s response is excellent in my opinion.

The question is in fact subjective and as it is open put this answer to add my two cents regarding the use of Ides vs Text Editor to start in C.

I am also a beginner in C, for my learning each one had a special importance, briefly:

The text editors had their initial contribution because they made it possible to understand the basics that, writing the code in a simple text and then running a compiler, you have an executable program.

Now the Ides had a wider role, in the Ides (first the Eclipse) it was possible to see and understand the broader code structure, better understand the headers, the Imports the conditions in the processor and errors in the compilation.

All this because Eclipse colors the syntax, shows the links, shows what was included or not in the code and points out the errors.

Finally, there is an IDE and a series of tutorials that played a key role in better understanding C programming: The IAR Embedded Workbench, It is aimed at programming ARM microcontrollers and allows running simulations visualizing the memory and code "decompiled" in Assembly. And this is fantastic because you visualize in real time, for example, what happens on the machine when you put a value on a variable, when you use a pointer, what happens when you run a pointer loop, etc..

It may seem complicated but there is a number of tutorials which explains step by step the whole process by teaching C programming using IAR to see the results.

As an example, with the use of this tool and the tutorial it was possible to understand quickly, in precisely 12min :), one of my biggest doubts, the basics of what are and how the pointers work.

So I believe that to start, you need to go through various tools, editors, Ides. Then with experience decide what pleases you most and what meets your needs.

Escaping from C, I’ve been a Python programmer for 5 years, at least in Python I see that certain projects gain such amplitude in complexity (code size, number of files, team collaboration, etc.) that it is very difficult to manage only with text editors, so my choice, because of professional need, it’s the Ides. (But I can’t deny that editing code in VIM is a lot of fun :) ).

  • Excellent addition. I’m so dinosaur that I don’t know what it’s like to start with IDE :) In the first part, who doesn’t know, it’s good to note that even the "simple" VIM allows the main code aids. In the second part (about ARM), it was something I was looking to give as an example of something that IDE helps more.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.