Stories
Slash Boxes
Comments

SoylentNews is people

posted by Fnord666 on Sunday December 25 2016, @11:38PM   Printer-friendly
from the interview-was-done-via-emacs dept.

Early developers were struggling. They loved the landmark text editor vi but needed something that was available on more than just Unix.

They needed something more tailored to programmers, something that supported syntax highlighting for various languages and remote editing via SSH. They needed to fine-tune their development environments with plugins to maximize their efficiency.

Dutch programmer Bram Moolenaar created his own solution and shared it for free, eventually asking only that users make a donation to a charity caring for children and families in Uganda.
...

Proponents of Vim commonly point out the same features as reasons why they use the program:

  1. Light and portable: Commonly used as a command line interface, Vim can be launched with a terminal, run through a GUI, or used remotely through an SSH connection. Vim is widely used on Windows, Linux, and macOS.
  2. Highly customizable and full of plugins: As with so many other open-source platforms, users have run amok with creating custom configurations, features, and plugins. ...
  3. Modality and no mouse functionality: It seems frustrating, but your fingers never need to leave your keyboard. Maximize productivity and coding time by using keystrokes to switch among normal, insert, command line, and visual modes. Keys have different commands based on which mode you’re in.
  4. Registers: Think of these as multiple clipboards. You can store copied text and macros, which record keystrokes for playback, in different registers. Registers, which persist between uses of Vim, help you save time by executing certain text in a fraction of the time.
  5. Motions and text-objects: Arguably our team’s favorite facets of Vim, motions and text-objects serve as the verbs and adjectives of the Vim language, allowing you to write your code über-productively. Motions allow you to tack on an action to built-in commands, so you can, say, delete from the current cursor position until the next occurrence of a letter. Meanwhile, text-objects are used in the context of motions, allowing you to declare commands inside or around words, paragraphs, HTML tags, and even current function blocks.

This submission prepared using the Firefox vim plugin, Vimperator.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by jasassin on Monday December 26 2016, @01:08AM

    by jasassin (3566) <jasassin@gmail.com> on Monday December 26 2016, @01:08AM (#445910) Homepage Journal

    Not using an IDE sets the bar too high for refactoring.

    As a non programmer but someone who can write a hello world program. Can you please explain refactoring, especially how it relates to integrated development environments?

    --
    jasassin@gmail.com GPG Key ID: 0xE6462C68A9A3DB5A
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 0) by Anonymous Coward on Monday December 26 2016, @01:49AM

    by Anonymous Coward on Monday December 26 2016, @01:49AM (#445922)

    Re-factoring: Reshaping text in a fashion that is so regular that the process can be automated (i.e., programmed).

    For instance, let's say you want to change the name of a variable; rather than manually finding every occurrence of the old variable name in order to replace it with the new variable name, you simply tell the IDE to make the change, and then the IDE does all that hard work for you.

    Of course, there are many more complex examples of refactoring, but surely you can extrapolate on your own.

    • (Score: 0) by Anonymous Coward on Monday December 26 2016, @02:35AM

      by Anonymous Coward on Monday December 26 2016, @02:35AM (#445936)

      Refactoring? That example seems like a simple query-replace, after doing a few (tap the spacebar) to make sure it's replacing what you want, just hit "a" for all, and the rest are done.

      • (Score: 2) by fnj on Monday December 26 2016, @06:10AM

        by fnj (1654) on Monday December 26 2016, @06:10AM (#445982)

        Negative. An tool (such as Eclipse) that supports code refactoring knows the difference between the string "huge" used as a variable, and the exact same string appearing in a comment and used in other contexts. Global replace is a very crude approximation which screws up. Try refactoring a 100,000-line or 1-million-line code base sometime using only global replace.

    • (Score: 2) by Nerdfest on Monday December 26 2016, @02:42AM

      by Nerdfest (80) on Monday December 26 2016, @02:42AM (#445940)

      Thanks. Renaming classes and functions across files, and references within configurations files, etc, is a pain to do manually as well as error prone. It needs to be done though or you end up with the typical improperly named functions and variables as their purposes changed slightly as development went on.

      It drives me nuts when i see hipsters developing (Ruby usually) on their doucheBooks using Sublime.

      • (Score: 0) by Anonymous Coward on Monday December 26 2016, @04:05AM

        by Anonymous Coward on Monday December 26 2016, @04:05AM (#445961)

        Just use some perl or sed script.

        • (Score: 4, Informative) by fnj on Monday December 26 2016, @06:12AM

          by fnj (1654) on Monday December 26 2016, @06:12AM (#445983)

          While you are perfecting and debugging your script and screwing up code, you could have effortlessly refactored 100 times.

      • (Score: 2) by linuxrocks123 on Monday December 26 2016, @11:16AM

        by linuxrocks123 (2557) on Monday December 26 2016, @11:16AM (#446032) Journal
        Merry Christmas to you, Nerdfest, and anyone else who desires this functionality: http://clang.llvm.org/extra/clang-rename.html

        Personally, though, I don't see it, man.  I don't spend most of my coding time renaming things.  When I do need to rename something, find/replace is usually fine, and when it's not, sed -i s/Old/New/g * is usually fine.  If I were working on a million line project, I guess I'd need to do sed -i s/Old/New/g `find . -name '*.[ch]*'` or something.  Still no big deal.

        But actually if I were working on a million line project I think I'd be careful before renaming something used across multiple files.  I mean, presumably there are other people working on this code, too, and it wouldn't be very polite to go all "LET THE NAME OF MOSES BE STRICKEN FROM EVERY BOOK AND TABLET" on the codebase without discussing the matter with them first.
        • (Score: 2) by VLM on Monday December 26 2016, @01:22PM

          by VLM (445) Subscriber Badge on Monday December 26 2016, @01:22PM (#446061)

          IDEs are kind of for people who can't learn emacs extensions or shell commands.

          If you do the polyglot thing and know shell, emacs, and your development language you don't need the IDE.

          Also there are some languages that are very verbose, COBOL, Java, and require massive verbosity which results in repetitive and expensive refactoring vs most every other language out there is less verbose requiring less refactoring.

          • (Score: 2) by Nerdfest on Monday December 26 2016, @01:57PM

            by Nerdfest (80) on Monday December 26 2016, @01:57PM (#446066)

            Emacs extensions and shell scripts don't take syntax into account. Just because something happens to be the same word doesn't mean it's exactly the same.
            I'm a fan of using the right tool for the job. If I wanted to show how hardcore a developer I was, I'd use echo and sed. :)

    • (Score: 2) by driven on Monday December 26 2016, @05:03AM

      by driven (6295) on Monday December 26 2016, @05:03AM (#445968)

      I remember JBuilder (the Java IDE) had a cool feature where you could select a block of code and say something like "extract method/function" and it would take that code, figure out what variables were being used in that code, and create a function with the required variables passed as arguments. The code you had selected would be moved into this new function. Nice little timesaver.
      I've gone the other way and switched from IDEs to Vim years ago. I do miss some of the productivity enhancements.

      • (Score: 3, Interesting) by TheRaven on Monday December 26 2016, @11:23AM

        by TheRaven (270) on Monday December 26 2016, @11:23AM (#446035) Journal
        Smalltalk had this feature back in 1980 (along with inline, rename method, rename class, and a few other things). A lot of these things are now being built into the clang libraries. The clang-rename tool lets you invoke them from the command line and is designed to be invoked from editors (there are vim and emacs plugins). XCode and a few other IDEs use the underlying tools directly from the libraries.
        --
        sudo mod me up