10 ms·
Someone should write "become IDE literate" as a response to opening of using vim with no extensions and using grep a lot. I've been using editors that are lang
by gfxgirl 6y ago
Someone should write "become IDE literate" as a response to opening of using vim with no extensions and using grep a lot.
I've been using editors that are language aware since at least the late 90s. Depending on the language they'll show me all references, take me to the definition or declaration, stack those jumps so as I follow the links I can pop back a level to where I was. All of this is instant. 1000x faster than opening a shell and trying to grep all the project files for word phrases which, not being language aware, can't tell if one 'foo' is relevant or irrelevant from another 'foo'. They'll also let me refactor various things from renaming a method/class/variable/function and correctly fixing all the related files to doing things like changing class members to getter/setters and other things.
The difference is like using a hammer vs using a nail gun. There are times where they hammer is useful but given the job of constructing a building a nail gun will get the job done much faster.
- bentcorner 6y agoI do like my IDE but my one complaint with leaning on it a lot is that it lets you write code that is harder to understand if you don't have that IDE readily available. For example, if you name a member "flag" and you have several types with the same member, your IDE can tell you where this flag is used, so it's not a big deal if you wanted to refactor or are trying to track down a bug. But god help you if you're looking at your code in a diff viewer or in your browser in an online repo.
- morelisp 6y agoA better example might be perpetuating typos (and other less obviously wrong bad names), the number of times I've seen some variant of "setIntercetpor" or "closeDataSteam" or... anything that gets actually typed as "most of the first word plus completion."
- tracyhenry 6y agoYour example sounded like results produced with editors that do not understand the underlying language. A proper IDE would not prompt you with closeDataSteam if it's not a member function of the object to which you want to close the data stream.
- BlueDingo 6y agoRight, the typo was done once and from then on the IDE offered it up for auto completion.
- scns 6y agoIntellij would mark those with squiggly underlines and even jump there in an otherwise error free file when you press f2.
- MereInterest 6y agoI think it also comes into the language design. If you expect programmers to use an IDE, then language features and best practices can require large amounts of boilerplate, on the expectation that the IDE will be generating that boilerplate. For languages expecting no IDE to be used, the language itself needs to avoid that boilerplate.
- gfxgirl 6y agoI'm not really sure of your point. I can't imagine naming something "flag" but I can imagine "enabled" or "visible" In my experience it's not common to name members/properties taking other classes into account so I might have a Window class with "visible" and Shape class also with "visible" and Player class with "visible". I don't think I've ever seen a project where they made those "someWindow.windowVisible", "someShape.shapeVisible", "sompePlayer.playerVisible" just for the sake of searching regardless of if they person is using an IDE that could tell the difference or just notepad/nano. All of my experience is they would all be just "someWindow.visible", "someShape.visible", "somePlayer.visible". In other words, that choice has nothing to do with IDE or no IDE. Is there some other example you were thinking of?
- turbinerneiter 6y agoCool. Still, a lot of people start out programming with complex IDEs and end up being unable to run their code without the "play" button of their IDE. Starting out, or only ever leaning an IDE is also hiding a lot of things from you. For me, knowing the shell isn't about IDE vs. shell tooling, it's about, whatever you use, be aware and knowledgeable about the foundation and being able to do stuff even if there is no IDE. An IDE is a great tool, but it shouldn't be a crutch. And vim without extensions - I'm pretty sure that's a rare thing among programmers.
- phkahler 6y ago>> Still, a lot of people start out programming with complex IDEs and end up being unable to run their code without the "play" button of their IDE. Yep. Another thing I hate is IDEs that build their own project files that tie you to them. A good IDE works with standard tooling, not as a replacement.
- azalemeth 6y agoI could not agree with this more. I've worked on projects with some unholy combination of (gnu) Makefiles and VS Solutions. I've never "got" Visual Studio and have always found it very jarring -- but I mostly don't use windows much, and that always feels like it has a way of thinking that is...very orthogonal to mine. KDevelop has honestly been the best "not in your face" IDE I've personally found. I mostly do not do any MacOS programming, but when I have occasionally played, I've realised that xcode is brilliant but it seems like it utterly reinvents itself every major revision number. Eclipse, something I rarely-if-never used has sunk from a popular zeitgeist without a trace. Many of my colleagues (in a medical imaging setting) use jupyter, RStudio or Matlab, occasionally venturing into julia. The winds shift, and the ship of progress sails a direction that is difficult to chart, but vim....vim never changes, and for that I am very glad.
- rjsw 6y agoI'm not really an IDE person but I find native Netbeans projects easier to understand than Maven ones.
- 6y ago
- mixmastamyk 6y agoOpening a shell is not an obstacle when you've already got several open. Also, not all of us are refactoring huge codebases or using verbose languages that require a lot of handholding. The hard part of development is typically not at the typing or syntax levels, and I have the stdlib of my favorite libs close to memorized already. The most helpful ides tend to be massive as well. Tools can be useful however, such as the hot reload of flutter/dart. That's the kind of improvement I really appreciate.
- turbinerneiter 6y agoRegarding the hat part not being the typing - yes! Every tool, plugin or functionality takes up some space in my mind. Once I know the tool really well, that space becomes smaller and the benefit of having the tool outweighs the cost. This is why I only add tools and plugins slowly. One at a time, only after I mastered it I add something new. And I weed out my tools from time to time and remove things I don't use often enough. Maybe the people who use feature rich IDEs just have more RAM and a more parallel brain, and the CLI people have serial brains :D
- l3s2d 6y agoIt wasn't clear from your comment if you're aware of this, but Flutter hot-reload works from the command line too! I do all my Flutter development in 3 windows (vim, `flutter run` shell, android emulator).
- mixmastamyk 6y agoGlad to hear, I've barely started with it.
- humanrebar 6y agoI agree. But it's worth pointing out that IDEs provide depth for working on a given project. If you want to provide breadth across many projects (like writing a custom linting script), you do want to be she'll literate. Not every automation task can be specified in with grep and such, but quite a number of them can. And the ones that can't be written in terms of the shell often benefit from hybrid solutions that combine shell tools and specialty tools like parsers.
- jeddy3 6y ago> 1000x faster than opening a shell and trying to... Not commenting on who is right or wrong, but there is a key difference in your workflow here. OP is not opening a shell at this point. The shell is the first thing being launched, vim is secondary.
- l3s2d 6y agoI've found that IDEs work well when you're working within a single language or framework, but are clunky for multi-language projects. It's easier for me to have 4 terminals open (2 for vim, 2 for execution) than two different language-aware IDEs. With the IDEs, I need to pay attention to which IDE I'm in since they have different shortcuts and UIs.
- lol768 6y agoWhich languages do you mix and match that something like IntelliJ IDEA can't support?
- mattmanser 6y agoOn top of that, his opening example is so easy if you use a GUI for Git it's mind-boggling. It'd literally be click status column to sort, click top entry, shift-click bottom deleted file, right-click, restore. Done, a couple of seconds without even thinking about it. And somehow this simple task in a GUI inspired a blog post about how useful the shell is. I'm not going to deny a shell is extremely useful, and knowing far more than I do makes you a better programmer, but there's also using the right tool for the job.
- boogies 6y ago> Done, a couple of seconds without even thinking about it. This was originally done in a couple of seconds without deeply thinking about it (hence originally using grep instead of `awk '/re/'`). (Edit: quote)
- dan-robertson 6y agoThat relies on there being a sufficiently versatile gui which isn’t guaranteed. Here’s some features that your example requires which I often don’t see in guis: 1. Tables you can sort 2. Tables you can sort on the thing you actually care about 3. Being able to select multiple entries and act on your selection It’s not too hard to imagine criteria which could make the problem much harder for a gui, e.g. only doing the operation in a subdirectory (if the sorting is stable this isn’t so bad), or only on files not in a subdirectory (stable sorting won’t help here, you’d need the gui to let you eg search for / and then remove those things from your current selection), or only operating on .h files (you’d need a search->select feature again), or doing an operation that the gui doesn’t support on multiple files, or passing the list to some other tool (maybe you want to search makefiles for references to the deleted files). Something that a gui may be able to handle but that often screws up shells would be file names with newlines or spaces in them.
- turbinerneiter 6y agoIn the end, your are gonna write regex either way :D
- mattmanser 6y ago
- yumaikas 6y agoI'd also argue that it's helpful to understand the technology underlying your IDE, if only to be able to debug builds. (Understanding that MSBuild exists, and can be called from the command-line, for example, is a handy skill).
- jeddy3 6y ago> The difference is like using a hammer vs using a nail gun. I feel like this metaphor falls short. The IDE, IMHO, is more like a multi-tool with pre-chosen use cases, but everything fits together nicely. Using the shell is more like choosing the exact tools for the job, and maybe connecting them together in a make-shift fashion.
- IggleSniggle 6y agoYup, like having a 9-in-one painter's tool vs having those 9 tools individually in a toolbox. Usually, its super convenient to have all those tools integrated because you can scrape some paint and pound a nail and pull a nail all right then and there with needing to do any swapping out or hunting for the right tool. But the instant you want to be able to hold a bolt in place with the wrench function while simultaneously using the hammer function, you're shit out of luck. The painter's tool, on its own, can't be de-composed to do those things simultaneously. Plus, it's not as good at being a general purpose hammer or a general purpose wrench. But in the context of the tool, you don't really need a full fledged hammer or wrench. Having a single small tool you can hold in one hand is usually more pragmatic, even if less versatile. Probably still gonna want the toolbox to be available for when you need it, though.
- holri 6y agoA literary man creates new meaning out of words. You can do this in the shell by combining tools in new ways. You can not do this easily with an IDE, it only has a predefined meaning. Using an IDE is not literature but transcription.
- oblio 6y agoWell, 95% of software development is writing invoices, not poetry, so...
- gorgoiler 6y agoThe two worlds of editing general purpose text files, when compared to editing a large amount of a very specific kind of text file, look very similar. I’ve never seen advocacy for one over the other as a competition. I do plenty of both types of editing, and often edit the same files simultaneously with three different tools. (Example: Editing notes in Notable, Atom, and vim.)
- j1elo 6y ago> take me to the definition or declaration, stack those jumps so as I follow the links I can pop back a level to where I was. Know any C/C++ IDE that would do this? I transitioned from Qt Creator to VSCode and none of those have helped me with this cool nicety you mention. EDIT: I should add that for me, exploring foreign code bases has been hugely improved since I discovered Sourcetrail, so I'd suggest having a look at it to anyone interested in code exploration tools: https://www.sourcetrail.com/ https://www.sourcetrail.com/
- hagy 6y agoI've found Jet Brains' CLion to do a solid job of code navigation, but I don't currently work in C/C++ and only use it occasionally for reading code bases. I do use Jet Brains other editors and Intellij has flawless Java code navigation (among other amazing features). Further, I've found PyCharm provides Python code navigation that is about as good as possible for such a dynamic language. Therefore I'd expect CLion to provide top notch code navigation for C/C++.
- demosito666 6y agovim can definitely do it with CoC
- nec4b 6y agoVisual studio code can do this. https://stackoverflow.com/questions/35424367/how-to-navigate-back-to-the-last-cursor-position-in-visual-studio-code https://stackoverflow.com/questions/35424367/how-to-navigate...
- teeray 6y ago> they'll show me all references, take me to the definition or declaration, stack those jumps so as I follow the links I can pop back a level to where I was. All of this is instant. I do this in stock vim using ctags files. You can generate them with anything, though “exuberant ctags” is very popular. Ctrl+] when over an identifier jumps to its definition, and there’s a tag stack to jump backwards similarly (you can also use the jump list). This too, is instant. It’s also an essential feature of the help system in vim for navigating cross-references. There’s also other robust IDE-like features built-in. Syntax-aware code folding (with adjustable fold levels, see ‘folding’), compiler integration so that it’ll highlight where compilation errors occurred (see :make, makeprg, errorfmt) and so forth. Not saying your life won’t be better without some plugins, but stock vim is quite a bit more powerful than having to shell out and grep.
- tracyhenry 6y agoThe point of IDE is that there is almost 0 configuration. You get everything by just clicking "install". Y you can configure vim or emacs to be as expressive as IntelliJ. But the time it takes is much larger than 0. And when you switch to another language you'll probably need to repeat many steps.
- addicted 6y agoThe point of the OP is to not configure vim or emacs to do all that but to simply use the UNIX (or platform equivalent) shell.
- agumonkey 6y agoNah, the issue is that whenever the IDE doesn't provide a shortcut for whatever you're back to negative one. That's why people like mechanisms (grep, sql or similar) over policies (here, whatever is given to you by the IDE), you can always adapt. Other than that, a good deal of open mindedness and skillful use of IDEs is not a bad trait. Let's not be extremists.
- avl999 6y ago> Nah, the issue is that whenever the IDE doesn't provide a shortcut for whatever you're back to negative one. You are not back to negative one, more like you are at square 85. There is nothing stopping a developer from supplementing something that the IDE doesn't easily support. For example I use PyCharm these days and I when I make a change to a file I automatically want the test associated with that file to run- this is not supported in PyCharm (or atleast I don't know how to get PyCharm to do it) so I wrote a script that runs in the background of my shell watching for changes on files on my project and running appropriate tests. The point if an IDE doesn't have a quick way of doing something that is necessary for your workflow, it doesn't mean that the 20 other things that the IDE does are useless. Any working developer should continue to be able to extract value from the features that the IDE provides and jump back to fill the holes themselves (via shell scripts or what have you) instead of saying "Whelp this means IDE is a crutch now and I must revert to only using 'Unix as IDE' and only relying on sed/awk/grep and friends" to aid my development workflow.
- agumonkey 6y agoMaybe I was traumatized by eclipse. Anything to extend in it required a federal reunion and a taskforce.
- memetomancer 6y agoThis speaks more to the narrowness of your view than it does about shell. Example: I work with parallel filesystems quite a lot. Often I will need to parse through GB of logs spread across a cluster to track down a particular sequence of events for troubleshooting. I could load up a fancy IDE with all the bells and whistles, one that instantly refactors all my 'foo', and still spend a (very) non-trivial amount of time carefully crafting (and documenting, and debugging) a proper application to solve the particular problem I'm working on. OR - I could rattle off a pipeline using a few general tools and get the needed details in less than a minute. You analogy about hammers is particularly amusing, invoking the old saw "If the only tool you have is a hammer, every problem looks like a nail". You take this to the absurd degree that you end up championing nail guns!
- tracyhenry 6y ago> "parse through GB of logs spread across a cluster" Why would you do that with IDE? The OP is comparing IDE v.s. shell in terms of "exploring" and "editing" the code. In that case IDE is a powerful nail gun and championing it isn't wrong.
- hagy 6y agoI strongly agree with this narrative and it matches my own experience. I spent 9 years of college and then grad school using exclusively either vi or emacs because I believed IDEs were a crutch that weak engineers relied upon. It wasn't until I got a real job that I found myself forced to learn a proper IDE (IntelliJ). It blew my mind just how powerful the IDE was and how it massively increased my productivity. Putting aside code completion and code generate, I found it much easier to navigate a codebase using a proper IDE that fully understood the language. When I contrast that to my previous solution, a highly customized emacs configuration with lots of packages and my own functions, the two just don't compare.
- saurik 6y agoI think part of this is that the people who use IDEs then prefer the actual code to be dumbed down to the point where the IDE can both understand it and then is required to manipulate it; I hate programming in Java because it is a language kind of designed to make it hard for me to build my own rapid abstractions... which of course would break the ability of the IDE to parse it at all much less refactor it; but, I then argue that the more powerful code abstractions obviate the language flaws that required "refactoring" in the first place. And to me, that is a way in which I feel like IDEs are awkward and harmful, but it is almost more at an ecosystem level than at the scale of a single person.
- avl999 6y agoYou have it totally backwards, people who use IDEs don't like "dumbed down code" for the sake of the IDE. Nor are languages like Java designed with their IDEs in mind. The IDE is designed with the full language spec in mind, understands the language at the AST level and supports the full set of language features and all their permutations. A developer who is writing code in IDE is utilizing every permutation of what the language provides and it is upto the IDE to understand it. IDEs for the most part are not covering for language flaws, they are helping developers be more productive by removing the need to focus less interesting parts of the process and focus on the the problem being solved. While the need for an IDE is more important in some languages over others, there are a set of common problems that exist in every language that the IDE can help solve (navigating the codebase by jumping around to symbol definition/usages, auto importing packages/modues, intellisense, refactoring). Refactoring does not mean going back and refactoring 6 weeks worth of work that you seem to have in mind. Most people who refer to refactoring are referring to it in the context of multiple small refactors during very short development cycles (every few minutes or hours). My workflow and the workflow of many developers I have worked with goes like this: * Write some code (not more than 200-500 lines) * Write tests * Refactor if needed- potentially rename variables, potentially extract some code into methods, potentially pull stuff up into constants, potentially introduce a new class or interface, potentially change types of certain members, potentially visibility of certain members or methods. * Repeat for the entire workday when you are not in meetings. Refactoring- specifically the kind of small scale refactoring that you do as go through your workday to me is almost as important a part of the development process as anything else and IDEs remove almost all friction from it by removing any cognitive load of the task from the developer.
- slmjkdbtl 6y agoFor scriptable editors the difference is more like giving you a home depot vs a multi-feature nail gun. There're option to use other people's scripts (buy nail gun directly), or script yourself (buy parts and build your own nailing tool that suits your need, but do need to invest time in learning and building).
- chaganated 6y agoSounds like a reinforcement of Drew's point to me. Using the IDE to jump all over the place, and blast changes over several files at once, suggests severe and unnecessary non-localities and tight couplings in the code. Maybe without the IDE, the code would have ended up a little cleaner.
- __turbobrew__ 6y ago> 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?
- a1369209993 6y ago> I imagine this can be a feature in some cases and a limitation in others. Technically true, but it's only a limitation in the sense that not being allowed to use asbestos shingles and lead pipes is a limitation for someone building a house.
- mrkeen 6y ago1) I'm not going to teach Jenkins to use IntelliJ. I want my build step (whether gradlew or make) to be runnable in the same way as it runs in scripts. I get to set (and read!) env vars when they're right there in front of me, not hidden away behind dialog boxes. > 1000x faster than opening a shell Don't close the shell. > trying to grep all the project files for word phrases which, not being language aware, can't tell if one 'foo' is relevant or irrelevant from another 'foo'. IntelliJ is the gold standard according to my Java buddies and when I search for a class (by hitting ctrl-N ... go figure) I frequently don't get any results. Some kind of misconfiguration will silently make things not work. It happens enough that I have to second-guess its results, even when they're correct. Now I only use ctrl-N to jump back and forth between classes I know exist. Actual searches I'll leave to find/grep/ag. Likewise when I optimistically right-click some part of my project and click 'Run all tests'... "No tests were found".
- hiq 6y agoRegarding Intellij and looking for classes / running test: I think this mostly depends on whether you're casually browsing some random project, or if you're gonna work on the same project for several weeks. It's fine to try to open the random project in your favorite IDE and see if it just works. If it doesn't, and you just need to figure out what the code does, fix a few lines of code, going back to a text editor, grepping and trusting the CI to run the tests itself is just less overhead. If you work on the same project for a longer period of time, you can easily justify the upfront cost of configuring your environment properly (and have your class searches and 'Run all tests' running).
- adamkf 6y agoI've been using a lot of typescript lately. The ide support in vscode/tsserver is very complete, but it is NOT fast. As an example, it frequently takes multiple minutes to use find references. Rg or git grep with fzf are both hundreds of times faster, and are easier for me to navigate. (Obviously language aware find references is much more powerful, but with carefully named variables it's acceptable to just use rg.). Sometimes, even a simple "go to definition" results in a 45 second hang. (This is on a 2019 Macbook pro) I've also used intelij idea with Java, and while it was much smoother than anything in the typescript ecosystem, it's definitely not faster than using grep.
- yellowapple 6y agoA big part of the reason I gravitated toward Emacs is that it hits the best of both worlds there; by default, it's a simple editor, but it can be extended with the exact set of IDE-esque features with which I'm comfortable.
- enneff 6y agoThose tools are all great and I have that in Vim but I also have the whole shell environment to do many other things that have nothing to do with the content of the code.
- demosito666 6y ago> Depending on the language they'll show me all references, take me to the definition or declaration, stack those jumps so as I follow the links I can pop back a level to where I was. All of this is instant. Vim can do this too and (rip)grepping the code is only needed if you're looking for, you know, text. I have 'gd' mapped to "go to declaration" and 'gr' to "find references". Works across dozens of languages, can be further scripted upon. Basic refactoring (renaming class method in several files) should also work, but I use it so rarely that actually can't testify about it (I use rope bindings for python refactoring but it's usually limited to a single file). It's not as honed as purposely built 5GB IDE of course. But having one editor for all languages and syntaxes is really nice. Things like VSCode have this one too, but I wouldn't call them and IDE either. I haven't been using IDEs any meaningful amount of time as I'm not a developer, but if the things you mentioned (go to definition, changing names) are the main reasons for an IDE, one could argue that terminal workflow has substantial benefits, like better understanding of the toolchain, simpler integration with ci/cd tools, endless customization, single tool across languages and other standard cons of CLI tools. I do, however, find vim without extensions useless for editing code as well.