English 中文(简体)
Do you use VIM/Emacs/Terminals to develop C/C++? What kind of projects is this practical for?
原标题:

For those who are using vim/emacs/terminals,etc (ie, not an IDE proper) what sort of projects are you working on? Are they big? Production? Are these the tools you use at work? Or mostly for smaller things...or big things broken into small things? Sorry...enough questions.

I ask because I m studying computer science right now, and am super excited about it. I had an internship programming J2ME for a government agency recently and it was Netbeans and eclipse all the way. So I ve only had a few "minor-league" years in the business.

In short, what is practical for the CL type tools, versus an IDE such as beans and VS. I ve got a lot to learn, and the CL tools will probably teach me, versus shielding me like an full on IDE might.

问题回答

What sort of projects are you working on?

All kind... vim is my main "IDE" anywhere

Are they big?

Yes... My FOSS project CppCMS written almost 100% in vim

Production?

Yes, most of production code (Not FOSS) I write today I use vim.

Are these the tools you use at work?

Yes.

I would explain severak simple things:

  1. vim provides almost all tools IDE does, highlighting, spellcheck, autocomplition, working with multiple buffers, build, context "jumps" (decl, def) and much more
  2. It is extreamly portable, I work with it on Windows, Linux, OpenVMS, Solaris, FreeBSD.
  3. It is very light in comparison to bloated IDE.

There is only one thing I do use IDE today: debugging hard bugs.

Emacs/Vim can be used for any sized projects.

Generally, you won t get to choose the environment, the job you find will have one already picked out for you (unless it s non-Java programming in Unix, in which case use what you want).

I wouldn t sweat the choice, just learn to use which ever editor/IDE is available to its utmost extent.

I use (and have used) Emacs for personal projects, and in two different companies on software projects exceeding 10M lines of production code each.

I use emacs. I would recommend emacs. I have used emacs since before it was emacs: TECO, TV, and the e macro package on the Decsystem-20. I can use vim if I need to but what you learn is largely what is at hand and you get into. Yes, learn one or both. And I would say, if the IDE fits, wear it too.

I use vim for everything, I hate IDEs, they re too bloated for me.

I haven t used it for any massive projects (because I haven t written any massive projects), but if I were going to, I would still use vim.

When learning I new language, I believe it s best to not use IDEs at all, and to learn the "proper" way of doing it (like for c++, learning the command line switches and using makefiles).

Twenty years ago all my programming was done in plain text editors, mostly emacs, but technology has improved over the years.

I still do use plain text editors to write code occasionally, but only when it is inconvenient to install an IDE on the machine where I m writing code. For example, a few times I ve stopped by a client site without my laptop and wanted to write a quick program.

This is also an issue with certain embedded systems, where you may want to update the code interactively through a RS232 or USB based command line interface.

Most modern IDEs provide enough acceleration to the code editing process that I will install one whenever I expect to use the computer for development for more than two or three hours.

I use vim for everything from small one-off scripts to 1000+ line production code. It is so versatile that working in any other environment seems constricting. If I m part of a project that necessitates a standard environment (IDE) then I ll do as much coding as I can in vim and then import into the ide.

I believe everyone should be able to operate effectively in a command-line environment. You can t always be sure that anything except the basic tools will be available on the target machines, you can t be sure that you ll have enough system to pull up a full IDE, and you might actually find the system you re building is too complicated for an IDE.

I ve built systems that have consisted of multiple interoperating clients and servers distributed across multiple physical machines. In these efforts, I have used command line tools almost exclusively in the server side. I will use DDD when I can, but I also know the underlying gdb. If the clients are Windows, I ll use the Visual Studio IDE, but if they re UNIX, I ll go with the command line.

Figure out how to work effectively using minimal tools. You ll be a better developer and you ll actually appreciate the integrated tools more, if they re done better.

BTW, I put Emacs in the IDE class. I ve got a friend who comes in and fires it up first thing and doesn t leave the environment all day. It s more than an IDE, in fact, since he does mail, surfing, etc. in the thing, or so he tells me.

For large projects with 100+ files, using an IDE is very important. But there are lots of small small things which you need to keep doing all the time while working on even large projects. Firing up the IDE for all of these may not be worthwhile. Having a good command on a powerful editor like Vim or Emacs is something I would consider as an essential skill for any programmer. But an appropriate IDE should also be used to accelerate regular development work as per project needs.

Hmm... Well, look at it this way:

I open code in emacs. I edit it. I use code completion (and I ve even played with intellisense emacs)... When I m ready to compile, I hit CTRL+F7... A key I ve bound... It builds in a small popup window... If there are any errors, I can jump to them in the code by hitting f8 (another bound key)... Once it s all building, I hit f5... (this runs a little program I wrote that parses the Makefile and determines the path the executable)... This starts the debugger in a small popup window... I can click on code lines to set break points... etc... I debug... I can "next" through the code with F10... I can "step" through the code with F11 (more key bindings)... When it s all done I hit Shift-F7 to package (.rpm) the project.

So, do I have an IDE? Or am I just using a plain text editor?

1. Yes.   2. Any kind of project.


There is no limit to the size of a system that can be developed in Vim/Emacs/Unix, in fact, there are fewer limits than there are in IDE s. Let s look at a few things I use...

SYSTEM          LINES OF CODE
Linux kernel       10,000,000
NetBSD              4,000,000
Ruby                  200,000

Those are pretty big systems.

I don t believe any of them were developed with IDE software.

I tend to agree that for learning it is a good idea to understand the basics: the fact that you edit the code, you compile it with a compiler, link it with a linker, debug it with a debugger.

It makes it easier to grasp the concepts. And it makes easier to move from platform to platform.

So, learn vi, make, gdb, some version control system (git, svn).

But for production I would say that getting familiar with the "standard IDE" of the environment is a must (Visual Studio for Windows, XCode for Mac OS, Eclipse for Java, etc.)

No mater what other say, mastering an IDE will increase your productivity. If you used vi/emacs for 10 years and try Eclipse or Visual Studio for few days, you will say that they are bloated and don t offer anything in exchange. That s BS. The more open minded you are, the better you will be.

I use Emacs to develop commercial software with size of several millions LoC, and massive use of templates, etc. I use CEDET + gnu global as auxiliary packages + yasnippet, etc.

well...I have to say that I m a vimmer. Using a IDE, I don t to care so many things like when you use editor like vim/emacs. But when you do a bit more, you will find the IDE you use is more hindering than helping in your program developping process. alas...if you insist in using vim/emacs as your editor, you will encounter "a deep learning curve", you will waste so many time even to acchieve so trivial a function in your editor,you will be desperate when you are busy catching up with your timetable if you just pick them up......you have to settle down and start leaning and also playing with editors and a couple of days, you will find you ve already achieve more than you can ever expect!

My standard IDE is a flock of xterms running some mix of vim editors, man page documentation, debuggers, log tails, and command lines to execute things, plus an instance of Firefox for pulling up additional docs or (where applicable) testing web-based code. This is what I use for all projects these days, regardless of size, whether personal or professional.

Pretty much the only time I ve seen real benefit to using an IDE has been when I ve been working on platform-native GUI apps, where they make it so much easier to build forms and wire up their controls. But I haven t done that sort of work in over a decade - the last one I did was in Deplhi, back when Borland still owned it; I think version 4 had just come out, although it might have been 3.

Emacs is a great tool (so is Vim) for programming, and I use them to develop my code for physics research. As added benefit (for me) Emacs handles remote files nicely via Tramp, so that s big boom for me since I very often have to visit remote servers.

With that said, every time I need to write an application with a GUI and within a large framework (like c# with .NET or the android framework) I always find it hard to development with just emacs. The IDEs (Visual Studio, Eclipse) simply have everything including autocomplete and lookup with appropriate content from the framework, and debugging, even though code writing part is always unsatisfactory (I always end up installing some sort of emacs plugin for the IDE, which always fall short of Emacs proper!).

Sometimes it just takes too long to setup an environment in Emacs for those kinds of projects since that is not the default way envisioned by the designers, and having an environment that works out of box is so much easier than banging my head against the wall to find usually obscure information on how to compile/debug those app without using the designated IDE.

We could sum things up by saying that editors like emacs / vi implements some of the functionnalities of IDEs by using CL tools (or the libs behind the CL tools).

Your main issue in using an editor as an IDE would be :

  • configuring it to have exactly the functionnalities you are happy with in an IDE is not necessarily straigh-forward (I ask for sympathy from anyone who ever tried to configure CEDET ;) ), as opposed to working out-of-the-box with IDEs

  • the way such functionnalities work in editors is very tied to CL, so you need at least a vague understanding of the CL beforehand.

The advantages are the fact that CL tools are sometimes more ubiquitous than IDEs. Also mastering CL opens the door to scripting your build ("make a build in one command" as opposed to "make a build in one click"), which opens the door to automated nighly builds, continuous integration, etc... all of which are harder to setup if your understanding of the build stops at hitting F6 or whatever.





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签