Organiccat
Organiccat

Reputation: 5651

What are the IDE advantages of recorded macros?

Just as the title says, I see a lot of editors touting macro recording as a feature but cannot find a way to take advantage of these functions myself. So what can you use it for? The type where you can record mouse movement and/or keystrokes? Is it really that helpful to people out there? Specifically, I deal with Eclipse which has a number of built in "fill in" functions, so I really don't see what the advantages could be.

Upvotes: 4

Views: 711

Answers (6)

Dutch Masters
Dutch Masters

Reputation: 1459

I don't use them in Eclipse either. Here's why:

  1. Eclipse has many powerful built-in functions and refactorings. So with code, its not necessary.

  2. Eclipse macros aren't that great. You can record them, but its hard to tweak them and do exactly what you want.

  3. Macros become more useful in things like modifying files that aren't code. For that I tend to use something like vim. Also, you have to actually practice using macros to recognize when they will help.

Upvotes: 0

rjzii
rjzii

Reputation: 14533

Depends on what you are doing and what language you are work with. As a simple example, right now I am working with a Visual Basic .NET application that has a number of queries in it. I generally do all of my work with queries in Toad, but Visual Basic .NET has an annoying syntax when it comes to long strings, namely:

Public Const SelectData As String = _
"SELECT * " & _
"FROM myTable " & _ 
"WHERE myField = :SOMETHING"

Since I really don't like editing the queries when I copy them out of the code or pasting them back in, I have some macros that will automatically format or strip the formatting from them.

Also, some of the macros can be used to automate common tasks that you need to do around the IDE while you are working. Any sequence of commands that you see yourself doing often is something that you can turn into a macro and do with just a single click.

Upvotes: 1

Colby Africa
Colby Africa

Reputation: 1376

In Visual Studio, I use macros for many different purposes. One of the most valuable comes when debugging Windows service. I can use the macro engine to start and then attach to the Windows service which just a click of a button.

Also, sometimes I use custom DEFINES that need to be exploded into code--sort of like C/C++ macros.

Colby Africa

Upvotes: 0

Jared
Jared

Reputation: 39877

I find it very useful in microsoft excel. Rather then having to look through documentation to find every object and function I need to call I can record a macro that does most of what I want, take that code and modify it to give me finer control.

Upvotes: 0

Charlie Martin
Charlie Martin

Reputation: 112356

I use them all the time. Say, for example, I want to go down a list, indenting by 4 and adding a "|* ". In EMACS, I hit C-x ( to start recording, do one example line to see that it's what I want, ending with C-n C-a to move to the next line, and end the macro with C-x ). Then C-x e repeats it line by line, and C-u number C-x e does it many times.

Upvotes: 3

Tim
Tim

Reputation: 20360

Waaaay back I used a macro to make function header/comments. Other than that I have not used them.

Basically you can "automate" tedious things you do often that do not have built in ways to do the tasks you do frequently. It is a flexible way to give lots of power to people so they can work more efficiently.

Upvotes: 0

Related Questions