by pjmlp · 10y ago · 0 comments
Since I moved away from C++ into Java and .NET land, never felt the need to use them any longer.
And nowadays, with Qt Creator, Clion, xCode, AppCode and VS, I also don't feel the need of them when I need to go back to C++.
It is very good to know the basics from plain Vi, because there are still commercial UNIX systems without GNU tools installed, just bare bones installations.
So for me the question is why there are still people that enjoy working as if their computers are using a 25 year old developer experience.
The GUI paradigm is over 30 years old. People still stick to the mouse even though we've had ubiquitous touchscreens for almost a decade.
A good paradigm does not easily die.
Touch screens are not a 100% replacement for mice. They are an alternative, and for desktop/laptop PCs with vertical screens they are a non starter due to human physiology.
And they're not used as such. They are used as complimentary to keyboards.
On the other hand, mice-based GUIs ARE a 100% replacement for CLIs.
I had to use Xcode for a project and it gave me real anxiety. Weird things would go wrong and I had no idea how to fix them. The only sources of information were these horrible unanswered support threads on Apple's website.
Since Emacs is free, portable, and extensible, I can use it for lots of different things. And I know I have the freedom to change it any way I want. Of your examples, only Qt Creator has an open license.
Emacs is also a flagship of GNU. Xcode and Visual Studio are made for developing software in closed systems...
Xcode allows you to write and debug code for a specific compiler (like Clang or GCC). If you choose to use Emacs instead, you would typically use the same compiler as you'd use with Xcode, just a different way of editing and debugging your code. But whether or not you write software that is "closed" or "open" or "portable" or "platform specific" is a choice for the project, not the editor. Xcode is not for writing software in a closed system, it is for writing software, period. If you want to write software that is unique to OSX or iOS (using Apple APIs) you can do so more easily with Xcode, but a lot of my projects are command line tools that are used in any unix/linux variant, including OSX, and I choose to use Xcode.
My experience with Emacs/Spacemacs without having significant knowledge of lisp/elisp/Emacs debugging. I want to like Emacs, but my Vim environment feels so much more "solid".
It's completely awesome that you can change anything in emacs however you want but time and time again I realize that I'd rather have a rock solid editor with small api that let's you customize few things.
Secondly, working mainly as a sysadmin and only sometimes doing some development, I do far more with emacs than coding. I edit configuration files, look at log files, keep a "diary" using org-mode, use it for looking at directories with dired, I run a shell inside it (on Windows, eshell makes my life a lot easier). Having a single, consistent environment across many different languages, tasks, file formats and whatnot, with all my customizations working the same, is valuable to me.
If I had to code in Java, I would probably be using eclipse, too or JetBrains' Java IDE, and if I had to code in C#, I would most likely use Visual Studio, but I do not. So I stick with Emacs because it works well for me.
I use it to edit code simply because I feel at home in it, but I use very, very little of the functionality.
This really can't be overstated, or its value emphasized too strongly, and it goes a lot further than your simple statement makes clear.
There is literally nothing in Emacs whose source code is not trivially accessible from the editor itself, via the documentation attached to whatever functions or variables are related to the behavior of interest. (Even the C source code is accessible in this way, if you have it somewhere on your system and have told Emacs where to find it. Or, if you build from source, it will remember on its own.) You can access the documentation for anything, including keybindings, with a single command, and follow a hyperlink from there to the Emacs Lisp or C source in which it's implemented.
This reduces the mystery of why and how Emacs does what it does effectively to zero. If you don't understand why your last keystroke did what it did, you can find out. (If you're not sure what your last keystroke was, you can find that out too, because Emacs keeps track and will happily show you with M-x view-lossage.) If you don't understand how it did what it did, you can find that out, too. And if you want to modify what it does, there's a wide variety of ways you can do that, as well. Nothing in Emacs is inaccessible; nothing in Emacs is immutable. The only thing that can stop you, or even slow you down, from making Emacs exactly the tool you want it to be, is your own level of understanding and capability - and if you find it lacking, Emacs is there to help, and its community will cheerfully do likewise. (Oh, and the long-form manuals for everything in Emacs are built into Emacs, too.)
I've built several Emacs packages, and released a couple on MELPA to quiet but generally positive receptions - nothing particularly big or world-shattering, just small things to make other Emacs users' lives a little easier, or a little more fun. Almost everything I know about extending Emacs, I've been able to learn from Emacs itself, in the course of seven or so years of using Emacs. I can't think of another editor I've ever used, or even heard of, in which that would be possible. Considering the central position a programmer's primary editor occupies in her professional armamentarium, it's hard to imagine any other editor that'd do even half as much as Emacs to help me get my work done.
As you say, if I had to work in Java or C#, I'd probably find myself having to use Eclipse or IntelliJ or Visual Studio or what-have-you. It's not going too far to say that one reason I'm largely unwilling to work in those languages is because I wouldn't easily be able to do so in Emacs. That may strike some people as an astonishing assertion, and a foolish attitude toward choice of language. That's reasonable enough, but I misdoubt most experienced Emacs users would find themselves feeling much the same way.
My plan was to open up the manual and start reading, but maybe you found an article or tutorial that helped kickstart your org mode knowledge, so I thought I'd ask.
(Apologies if the question is a bit offtopic.)
Also remember org mode is as simple or as complex as you want it to be!
http://doc.norang.ca/org-mode.html
for me the initial "aha" moment was when I realized I could do an agenda window with multiple customizable horizontal blocks, so at a glance I can see deadlines, projects I am working on and so on
Adding to this something like being able to fulltext search across all my org files via org-occur-in-agenda-files is awesome too
I switched between Vim and Eclipse seamlessly, depending on what task I was trying to accomplish. Vim is better at plain text editing, Eclipse is better at navigating convoluted Java hierarchies or debugging Java code.
For me, those tools are not exclusive but complementary.
Or if you use IntelliJ Idea it also has a plugin for Vim
Those editing plugins usually don't really wrap vim so all you get is "vim-like editing" or "vi(m) functionality" which often lack some of my favorite vim shortcuts.
I find it much harder to muscle memorize the differences between the real vim and the "fake" one, so I prefer the tools that I use side-by-side to have different key bindings (for example, I use the Emacs key bindings in Eclipse).
Maybe check for updates? They do seem to update it semi-regularly - I think they fixed the number-gt command within the last 6 months or so.
For me it's the question, why it's so hard to understand that people have different likings without to downgrade them?
Everyone thinks that his/her decisions are the most sensible ones, but in most cases they aren't.
Because while everyone can have this or that preferences, personal taste is not the be all end all argument, except in the "it's a free country" way.
Whenever we want to assess the state of our tools, and what we need to make them better etc, we need to reach an agreement beyond "works for me" and personal taste.
Preferred tooling for reaching maximum productivity is an inherently personal thing - you may do your best in emacs, the other guy in vi, yet someone else in Sublime3 on Windows. Nobody is qualified to make broad sweeping judgments as to what works best for everyone.
A few try, and some inferences can be made to the lowest common denominator (see modern UI design practices), but if we're talking productivity for the super-literate user, then no, absolutely not.
For example, I might say that I'm super productive in IDE X, but I don't know for sure that I couldn't be more productive in IDE Y or Editor Z with various plugins. I haven't consulted any research in making my decision nor have I conducted any real research of my own.
I guess maybe it doesn't matter. If everyone is "happy", maybe that's good enough. But I see people struggling to do certain things in their environment of choice and that ends up having an effect on not just them but potentially their coworkers.
Unless they work for themselves, that "anyone" can be: colleagues, supervisors, bosses, teachers, and even clients, and also industry experts and seasoned pros telling best practices.
>Preferred tooling for reaching maximum productivity is an inherently personal thing - you may do your best in emacs, the other guy in vi, yet someone else in Sublime3 on Windows.
And yet tooling is regulated all the time in all kinds of companies.
And all kinds of people mistakenly think they are more productive with X, where they would be with Y. People make bad tooling decisions all the time. For those people it's perfectly OK for others to tell them what they should use.
The great thing about Vi (and I presume Emacs as well) is that you can get keybindings for just about any IDE. I use Visual Studio for intellisense, but I install VsVim which gives it 90% of the most commonly used features of Vim. XCode has XVim. IntelliJ products have IdeaVim. I've used them all, they're all great. It's nice to be able to feel instantly at home in any editor.
Personally, I use IDEs for the work they were made for. But if I just want to edit text or don't want to set up a project just for an "application" that consists of two or three scripts, I use a good and simple editor with syntax highlighting. Anything else would be like using a car to get from your kitchen to the living room.
Both command line development tools and IDEs require work to get the most out of them. I used to think command line tools were better because I was more in control, then I realised if I just spent the time learning what IDEs were doing on my behalf I would still have more or less the same amount of control, especially if the IDE is customisable (which the best ones are).
So with command line tools you have the option to customise your workflow from the ground up, but with IDEs you have the option to customise your workflow from the top down. Both have advantages.
I think this is the biggest draw for Emacs. It's a fully featured lisp development environment. If you want to change it, you just write lisp. If your IDE is free software, you can do the same thing, but they aren't always that easy to extend. Emacs, shell script, and the various tools are a set of APIs that you can code against. Most IDEs are geared towards giving you a UI interface to the functionality, not a programming API.
And that's fair, but not really what I'm after most of the time.
You can do that with Visual Studio too with Visual Studio Extensions. You can also manage extensions (including those from other users) with a built-in package manager, just like in Emacs.
Here's a Visual Studio Extensions tutorial if you're interested:
https://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Buildi...
Compare that to couple of thousand commands available on the command line that do all sorts of things and that can be combined in useful, creative and often times unexpected ways. All that in addition to having a programmable command interpreter (i.e. the shell itself) that allows you to automated things you do often. Vim is often described as programming your text transformations, well command line is programming your workflow, but it is also more powerful because of the shear number of commands available.
Honestly, it's not a crime to like nice windows, y'know.
Something tells me instead of telling you what you can customise in good IDEs I should show you. With that in mind, tell me something I shouldn't be able to customise in Visual Studio and I'll show you how its done. To start this off, here's how to create custom keyboard shortcuts, as you can see it's very easy to do:
https://visualstudiomagazine.com/blogs/tool-tracker/2012/07/...
Take my first foray into vi, at its most basic level. I'm at a shell prompt, where I can use vi to edit multiple files, saving each one when I'm done with it and occasionally switching to another window to run something else, coming back when I need to edit more. But there's nothing storing my list of open files or buffers and where they are on my screen, my position in each file isn't saved; it's like vi expected me to spawn a new instance every five minutes.
When I tried emacs, which allows much more functionality inside the editor -- connecting to servers, databases, or hosting shells or debuggers -- it just made the problem worse. If I started a shell inside emacs before stopping the emacs process entirely, that shell won't be there when I get back and my files won't either. If I want to have a specific file on the right-hand side of my screen, emacs will forget where I put it. If I open a file in a new window, that file will be gone. If I want to have a file stand out by changing its background colour to a subtly-different hue, that will have changed back by the time I need to re-open my editor.
I don't like this idea; I don't want my editing environment to be some ephemeral process that's created when I start and gets destroyed when I'm finished. And while Vim has sessions and Emacs probably has three forms of saved states, they don't quite work: no saved window positions and sizes, no working with files you haven't given a name. I imagine that it's the same feeling you get when you read that something allows Emacs-like functionality: on a checklist, they might both have tick marks on each row, but when you try to use it, it doesn't work how you expect. I think that Emacs and Vim's command-line history have made its users used to this behaviour, spawning all sorts of tools to make configuring your environment easier instead of just trying to save the changes as they happen. I've seen plugins like CtrlP or projectile that enforce the idea that your environment shouldn't last, you can just set it up again each time. And that means you don't bother personalising your environment and putting things where you want them to be, because it's all going to be irretrievably gone if your computer crashes, so don't get attached. Alright, rant over.
This is useful for long running work, but more often it is not necessary. If you are just exploring the code base or making small edits here and there you don't really need persistent tmux session for that.
But yeah, that's pretty much my objection -- it's not a big one, and there's room in the world for more than one type of software. I'm aware of tmux, but it just shifts the problem from vim to tmux: once you need to upgrade tmux, or your OS, or your computer, everything you've set up gets lost, and I really don't want that to happen.
I'm also aware of things like teamocil, and I even used itermocil for a while. But it turns out that the kind of environment edits I like to make are ones that I just do, rather than ones I can specify in a config file then restart to set everything up again. For example, when you say:
> If you are just exploring the code base or making small edits here and there you don't really need persistent tmux session for that.
Coincidentally I do have a relevant example for that. Last week, when I was exploring the files that make up the zoneinfo database, I put the files that I needed to keep referring to (of which there were like 5) to the side, knowing full well that they wouldn't go away. Then they just stayed there for a while as I got distracted with other stuff. This week, when I had to return to it, they're still there; and all the files from the other projects I'm working on are all in their positions, too, ready for when I switch back next week, surviving through a system restart and an editor upgrade.
Do not close vim.
I keep a main vim instance which has different buffers open. These buffers have their own history, e.g. undo-tree, etc. And keep in mind, that it takes time to get adjusted to vim, otherwise one gets overwhelmed quite quickly. E.g. I suggest to ignore windows and tabs at the beginning and get comfortable with buffers first (e.g. mostly I only use buffers).
However, as someone once said: "The universe tends toward maximum irony. Don't push it." If you don't close vim and keep it open for weeks, then all your environment changes are going to keep on building up, only for you to lose everything the next time you need to restart your system, or upgrade your editor or terminal, or your OS crashes, or there's a power failure, or your computer catches fire.
Which editor are you used to using that does, though? I ask because I'd like to experiment with it a little and see what it does and, to the extent possible, how it does so, because that seems like a useful capability for Emacs to have, and one of the nice things about Emacs is that it offers a programming environment flexible enough to support most other editors' "hey, neat" capabilities - the Sublime minimap, for instance.
I there an editor/IDE you use that gives you the persistence?
Most modern IDEs also have a notion of session.
Emacs is not a 25 year old developer experience, however. It's got an integrated package manager; responsive full-project text search (helm + your chosen grep tool) and path search (helm + projectile); good to excellent support for dynamic languages in particular (there's a nice synergy with e.g. ruby/pry).
It's not as strong with statically typed languages. There's no project-wide full-fat high fidelity symbol database support. There are a variety of projects to try and implement things along those lines (semantic etc.), but Emacs Lisp isn't the right tool to get the necessary level of performance. I'd love to see Emacs on Guile come to fruition; the ability to escape out into a language with less freedom to mutate scope (and thus optimize) would be a Good Thing.
I use Emacs (on Linux) to write JS, CoffeeScript, Ruby and C++; I use Eclipse to work with Java (though I'm considering switching to IntelliJ). Working with Java in Emacs is an exercise in pain, particularly since things like wildcard imports are frowned upon in the Java world. Eclimd is not good or reliable enough when used from Eclipse. Eclipse is deeply unpleasant to use compared to Emacs, which I'm able to easily customize to my preferences.
- You can just live in it. You don't have to leave. I watch TV using dired to run mpv and use org-mode for my todo list. It's all right there.
- Once you get used to one set of keyboard shortcuts, you can harness an enormous amount of power throughout the whole environment. This is true in some IDEs too, but IDEs don't usually offer
- Rust. Rust is actually one of the main reasons I started picking up some Emacs. There are no good Rust IDEs. There's crappy VS and Eclipse plugins. There's Atom plugins, but Atom freezes randomly when running code with Cargo and the DPI scaling still doesn't work properly on Windows. SublimeText was the only thing I could find that worked, and while it worked I wasn't willing to commit $70 to buying a text editor. Then I tried Emacs and it works absolutely beautifully.
- Emacs has really take advantage of the GUI paradigm too, check out the minimap: https://www.emacswiki.org/emacs/MiniMap It's not just some outdated console application that no one uses anymore.
- You don't need a different IDE for when you're writing python vs C++ vs Javascript. There's no switching. Just open whatever you want in that permanent emacs session you have running.
- Most if not all IDE features are actually available easily via plugins, yes, there's a little configuration involved but most of the time it's not too bad. And I'm a tinkerer so I really don't mind.
Overall, IDEs are great if you just want to sit down and code without the tinkering. But if you're willing to put the work in, I think you can get much more comfortable in something like Emacs where you have deep flexibility and access to most (if not all) of the same features once they're set up. I can definitely see the appeal. Especially of really unique stuff like org-mode that you just can't get anywhere else.
Only recently some competition has emerged, from Intellij.
Because for a lot of tasks using the mouse is garbage compared to the speed you can get using the keyboard.
> I think there's some research by Apple (?) that shows this.
There was, but it was bogus. The subjects were given a paragraph in which every ‘e’ had been replaced by a bar ‘|’ and they had to change them back. But they were only allowed to use the basic Macintosh text box, so they had to use the cursor keys to move to each ‘|’, delete it, and type an ‘e’. Obviously (obvious to vi users, anyway) this is not an efficient way to use the keyboard. :s/|/e/gFor example, these are some of my favorites:
https://valloric.github.io/YouCompleteMe/ - Code completion for C/C++ and other languages
https://github.com/ctrlpvim/ctrlp.vim - TextMate style ctrl+p fuzzy file finder
https://github.com/scrooloose/nerdtree - Tree explorer plugin for browsing files
https://github.com/vim-airline/vim-airline - Customizable status line for showing all kinds of useful info about currently edited file
https://github.com/tpope/vim-fugitive - Git wrapper that works together with airline
https://github.com/mhinz/vim-startify - Shows your most recently edited files and favorite files on the start screen
https://github.com/tpope/vim-abolish - Smart text replacement, easily replace eg. getColor, GetColor -> getTransparency, GetColor and so on
And this combined with the fact that I can do all of this from the tip of my fingers, without having to touch the mouse, with high customizable commands that go into my muscle memory, there is no substitute for VIM for me.
I've worked with Eclipse, Xcode, Visual Studio. They have some pretty nice features, like interactive debugging that are hard to replicate with Vim, but I'm more of a "print debug message" kind of guy anyway, so that doesn't bother me.
The biggest hinderance with Visual UIs is that I have to use the mouse, and that sucks. So much faster to do text selection, copying, replacement, renaming and so on straight from the keyboard, once you get used to it.
I'm still discovering active new ways to customize VIM after over 15 years of using it.
I also think that interactive debugging of any kind is much faster than printing debug messages most of the time. Even if it's just something like Ruby Pry, where you have a command line REPL while stopped on the breakpoint, it feels like a huge time saver when you can be stopped at a particular point and are free to check any variable and step whenever you want. Granted for some cases, like production web sites, there's no alternative to writing debug messages and trying to figure out what happened through them.
But each to his own. And like answered already, the YouCompleteMe uses clang to provide intelligent autocompletion for C/C++.
But I think there is this huuuge group of people that enjoy the integrations. Xcode can't do much besides be a pretty GUI for clang and lldb. If that's enough for a developer, then Xcode is perfect. If a user likes some more customization and integration than just that, then they're out of luck. For Xcode, there are some very basic plugins, used by people who just need Xcode + some small adjustment (eg. me wanting some vi bindings). On the other hand, for vim and emacs, there are plugins for anything and everything, from irc to mail to ordering salads for launch [0]. When a user is comfortable enough and wants to live inside their editor, then I don't think vim and emacs can be beat by any other modern editor/IDE.
Maybe atom will be the new emacs in a few years.. who knows :)
So your assumption hinges on the expectation of a user which is not at all similar to me or most other Vim powerusers.
Yes, they still keep their keybindings, which don't match the common "modern" editors, but honestly, that's a big part of what people like about them.
I use Vim for several reasons: First, it's language neutral which is good if you use many different languages. Second, I touch-type and like to avoid as much as possible the use of the mouse/trackpad. And finally, it's available everywhere.
But yes, I agree it has its limitations. A lot can be done with plugins, but it then becomes more fragile and a mess to maintain. I think it still makes sense to use Vim (+ a few light-weight plugins) for smaller projects .
Other than that, my plugin selection mostly includes plugins that add specific motions (EasyMotion), commands (vim-surround), or behavior (detectindent.vim).
On the other hand, I absolutely despise plugins that claim to turn Vim into an IDE for $language. These tend to be bloated as fuck.
Another reason is because I conciously have decided that gnu and gpl are what I want to run whenever possible, which also affects my other tool choices, eg, screen vs tmux.
Using a SmallTalk system was a somewhat different experience. Now that was integrated.
The VM ( or image) is the run time and the editor at the same time. The level of integration and introspection made the whole thing very powerfull and inspired other IDEs to have this features, which without the software development could have been very slow.
Yet as opposed to ST, Mesa or Lisp they have to integrate this with files and executables, which makes things a lot more cumbersome. And then you get something like the web, where the moving parts are even further removed from each other.
The problem is that IDEs and powerful editing aren't exactly opposites (let's not forget that Emacs is basically a Lisp IDE). But I've yet to see an IDE that comes close, mostly because the lack of a good extension language (plugins are way too heavy), and possibly because the GUI provides a bigger impedance to additions.
I really like the trend towards "headless" IDE backends.
I took a class that used Pharo and made my workspace freeze a couple of times.
A remote protocol talking to a 2nd vm would have been better.
Existing responses already covered a lot of things, but the simple answer is: most of us don't.
The state of these editors and tools 25 years ago, while largely the same, is still very different: there are still major improvements, many new packages, etc.
Could I work on a 25-year-old system? Sure, and it'd be largely the same, but it'd be pretty uncomfortable; those subtleties matter a great deal. ;) Especially in my editors (both Emacs and Vim), and on the command line (both tools and even readline).
Every so often, I come across a cool open-source project that I would like to build and tinker with, only to find that it can only be compiled if the Visual Studio solution file or XCode project file from the repo is used.
Or let's say, it could be compiled probably, but replicating all the logic hidden inside the solution/project is ridiculous.
That's not to say that you can't have the best of both worlds. For example, CMake can generate both Makefiles and VS solutions.
I use MacVim and my .vimrc file follows me around wherever I go. My experience is great in my editor because the few minutes I invested here and there have huge payoffs over time whereas most IDEs plateau.
Minor nit in support of parent comment: no it doesn't, you have to copy or sync it around yourself.
Atom is a great example of an editor that is aware of the internet existing. Vim, while my daily driver, is not.
I don't know how I'd securely and easily have a powerful editor configuration follow me around.
A powerful editor can do damaging things: it interacts with its host system; it can run commands; it can read and edit any files on disk; it can access the network. That means that I — not some web site run by attention-deficit VCs and subject to any number of hostile governments — must have ultimate control over what it can do.
So it has to be secure. But security means that the configuration may not be visible to others (because it may contain information I choose not to release) and it means that the configuration I fetch today must verifiably be the configuration I pushed yesterday. That means hashes, and signing, and identities.
None of that is easy, and building that infrastructure just for trading editor-configs seems like a waste. Wouldn't it be nice to have a general infrastructure for that?
So maybe it makes sense to sync editor configs around after all.
Because i develop on very expensive hardware on a different continent. I also end up with a decent mental model of my code.
The carbon footprint is much nicer.
A: Rarely.