Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

> How do you work in a large C++ code base using only a text editor? You will certainly need a couple of plugins, e.g. for linting, definitions/implementation look up, auto complete, etc. Then what is the actual difference to an IDE?

In the beginning I felt I needed linting, definitions, etc, so I began by stuffing Vim with plugins. Then I discovered that I was much more productive when I didn't use any of that, but actually kept the documentation close by.

Now I just remember most of the definitions or quickly look them up and combine the usage of console applications like grep, find, sed, etc. with Vim. I have about 3 custom made Vim functions that serve as shortcuts for at few of the things I need often.

Personally it's the most productive for me and the tool gets out of the way.



sort by: page size:

> Now I just remember most of the definitions or quickly look them up and combine the usage of console applications like grep, find, sed, etc.

This sounds strictly worse than what IDEs have to offer (I am thinking specifically about C++).

> Now I just remember most of the definitions or quickly look them up

May I ask with which languages you work and how large the code bases are?

Personally, I work with what I'd call medium-sized C or C++ code bases (100k - 200k LOC) with hundreds of functions/methods. There is no way I can remember their signatures. When I start typing a method, my IDE will immediately show all the possible overloads with their parameters. When I hit F2, it immediately jumps to the definition. I seriously can't imagine how abandoning these features could make me more productive.

I'm always stumped when I hear people saying they are more productive in a text editor, even if they had already tried IDEs. I honestly like to understand how this is possible.


> Some guys at work used to add Vim bindings to their IDE and I just didn’t understand it.

I‘m one of these guys.

I’m used to its text editing hotkeys from years of using it, but when jumping between a bunch of languages/environments it’s a lot easier to leverage the ‚integrated‘ nature of a lot IDEs (in my case Jetbrains).

Having to find, configure and remember how to use a bunch of different debuggers, linters, codegen tools and other tools manually is a pain


> Modern text editors do every single thing.

That's an outrageously false statement. If it were true, you'd rarely need plugins.

> I wonder what you'd consider an IDE nowadays.

The definition of an IDE hasn't changed in at least 20 years. INTEGRATED development environment.

If I install a C++ IDE, I have everything I need out of the box, and the experience is (usually) consistent across all features.

If I want to do C++ in Vim, I need to install about 10 plugins (to begin with) [1], which will result in a disjointed experience (each plugin has different authors with different visions) where things break randomly and I don't know why. Speaking from experience, unfortunately.

Yes, you can make it work and you can get used to it, but it's just a text editor that you try to coax into doing what you want by using plugins.

Whereas the IDE will give you a language-specific tool out of the box, without any significant effort or inconvenience on your part. And the overall experience is better because the IDE "just works" most of the time.

[1] https://stackoverflow.com/questions/4237817/configuring-vim-...


> Honest questions: What do you consider an IDE? Do you use syntax highlighting?

I use GVIM, no plugins. syntax highlighting is fine and file browser too, but once you start getting into autocomplete and plugins that too much I think. the IDE should not be a replacement for a poorly designed language, and that's what they have become I think.


> I think i am more productive in an IDE, faster.

Personally agree with this part.

For those who need it because they are used to vim style editing most ides (at least on the Java side, + VS Code for everything else) has vim modes.

For those who have never used it and think they need it because it seems so cool and "everybody" uses it: You don't need it, at least not right now. Most great developers I know actually don't use vim for programming high-level languages, even if some of them use vim modes.

Instead I'd recommend:

- Use a decent mainstream IDE

- Memorize shortcuts for selection, search, replace, global search, global search and replace.

- Learn to use the included refactoring tools

- Learn to use the built in VCS tooling (or try and fall back to the console for VCS handling).


> I have been tempted by a more fancy IDE, but I'm so used to vim, I'm reluctant/scared to change.

I'm happy to report that JetBrains' VIM plugin is almost flawless (Block-based editing, window splitting, save/close, it's all where it's supposed to be).

I used to be in the same camp. But if you add a linter and parser and full blown backend to make lookups for code completion to your VIM configuration you might as well use an IDE. I've switched to IntelliJ for Java.


> I hate writing C# or Java in emacs because there's no intellisense/code completion.

Agreed. The quality of the IDE/tools is such a huge factor in the quality of one's experience writing code.

Can't imagine writing C# outside of Visual Studio or VSCode. Can't imagine writing Java outside of Eclipse.

Can't imagine using anything but vim or emacs for academic coding ( Standard ML, lisp, c, etc ).

But it might be because I'm just used to coding in these IDEs/editors for these particular languages.


> Maybe without the IDE, the code would have ended up a little cleaner.

When you can’t easily jump from file to file and get intellisense like completion you are forced to design modules and data models which can fit inside your head. I imagine this can be a feature in some cases and a limitation in others.

I tend to only use an IDE when refactoring, and a text editor for everything else. So far I haven’t had to write or work on code which I can’t keep all in my head; maybe I have just been lucky with the codebases I have worked on?


> There are plugins that, so far as I know, can do a lot of what an IDE can do

I want to add that the converse is true too: there are a lot of plugins (for IDEs) that do a lot of what Vim can do. I personally use the neovim integration for VSCode and it's really nice.


> One of my goals was to show how good a good IDE experience can actually be to someone who is used to working in C/C++.

I wonder what you find lacking in the current C++ experience. e.g. with the IDE I use (QtCreator), I can quickly refactor things across million-lines codebases, perform a decent set of more advanced refactors (https://doc.qt.io/qtcreator/creator-editor-refactoring.html), auto-generate boilerplate code, I get in-line hints, lints and warnings while I type all with clang-based auto-completion...


> My gut feeling is that people who haven't looked up from emacs or vi for a decade or two have no idea what modern IDEs are capable of out of the box.

I use visual studio in my day-to-day job for .net and C# work. I know what it’s capable and it’s a very impressive piece of technology.

What it doesn’t do is allow me to shape it to fit my workflow. I always have to adapt to fit the tool as opposed to the other way around, and any level of customization and extensibility feels extremely shallow compared to Emacs.

With Emacs I get everything my way. And I don’t think that can be said about any other tool I know of.

Needless to say I use both editors side by side and use whatever tool is best for the job at the time.

Edit: IMO standardized technologies like LSP is now bridging the gap for many (but obviously not all) IDE features. I suspect the imminent death of the “plain editor” is vastly exxagerated :)


> The people who _enjoy_ the toil seem to truly struggle to comprehend that someone might not want to spend hours upon hours learning how to get things working, only to immediately forget.

One of the tips in The Pragmatic Programmer is "Achieve Editor Fluency", wherever it's Vim, VS Code, or Sublime Text. I use IDEA for java code because in my job, I browse code more often than I edit it, and IDEA is nice for that. I also use WebStorm for the JS part because it's also good for that. But I invested my time into VIM because I can do everything above with it and even more. I don't want my editor to become an IDE, I want it to be powerful in editing and allow for integration, as there are slews of tools that work with code and text.

You should invest in your tools, be it Vim or VS Code. I chose Vim and Sublime Text because of their speed, and JetBrains' IDEs because of their code analysis engine. You may have different criteria, but try to follow the tip.


> I can see that there's not much difference between an ide and editor for new languages but why do people prefer text editing and prioritize typing speed where IDEs exist?

That's not why I use a text editor (Geany most often). I find the IDE to be complex and to bring on complexity. If I'm using a text editor the project has to remain simple. The best analogy I have was when I used Slackware. Ubuntu users would laugh because Slackware didn't have a package manager that resolved dependencies. Slackware users would laugh because Ubuntu had a packaging system so complex that it needed dependency resolution. Simply put, using a text editor imposes discipline that makes programming more fun for me.

I'm sure I would use an IDE if I were a Dilbert-style enterprise Java developer. The enterprise thing took all the fun out of programming so I took my career in a different direction.


> But an IDE from around 2005 is nothing more than a dumb notepad in comparison to a modern JetBrains IDE.

Which IDE is this?

I've used IDEs from the mid 90s (Watcom C/C++, Visual Studio 5.5, Delphi, C++ Builder) and from 2005, and they did a lot more than just let you edit code and run make.

In 2005, all major IDEs had autocomplete, for example. They also had jump to definition, jump to help (remember help pages? .chm files?), syntax highlighting, source-level debugging, inline with the source code ...

I mean, what exactly do you think they are missing that makes them a rudimentary text editing tool?


> It does take a certain amount of mental energy to constantly be computing effecient key combos.

I disagree, the only time I'm actually thinking about key combos is if I'm vim-golfing something or trying to create a macro to reformat a large amount of text.

In day-to-day coding I just think about what I want the result to be and it just happens.

> On another note, the productivity I’ve gained from using an actual IDE

Yeah, IDEs with semantic understanding of the underlying language are great. The stuff JetBrains releases is top notch in that regard. I used IntelliJ whilst working on a Kotlin project despite constantly getting pissed off that it didn't work like I wanted it too.

Knowing how to manipulate text for languages that don't have great IDE support is still worth it if you're ever forced to work in such languages. At my previous gig I had to maintain scripts/programs written in csh/bash/TCL/perl/SKILL/python/ruby, knowing vim well made refactoring significantly quicker/easier.

Now days I just write typescript all day so I do get the IDE to do most of the work.


>When people extend their text editor (be it sublime, vim, emacs) with all these (often outdated) plugins i am left wondering why there is still so much hate for IDEs ?

Because most (all?) IDE's are slow. I've used Eclipse for years. Have also tried Idea and dabbled with NetBeans. I don't like their slow operation, nor they clunky UIs. And I don't find their speed, even today with an SSD and 8+GB of RAM, good enough. Tolerable might be a better word.

Plus their text-editing abilities leave a lot to be desired too.

>Why would i want to fiddle together my text editor with one-man plugins that often dont even work 100% ?

Well, my experience with IDEs is that their plugins and core functionality is not all roses either.


> My JetBrains IDE does so much out of the box

That's exactly what I don't like about it. I'm a simple guy; I like simple editors. I will spend more time turning off things in JetBrains and VSCode that I find distracting and annoying than I will spend on setting up Vim to add some features I want like LSP support.


> It's a nice idea, but it's hard to do. One person is using VIM...

The things the author listed there are commonly not IDE integrated. I've never seen a C++ development environment where cpplint/clang-tidy and fuzzers are IDE integrated, they're too slow to run automatically on keystrokes. Auto-formatting is the only one that is sometimes integrated. All of this stuff you can do from the command line without caring about each user's chosen development environment. You should definitely at least try rather than giving up before you start just because you have two different text editors in use. This is C++; if your team won't install any tools, you're gonna have a bad time. Consider containerizing the tools so it's easier.


> I don't see why one would pass up JetBrains IDEs considering they have a passable Vim mode ...

Because I am suspicious of "the magic" of those IDEs..

I truly respect the "old" code, I mimic the coding (and naming) styles/conventions of any code that I work on.

My goal is that (except when cheating with git-blame) others cannot divide the code between original and added by me...

And it is definitely NOT a question about cost.. I am willing to (and have) spend a lot of money on good tools.

But for me, 2/3 of my time goes to thinking and 1/3 of my time goes to writing/typing...

next

Legal | privacy