Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

All decent IDEs have a file search command.


> All decent IDEs have a file search command.

Yes, all decent IDEs have file search command. But Emacs got SEARCH:

- You can search for all files that contain given string and then open the search results and modify occurrences using multiple cursors and then save it, and it will propagate changes in multiple files;

- You can recursively search for file names, then (for example) mark those that are bigger than 15Mbs, or files that were edited last time in March, and then tell Emacs to show git-log of changes, but only related to those files;

- You can search for a pattern, but also tell it to display it with a context (for example 4 lines before and after the occurrence);

- You can recursively search for a filename pattern, and then among those that you find, you can rename those that match a regexp;

- You can git-grep for a file that was deleted in the repo;

- You can find all the compilation/linting errors and warnings in the code for a given project;

And guess what? All that works the same way for remote machines. You can use the search on a remote computer and open files, just like it was a local machine. Heck, you can even search and open files inside Docker containers.

You think I'm done here? I haven't even talked about searching for stuff using Org-mode.

Seriously, whenever there's an argument about IDEs vs. Emacs - Emacs just beats the shit out of any. "But it doesn't support re-factoring... bleh-bleh." Like everyone who seriously uses Emacs really doing it because they hate refactoring or something. Emacs has better tools and a myriad of ways to deal with code.


Somehow my colleagues who use VS Code or JetBrains IDEs don't manage to learn about those features while all of my vim-using colleagues somehow do. (Haven't worked with anyone using Emacs yet)


I use CLion almost exclusively and I use shift-shift to find things so often that I have basically no idea what file anything is in.

Is there anything free that even begins to approach the quality and accuracy of the JetBrains Rust analysis plugin? If so, I’d love to know about it and start using vim.


I'm sure there has to be a vim plugin for rls


Yes, there is. But RLS is much worse than the CLion Rust plugin, in my experience.


In JetBrains you just double shift and a small searchbar opens to allow you to type in any file name. It autocompletes so you do not have to remember the whole name. It is pretty neat.


Not just any file name, but any symbol.


I like Emacs a lot, but it' definitely lacking most of the advanced IDE features, and the Emacs features that a decent IDE (read: Intellij) implement are usually "good enough" for me.

People who've been using only Emacs for the last 20 years are in no position to comment on IDEs


With lsp-mode, there’s really nothing I can think of that emacs can’t do compared to IDEs. In fact, emacs blows them out of the water. Before LSP was invented, I would have agreed with you. But pretty much all IDE features have been commoditized by LSP now.


The man-or-boy test for IDEs was proposed long ago by Martin Fowler. If the editor can do the ‘extract method’ refactoring, then it's an IDE that properly understands the structure of the code.

More generally and forgivably, I'd say the IDE must know that two variables of the same name may be different variables, and to know which instances are which vars. Funny enough, this benefit of IDEs might rarely be felt with Javascript due to its uber-dynamic nature (at least without classes).


Are there any languages other than C#, Java and maybe Dart that have these features?

As soon as you add any kind of metaprogramming or macros to the mix, IDEs start to break, because they can't refactor code that doesn't exist yet. That's an issue for IDEs for C, C++, Rust, D and probably few other languages.


> Are there any languages other than C#, Java and maybe Dart that have these features?

If you're talking about ‘extract method’, any regular imperative language in the C style should have that―possibly as ‘extract function’. I mean also Python, JS, Ruby and the like. The hard part here is to figure out which vars go into the method/function and which of them must be accepted as parameters or returned from the function―that's where the understanding of code structure comes in.

Sure, fiddling with metaprogramming will break IDE's understanding of the code, e.g. in Python, but you can do that carefully and isolate the effects so that the rest of code is still ‘clean’. That's also why Java integrates any and all features into the type and OOP system (afaik), so the code can always be described statically. I guess Haskell is an extreme example of that, but not sure how IDE-friendly it is.


I use emacs, but I don't think lsp-mode can do all the refactorings which intellij provides:

  Safe Delete
  Extract Method
  Extract Constant
  Extract Field
  Extract Parameter
  Introduce Variable
  Rename
  Inline
  Change signature
Refactorings are great, because you can do safe code transformations very quickly. If you get to know these features, it's hard to do without them.


I only know about the example of Rust, where IntelliJ is still significantly better and faster than lsp.


Emacs's greatness lies somewhere else. Its extensibility is unmatched. IMO there's no other software product ever been created that can be extended like Emacs.

I'm sure if given enough resources and motivation, it's possible to build superb support for the modern programming languages. For example, you wouldn't claim that Intellij/VSCode/Sublime/Atom has better support for Erlang, for OCaml, for Lisp, for LaTeX, would you?

Emacs evolves slowly. Things take time. And yes, there are always IDEs that do things [slightly] better. At a given moment. Remember, though Emacs outlived many trendy IDEs. Relatively not too long ago IDEs like C++ Builder and Delphi Builder, Eclipse, NetBeans were quite popular. And they did have some remarkable features that Emacs didn't. Do you see any HN posts about those anymore?

Now check, for example, Github Language Stats¹ and find there emacs-lisp. Isn't it surprising to see it somewhere in the middle of the list? Isn't it surprising that it made into that list at all? Remember that it is not a general-purpose language; it is not used in the enterprise; it is not used in the game industry; not suitable for writing mobile apps or web pages. And it also a pretty concise language, it's a Lisp. But there's a lot of it on GitHub alone. Who are these people? Who writes all that code? And how the heck they keep doing it - none of them ever have gotten paid for it, aside from some tiny voluntary contributions and hugely successful Kickstarter campaign for Magit.

If a programming language stays relevant for long enough, people eventually will build emacs packages for it, and they'll keep improving them. But for a proprietary IDE, if it doesn't have a feature you like - you have no other option but to submit a request and wait. Sometimes you have to wait indefinitely.

> People who've been using only Emacs for the last 20 years are in no position to comment on IDEs

I moved to Emacs after almost 20 years of using IDEs. If I am still programming 20 years from now, I'm sure it will be in Emacs.

____

* ¹ https://madnight.github.io/githut




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: